From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 00:10:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E628A106566B; Sun, 6 Dec 2009 00:10:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14EC8FC1A; Sun, 6 Dec 2009 00:10: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 nB60ADjX004066; Sun, 6 Dec 2009 00:10:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB60AD12004058; Sun, 6 Dec 2009 00:10:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912060010.nB60AD12004058@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Dec 2009 00:10: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: r200171 - in head: sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 00:10:14 -0000 Author: mav Date: Sun Dec 6 00:10:13 2009 New Revision: 200171 URL: http://svn.freebsd.org/changeset/base/200171 Log: MFp4: Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part) Modified: head/sbin/atacontrol/atacontrol.c head/sys/arm/mv/mv_sata.c head/sys/cam/ata/ata_xpt.c head/sys/cam/scsi/scsi_cd.c head/sys/conf/NOTES head/sys/conf/options head/sys/dev/ata/ata-all.c head/sys/dev/ata/ata-all.h head/sys/dev/ata/ata-disk.c head/sys/dev/ata/ata-dma.c head/sys/dev/ata/ata-lowlevel.c head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/ata-queue.c head/sys/dev/ata/ata-sata.c head/sys/dev/ata/ata_if.m head/sys/dev/ata/atapi-cd.c head/sys/dev/ata/atapi-fd.c head/sys/dev/ata/atapi-tape.c head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-amd.c head/sys/dev/ata/chipsets/ata-ati.c head/sys/dev/ata/chipsets/ata-cenatek.c head/sys/dev/ata/chipsets/ata-cypress.c head/sys/dev/ata/chipsets/ata-cyrix.c head/sys/dev/ata/chipsets/ata-highpoint.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-ite.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-micron.c head/sys/dev/ata/chipsets/ata-national.c head/sys/dev/ata/chipsets/ata-netcell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-serverworks.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c head/sys/powerpc/powermac/ata_dbdma.c head/sys/powerpc/powermac/ata_kauai.c head/sys/powerpc/powermac/ata_macio.c head/sys/powerpc/psim/ata_iobus.c Modified: head/sbin/atacontrol/atacontrol.c ============================================================================== --- head/sbin/atacontrol/atacontrol.c Sat Dec 5 23:27:21 2009 (r200170) +++ head/sbin/atacontrol/atacontrol.c Sun Dec 6 00:10:13 2009 (r200171) @@ -42,7 +42,7 @@ static const char * mode2str(int mode) { - switch (mode) { + switch (mode & 0xff) { case ATA_PIO: return "BIOSPIO"; case ATA_PIO0: return "PIO0"; case ATA_PIO1: return "PIO1"; @@ -59,13 +59,23 @@ mode2str(int mode) case ATA_UDMA4: return "UDMA66"; case ATA_UDMA5: return "UDMA100"; case ATA_UDMA6: return "UDMA133"; - case ATA_SA150: return "SATA150"; - case ATA_SA300: return "SATA300"; case ATA_DMA: return "BIOSDMA"; default: return "???"; } } +static const char * +satarev2str(int mode) +{ + switch ((mode & 0xff00) >> 8) { + case 0: return ""; + case 1: return "SATA 1.5Gb/s"; + case 2: return "SATA 3Gb/s"; + case 3: return "SATA 6Gb/s"; + default: return "???"; + } +} + static int str2mode(char *str) { @@ -79,7 +89,9 @@ str2mode(char *str) if (!strcasecmp(str, "WDMA1")) return ATA_WDMA1; if (!strcasecmp(str, "WDMA2")) return ATA_WDMA2; if (!strcasecmp(str, "UDMA0")) return ATA_UDMA0; + if (!strcasecmp(str, "UDMA16")) return ATA_UDMA0; if (!strcasecmp(str, "UDMA1")) return ATA_UDMA1; + if (!strcasecmp(str, "UDMA25")) return ATA_UDMA1; if (!strcasecmp(str, "UDMA2")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA33")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA3")) return ATA_UDMA3; @@ -90,8 +102,6 @@ str2mode(char *str) if (!strcasecmp(str, "UDMA100")) return ATA_UDMA5; if (!strcasecmp(str, "UDMA6")) return ATA_UDMA6; if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6; - if (!strcasecmp(str, "SATA150")) return ATA_SA150; - if (!strcasecmp(str, "SATA300")) return ATA_SA300; if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA; return -1; } @@ -382,7 +392,8 @@ main(int argc, char **argv) if (argc == 3 || argc == 4) { if (ioctl(fd, IOCATAGMODE, &mode) < 0) err(1, "ioctl(IOCATAGMODE)"); - printf("current mode = %s\n", mode2str(mode)); + printf("current mode = %s %s\n", + mode2str(mode), satarev2str(mode)); } exit(EX_OK); } Modified: head/sys/arm/mv/mv_sata.c ============================================================================== --- head/sys/arm/mv/mv_sata.c Sat Dec 5 23:27:21 2009 (r200170) +++ head/sys/arm/mv/mv_sata.c Sun Dec 6 00:10:13 2009 (r200171) @@ -136,7 +136,7 @@ static int sata_channel_detach(device_t static int sata_channel_begin_transaction(struct ata_request *request); static int sata_channel_end_transaction(struct ata_request *request); static int sata_channel_status(device_t dev); -static void sata_channel_setmode(device_t parent, device_t dev); +static int sata_channel_setmode(device_t dev, int target, int mode); static void sata_channel_reset(device_t dev); static void sata_channel_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); @@ -748,19 +748,13 @@ sata_channel_reset(device_t dev) SATA_OUTL(sc, SATA_EDMA_IEMR(ch->unit), 0xFFFFFFFF); } -static void -sata_channel_setmode(device_t parent, device_t dev) +static int +sata_channel_setmode(device_t parent, int target, int mode) { - struct ata_device *atadev; - - atadev = device_get_softc(dev); /* Disable EDMA before using legacy registers */ sata_edma_ctrl(parent, 0); - - ata_sata_setmode(dev, ATA_PIO_MAX); - if (atadev->mode >= ATA_DMA) - ata_sata_setmode(dev, atadev->mode); + return (ata_sata_setmode(dev, mode)); } static void Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sat Dec 5 23:27:21 2009 (r200170) +++ head/sys/cam/ata/ata_xpt.c Sun Dec 6 00:10:13 2009 (r200171) @@ -366,7 +366,7 @@ negotiate: cts.xport_specific.sata.valid = CTS_SATA_VALID_MODE; } xpt_action((union ccb *)&cts); - /* Fetch user modes from SIM. */ + /* Fetch current modes from SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; @@ -395,10 +395,25 @@ negotiate: } case PROBE_SET_MULTI: { - u_int sectors; - - sectors = max(1, min(ident_buf->sectors_intr & 0xff, 16)); + u_int sectors, bytecount; + bytecount = 8192; /* SATA maximum */ + /* Fetch user bytecount from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.ata.bytecount; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.sata.bytecount; + } + /* Honor device capabilities. */ + sectors = max(1, min(ident_buf->sectors_intr & 0xff, + bytecount / ata_logical_sector_size(ident_buf))); /* Report bytecount to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); @@ -414,6 +429,20 @@ negotiate: cts.xport_specific.sata.valid = CTS_SATA_VALID_BYTECOUNT; } xpt_action((union ccb *)&cts); + /* Fetch current bytecount from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.ata.bytecount; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.sata.bytecount; + } + sectors = bytecount / ata_logical_sector_size(ident_buf); cam_fill_ataio(ataio, 1, @@ -427,6 +456,45 @@ negotiate: break; } case PROBE_INQUIRY: + { + u_int bytecount; + + bytecount = 8192; /* SATA maximum */ + /* Fetch user bytecount from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.ata.bytecount; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.sata.bytecount; + } + /* Honor device capabilities. */ + bytecount &= ~1; + bytecount = max(2, min(65534, bytecount)); + if (ident_buf->satacapabilities != 0x0000 && + ident_buf->satacapabilities != 0xffff) { + bytecount = min(8192, bytecount); + } + /* Report bytecount to SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + if (path->device->transport == XPORT_ATA) { + cts.xport_specific.ata.bytecount = bytecount; + cts.xport_specific.ata.valid = CTS_ATA_VALID_BYTECOUNT; + } else { + cts.xport_specific.sata.bytecount = bytecount; + cts.xport_specific.sata.valid = CTS_SATA_VALID_BYTECOUNT; + } + xpt_action((union ccb *)&cts); + /* FALLTHROUGH */ + } case PROBE_FULL_INQUIRY: { u_int inquiry_len; Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Sat Dec 5 23:27:21 2009 (r200170) +++ head/sys/cam/scsi/scsi_cd.c Sun Dec 6 00:10:13 2009 (r200171) @@ -726,6 +726,12 @@ cdregister(struct cam_periph *periph, vo softc->disk->d_name = "cd"; softc->disk->d_unit = periph->unit_number; softc->disk->d_drv1 = periph; + if (cpi.maxio == 0) + softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ + else if (cpi.maxio > MAXPHYS) + softc->disk->d_maxsize = MAXPHYS; /* for safety */ + else + softc->disk->d_maxsize = cpi.maxio; softc->disk->d_flags = 0; disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); @@ -2764,7 +2770,6 @@ cdcheckmedia(struct cam_periph *periph) softc = (struct cd_softc *)periph->softc; cdprevent(periph, PR_PREVENT); - softc->disk->d_maxsize = DFLTPHYS; softc->disk->d_sectorsize = 2048; softc->disk->d_mediasize = 0; @@ -2866,7 +2871,6 @@ cdcheckmedia(struct cam_periph *periph) } softc->flags |= CD_FLAG_VALID_TOC; - softc->disk->d_maxsize = DFLTPHYS; softc->disk->d_sectorsize = softc->params.blksize; softc->disk->d_mediasize = (off_t)softc->params.blksize * softc->params.disksize; Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Dec 5 23:27:21 2009 (r200170) +++ head/sys/conf/NOTES Sun Dec 6 00:10:13 2009 (r200171) @@ -1718,9 +1718,15 @@ hint.ata.1.irq="15" # else the device numbers are dynamically allocated. # ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request # before timing out. +# ATA_CAM: Turn ata(4) subsystem controller drivers into cam(4) +# interface modules. This deprecates all ata(4) +# peripheral device drivers (atadisk, ataraid, atapicd, +# atapifd. atapist, atapicam) and all user-level APIs. +# cam(4) drivers and APIs will be connected instead. options ATA_STATIC_ID #options ATA_REQUEST_TIMEOUT=10 +#options ATA_CAM # # Standard floppy disk controllers and floppy tapes, supports Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Dec 5 23:27:21 2009 (r200170) +++ head/sys/conf/options Sun Dec 6 00:10:13 2009 (r200171) @@ -351,6 +351,7 @@ ISCSI_INITIATOR_DEBUG opt_iscsi_initiato ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h ATA_REQUEST_TIMEOUT opt_ata.h +ATA_CAM opt_ata.h # Net stuff. ACCEPT_FILTER_DATA Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Sat Dec 5 23:27:21 2009 (r200170) +++ head/sys/dev/ata/ata-all.c Sun Dec 6 00:10:13 2009 (r200171) @@ -50,6 +50,16 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef ATA_CAM +#include +#include +#include +#include +#include +#include +#endif + +#ifndef ATA_CAM /* device structure */ static d_ioctl_t ata_ioctl; static struct cdevsw ata_cdevsw = { @@ -58,14 +68,21 @@ static struct cdevsw ata_cdevsw = { .d_ioctl = ata_ioctl, .d_name = "ata", }; +#endif /* prototypes */ +#ifndef ATA_CAM static void ata_boot_attach(void); static device_t ata_add_child(device_t, struct ata_device *, int); +#else +static void ataaction(struct cam_sim *sim, union ccb *ccb); +static void atapoll(struct cam_sim *sim); +#endif static void ata_conn_event(void *, int); static void bswap(int8_t *, int); static void btrim(int8_t *, int); static void bpack(int8_t *, int8_t *, int); +static void ata_interrupt_locked(void *data); /* global vars */ MALLOC_DEFINE(M_ATA, "ata_generic", "ATA driver generic layer"); @@ -115,6 +132,10 @@ ata_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); int error, rid; +#ifdef ATA_CAM + struct cam_devq *devq; + int i; +#endif /* check that we have a virgin channel to attach */ if (ch->r_irq) @@ -129,11 +150,23 @@ ata_attach(device_t dev) mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); TAILQ_INIT(&ch->ata_queue); TASK_INIT(&ch->conntask, 0, ata_conn_event, dev); +#ifdef ATA_CAM + for (i = 0; i < 16; i++) { + ch->user[i].mode = 0; + if (ch->flags & ATA_SATA) + ch->user[i].bytecount = 8192; + else + ch->user[i].bytecount = MAXPHYS; + ch->curr[i] = ch->user[i]; + } +#endif /* reset the controller HW, the channel and device(s) */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit) pause("ataatch", 1); +#ifndef ATA_CAM ATA_RESET(dev); +#endif ATA_LOCKING(dev, ATA_LF_UNLOCK); /* allocate DMA resources if DMA HW present*/ @@ -154,18 +187,61 @@ ata_attach(device_t dev) return error; } +#ifndef ATA_CAM /* probe and attach devices on this channel unless we are in early boot */ if (!ata_delayed_attach) ata_identify(dev); - return 0; + return (0); +#else + mtx_lock(&ch->state_mtx); + /* Create the device queue for our SIM. */ + devq = cam_simq_alloc(1); + if (devq == NULL) { + device_printf(dev, "Unable to allocate simq\n"); + error = ENOMEM; + goto err1; + } + /* Construct SIM entry */ + ch->sim = cam_sim_alloc(ataaction, atapoll, "ata", ch, + device_get_unit(dev), &ch->state_mtx, 1, 0, devq); + if (ch->sim == NULL) { + device_printf(dev, "unable to allocate sim\n"); + error = ENOMEM; + goto err2; + } + if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) { + device_printf(dev, "unable to register xpt bus\n"); + error = ENXIO; + goto err2; + } + if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + device_printf(dev, "unable to create path\n"); + error = ENXIO; + goto err3; + } + mtx_unlock(&ch->state_mtx); + return (0); + +err3: + xpt_bus_deregister(cam_sim_path(ch->sim)); +err2: + cam_sim_free(ch->sim, /*free_devq*/TRUE); +err1: + bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); + mtx_unlock(&ch->state_mtx); + return (error); +#endif } int ata_detach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); +#ifndef ATA_CAM device_t *children; int nchildren, i; +#endif /* check that we have a valid channel to detach */ if (!ch->r_irq) @@ -176,6 +252,7 @@ ata_detach(device_t dev) ch->state |= ATA_STALL_QUEUE; mtx_unlock(&ch->state_mtx); +#ifndef ATA_CAM /* detach & delete all children */ if (!device_get_children(dev, &children, &nchildren)) { for (i = 0; i < nchildren; i++) @@ -183,8 +260,18 @@ ata_detach(device_t dev) device_delete_child(dev, children[i]); free(children, M_TEMP); } +#endif taskqueue_drain(taskqueue_thread, &ch->conntask); +#ifdef ATA_CAM + mtx_lock(&ch->state_mtx); + xpt_async(AC_LOST_DEVICE, ch->path, NULL); + xpt_free_path(ch->path); + xpt_bus_deregister(cam_sim_path(ch->sim)); + cam_sim_free(ch->sim, /*free_devq*/TRUE); + mtx_unlock(&ch->state_mtx); +#endif + /* release resources */ bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); @@ -203,8 +290,11 @@ static void ata_conn_event(void *context, int dummy) { device_t dev = (device_t)context; + struct ata_channel *ch = device_get_softc(dev); + mtx_lock(&ch->state_mtx); ata_reinit(dev); + mtx_unlock(&ch->state_mtx); } int @@ -212,6 +302,7 @@ ata_reinit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); struct ata_request *request; +#ifndef ATA_CAM device_t *children; int nchildren, i; @@ -298,7 +389,23 @@ ata_reinit(device_t dev) /* kick off requests on the queue */ ata_start(dev); - return 0; +#else + if ((request = ch->running)) { + ch->running = NULL; + if (ch->state == ATA_ACTIVE) + ch->state = ATA_IDLE; + callout_stop(&request->callout); + if (ch->dma.unload) + ch->dma.unload(request); + request->result = ERESTART; + ata_cam_end_transaction(dev, request); + } + /* reset the controller HW, the channel and device(s) */ + ATA_RESET(dev); + /* Tell the XPT about the event */ + xpt_async(AC_BUS_RESET, ch->path, NULL); +#endif + return(0); } int @@ -310,6 +417,7 @@ ata_suspend(device_t dev) if (!dev || !(ch = device_get_softc(dev))) return ENXIO; +#ifndef ATA_CAM /* wait for the channel to be IDLE or detached before suspending */ while (ch->r_irq) { mtx_lock(&ch->state_mtx); @@ -322,7 +430,8 @@ ata_suspend(device_t dev) tsleep(ch, PRIBIO, "atasusp", hz/10); } ATA_LOCKING(dev, ATA_LF_UNLOCK); - return 0; +#endif + return(0); } int @@ -337,18 +446,36 @@ ata_resume(device_t dev) /* reinit the devices, we dont know what mode/state they are in */ error = ata_reinit(dev); +#ifndef ATA_CAM /* kick off requests on the queue */ ata_start(dev); +#endif return error; } void ata_interrupt(void *data) { +#ifdef ATA_CAM + struct ata_channel *ch = (struct ata_channel *)data; + + mtx_lock(&ch->state_mtx); +#endif + ata_interrupt_locked(data); +#ifdef ATA_CAM + mtx_unlock(&ch->state_mtx); +#endif +} + +static void +ata_interrupt_locked(void *data) +{ struct ata_channel *ch = (struct ata_channel *)data; struct ata_request *request; +#ifndef ATA_CAM mtx_lock(&ch->state_mtx); +#endif do { /* ignore interrupt if its not for us */ if (ch->hw.status && !ch->hw.status(ch->dev)) @@ -374,18 +501,71 @@ ata_interrupt(void *data) ch->running = NULL; if (ch->state == ATA_ACTIVE) ch->state = ATA_IDLE; +#ifdef ATA_CAM + ata_cam_end_transaction(ch->dev, request); +#else mtx_unlock(&ch->state_mtx); ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); ata_finish(request); +#endif return; } } while (0); +#ifndef ATA_CAM mtx_unlock(&ch->state_mtx); +#endif +} + +void +ata_print_cable(device_t dev, u_int8_t *who) +{ + device_printf(dev, + "DMA limited to UDMA33, %s found non-ATA66 cable\n", who); +} + +int +ata_check_80pin(device_t dev, int mode) +{ + struct ata_device *atadev = device_get_softc(dev); + + if (!ata_dma_check_80pin) { + if (bootverbose) + device_printf(dev, "Skipping 80pin cable check\n"); + return mode; + } + + if (mode > ATA_UDMA2 && !(atadev->param.hwres & ATA_CABLE_ID)) { + ata_print_cable(dev, "device"); + mode = ATA_UDMA2; + } + return mode; +} + +void +ata_setmode(device_t dev) +{ + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); + struct ata_device *atadev = device_get_softc(dev); + int error, mode, pmode; + + mode = atadev->mode; + do { + pmode = mode = ata_limit_mode(dev, mode, ATA_DMA_MAX); + mode = ATA_SETMODE(device_get_parent(dev), atadev->unit, mode); + if ((ch->flags & (ATA_CHECKS_CABLE | ATA_SATA)) == 0) + mode = ata_check_80pin(dev, mode); + } while (pmode != mode); /* Interate till successfull negotiation. */ + error = ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode); + if (bootverbose) + device_printf(dev, "%ssetting %s\n", + (error) ? "FAILURE " : "", ata_mode2str(mode)); + atadev->mode = mode; } /* * device related interfaces */ +#ifndef ATA_CAM static int ata_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag, struct thread *td) @@ -467,6 +647,7 @@ ata_ioctl(struct cdev *dev, u_long cmd, } return error; } +#endif int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) @@ -549,11 +730,12 @@ ata_device_ioctl(device_t dev, u_long cm case IOCATASMODE: atadev->mode = *mode; - ATA_SETMODE(device_get_parent(dev), dev); + ata_setmode(dev); return 0; case IOCATAGMODE: - *mode = atadev->mode; + *mode = atadev->mode | + (ATA_GETREV(device_get_parent(dev), atadev->unit) << 8); return 0; case IOCATASSPINDOWN: atadev->spindown = *mode; @@ -566,6 +748,7 @@ ata_device_ioctl(device_t dev, u_long cm } } +#ifndef ATA_CAM static void ata_boot_attach(void) { @@ -590,11 +773,12 @@ ata_boot_attach(void) mtx_unlock(&Giant); /* newbus suckage dealt with, release Giant */ } - +#endif /* * misc support functions */ +#ifndef ATA_CAM static device_t ata_add_child(device_t parent, struct ata_device *atadev, int unit) { @@ -609,6 +793,7 @@ ata_add_child(device_t parent, struct at } return child; } +#endif int ata_getparam(struct ata_device *atadev, int init) @@ -705,6 +890,7 @@ ata_getparam(struct ata_device *atadev, return error; } +#ifndef ATA_CAM int ata_identify(device_t dev) { @@ -778,6 +964,7 @@ ata_identify(device_t dev) mtx_unlock(&Giant); return 0; } +#endif void ata_default_registers(device_t dev) @@ -920,7 +1107,7 @@ ata_unit2str(struct ata_device *atadev) return str; } -char * +const char * ata_mode2str(int mode) { switch (mode) { @@ -950,6 +1137,18 @@ ata_mode2str(int mode) } } +const char * +ata_satarev2str(int rev) +{ + switch (rev) { + case 0: return ""; + case 1: return "SATA 1.5Gb/s"; + case 2: return "SATA 3Gb/s"; + case 3: return "SATA 6Gb/s"; + default: return "???"; + } +} + int ata_atapi(device_t dev) { @@ -1081,6 +1280,358 @@ bpack(int8_t *src, int8_t *dst, int len) dst[j] = 0x00; } +#ifdef ATA_CAM +void +ata_cam_begin_transaction(device_t dev, union ccb *ccb) +{ + struct ata_channel *ch = device_get_softc(dev); + struct ata_request *request; + + if (!(request = ata_alloc_request())) { + device_printf(dev, "FAILURE - out of memory in start\n"); + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + return; + } + bzero(request, sizeof(*request)); + + /* setup request */ + request->dev = NULL; + request->parent = dev; + request->unit = ccb->ccb_h.target_id; + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + request->data = ccb->ataio.data_ptr; + request->bytecount = ccb->ataio.dxfer_len; + request->u.ata.command = ccb->ataio.cmd.command; + request->u.ata.feature = ((uint16_t)ccb->ataio.cmd.features_exp << 8) | + (uint16_t)ccb->ataio.cmd.features; + request->u.ata.count = ((uint16_t)ccb->ataio.cmd.sector_count_exp << 8) | + (uint16_t)ccb->ataio.cmd.sector_count; + if (ccb->ataio.cmd.flags & CAM_ATAIO_48BIT) { + request->flags |= ATA_R_48BIT; + request->u.ata.lba = + ((uint64_t)ccb->ataio.cmd.lba_high_exp << 40) | + ((uint64_t)ccb->ataio.cmd.lba_mid_exp << 32) | + ((uint64_t)ccb->ataio.cmd.lba_low_exp << 24); + } else { + request->u.ata.lba = + ((uint64_t)(ccb->ataio.cmd.device & 0x0f) << 24); + } + request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) | + ((uint64_t)ccb->ataio.cmd.lba_mid << 8) | + (uint64_t)ccb->ataio.cmd.lba_low; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && + ccb->ataio.cmd.flags & CAM_ATAIO_DMA) + request->flags |= ATA_R_DMA; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) + request->flags |= ATA_R_READ; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) + request->flags |= ATA_R_WRITE; + } else { + request->data = ccb->csio.data_ptr; + request->bytecount = ccb->csio.dxfer_len; + bcopy((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes, + request->u.atapi.ccb, ccb->csio.cdb_len); + request->flags |= ATA_R_ATAPI; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && + ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA) + request->flags |= ATA_R_DMA; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) + request->flags |= ATA_R_READ; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) + request->flags |= ATA_R_WRITE; + } + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); +// request->callback = ad_done; + request->retries = 0; + request->timeout = (ccb->ccb_h.timeout + 999) / 1000; + callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); + request->ccb = ccb; + + ch->running = request; + ch->state = ATA_ACTIVE; + if (ch->hw.begin_transaction(request) == ATA_OP_FINISHED) { + ch->running = NULL; + ch->state = ATA_IDLE; + ata_cam_end_transaction(dev, request); + return; + } +} + +void +ata_cam_end_transaction(device_t dev, struct ata_request *request) +{ + struct ata_channel *ch = device_get_softc(dev); + union ccb *ccb = request->ccb; + int fatalerr = 0; + + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + if (request->flags & ATA_R_TIMEOUT) { + xpt_freeze_simq(ch->sim, 1); + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + ccb->ccb_h.status |= CAM_CMD_TIMEOUT | CAM_RELEASE_SIMQ; + fatalerr = 1; + } else if (request->status & ATA_S_ERROR) { + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; + } else { + ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; + ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + } + } else if (request->result == ERESTART) + ccb->ccb_h.status |= CAM_REQUEUE_REQ; + else if (request->result != 0) + ccb->ccb_h.status |= CAM_REQ_CMP_ERR; + else + ccb->ccb_h.status |= CAM_REQ_CMP; + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP && + !(ccb->ccb_h.status & CAM_DEV_QFRZN)) { + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status |= CAM_DEV_QFRZN; + } + if (ccb->ccb_h.func_code == XPT_ATA_IO && + ((request->status & ATA_S_ERROR) || + (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT))) { + struct ata_res *res = &ccb->ataio.res; + res->status = request->status; + res->error = request->error; + res->lba_low = request->u.ata.lba; + res->lba_mid = request->u.ata.lba >> 8; + res->lba_high = request->u.ata.lba >> 16; + res->device = request->u.ata.lba >> 24; + res->lba_low_exp = request->u.ata.lba >> 24; + res->lba_mid_exp = request->u.ata.lba >> 32; + res->lba_high_exp = request->u.ata.lba >> 40; + res->sector_count = request->u.ata.count; + res->sector_count_exp = request->u.ata.count >> 8; + } + ata_free_request(request); + xpt_done(ccb); + /* Do error recovery if needed. */ + if (fatalerr) + ata_reinit(dev); +} + +static void +ataaction(struct cam_sim *sim, union ccb *ccb) +{ + device_t dev; + struct ata_channel *ch; + + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ataaction func_code=%x\n", + ccb->ccb_h.func_code)); + + ch = (struct ata_channel *)cam_sim_softc(sim); + dev = ch->dev; + switch (ccb->ccb_h.func_code) { + /* Common cases first */ + case XPT_ATA_IO: /* Execute the requested I/O operation */ + case XPT_SCSI_IO: + if ((ch->devices & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER) + << ccb->ccb_h.target_id)) == 0) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + break; + } + if (ch->running) + device_printf(dev, "already running!\n"); + if (ccb->ccb_h.func_code == XPT_ATA_IO && + (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && + (ccb->ataio.cmd.control & ATA_A_RESET)) { + struct ata_res *res = &ccb->ataio.res; + + bzero(res, sizeof(*res)); + if (ch->devices & (ATA_ATA_MASTER << ccb->ccb_h.target_id)) { + res->lba_high = 0; + res->lba_mid = 0; + } else { + res->lba_high = 0xeb; + res->lba_mid = 0x14; + } + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } + ata_cam_begin_transaction(dev, ccb); + break; + case XPT_EN_LUN: /* Enable LUN as a target */ + case XPT_TARGET_IO: /* Execute target I/O request */ + case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ + case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ + case XPT_ABORT: /* Abort the specified CCB */ + /* XXX Implement */ + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + break; + case XPT_SET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + struct ata_cam_device *d; + + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) + d->revision = cts->xport_specific.sata.revision; + if (cts->xport_specific.ata.valid & CTS_SATA_VALID_MODE) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + d->mode = ATA_SETMODE(ch->dev, + ccb->ccb_h.target_id, + cts->xport_specific.sata.mode); + } else + d->mode = cts->xport_specific.sata.mode; + } + if (cts->xport_specific.ata.valid & CTS_SATA_VALID_BYTECOUNT) + d->bytecount = min(8192, cts->xport_specific.sata.bytecount); + } else { + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + d->mode = ATA_SETMODE(ch->dev, + ccb->ccb_h.target_id, + cts->xport_specific.ata.mode); + } else + d->mode = cts->xport_specific.ata.mode; + } + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + d->bytecount = cts->xport_specific.ata.bytecount; + if (ch->flags & ATA_SATA) + d->bytecount = min(8192, d->bytecount); + } + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + struct ata_cam_device *d; + + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; + cts->protocol = PROTO_ATA; + cts->protocol_version = PROTO_VERSION_UNSPECIFIED; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + cts->transport = XPORT_SATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.sata.mode = d->mode; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; + cts->xport_specific.sata.bytecount = d->bytecount; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_BYTECOUNT; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + cts->xport_specific.sata.revision = + ATA_GETREV(dev, ccb->ccb_h.target_id); + } else + cts->xport_specific.sata.revision = d->revision; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + } else { + cts->transport = XPORT_ATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.ata.mode = d->mode; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; + cts->xport_specific.ata.bytecount = d->bytecount; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + } + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } +#if 0 + case XPT_CALC_GEOMETRY: + { + struct ccb_calc_geometry *ccg; + uint32_t size_mb; + uint32_t secs_per_cylinder; + + ccg = &ccb->ccg; + size_mb = ccg->volume_size + / ((1024L * 1024L) / ccg->block_size); + if (size_mb >= 1024 && (aha->extended_trans != 0)) { + if (size_mb >= 2048) { + ccg->heads = 255; + ccg->secs_per_track = 63; + } else { + ccg->heads = 128; + ccg->secs_per_track = 32; + } + } else { + ccg->heads = 64; + ccg->secs_per_track = 32; + } + secs_per_cylinder = ccg->heads * ccg->secs_per_track; + ccg->cylinders = ccg->volume_size / secs_per_cylinder; + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } +#endif + case XPT_RESET_BUS: /* Reset the specified SCSI bus */ + case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ + ata_reinit(dev); + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 01:10:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24DA1106566B; Sun, 6 Dec 2009 01:10:31 +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 133348FC16; Sun, 6 Dec 2009 01:10: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 nB61AUHO005508; Sun, 6 Dec 2009 01:10:30 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB61AUAF005505; Sun, 6 Dec 2009 01:10:30 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912060110.nB61AUAF005505@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Dec 2009 01:10: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: r200172 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 01:10:31 -0000 Author: ed Date: Sun Dec 6 01:10:30 2009 New Revision: 200172 URL: http://svn.freebsd.org/changeset/base/200172 Log: Let w(1) use utmpx. We don't have UT_*SIZE anymore. One of the reasons for that is because all strings are null terminated, there is no need for apps to copy strings out of the utmpx structure. This means we can define W_DISP*SIZE lengths for all columns. While there, adjust the sizes a little. Steal some bytes from the username column, while extending the hostname column quite a bit. Modified: head/usr.bin/w/Makefile head/usr.bin/w/w.c Modified: head/usr.bin/w/Makefile ============================================================================== --- head/usr.bin/w/Makefile Sun Dec 6 00:10:13 2009 (r200171) +++ head/usr.bin/w/Makefile Sun Dec 6 01:10:30 2009 (r200172) @@ -4,8 +4,8 @@ PROG= w SRCS= fmt.c pr_time.c proc_compare.c w.c MAN= w.1 uptime.1 -DPADD= ${LIBKVM} ${LIBUTIL} -LDADD= -lkvm -lutil +DPADD= ${LIBKVM} ${LIBULOG} ${LIBUTIL} +LDADD= -lkvm -lulog -lutil #BINGRP= kmem #BINMODE=2555 LINKS= ${BINDIR}/w ${BINDIR}/uptime Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Sun Dec 6 00:10:13 2009 (r200171) +++ head/usr.bin/w/w.c Sun Dec 6 01:10:30 2009 (r200172) @@ -83,14 +83,15 @@ static const char sccsid[] = "@(#)w.c 8. #include #include #include +#define _ULOG_POSIX_NAMES +#include #include -#include #include #include "extern.h" struct timeval boottime; -struct utmp utmp; +struct utmpx *utmp; struct winsize ws; kvm_t *kd; time_t now; /* the current time of day */ @@ -109,7 +110,7 @@ char **sel_users; /* login array o */ struct entry { struct entry *next; - struct utmp utmp; + struct utmpx utmp; dev_t tdev; /* dev_t of terminal */ time_t idle; /* idle time of terminal in seconds */ struct kinfo_proc *kp; /* `most interesting' proc */ @@ -119,11 +120,12 @@ struct entry { #define debugproc(p) *((struct kinfo_proc **)&(p)->ki_udata) -/* W_DISPHOSTSIZE should not be greater than UT_HOSTSIZE */ -#define W_DISPHOSTSIZE 16 +#define W_DISPUSERSIZE 10 +#define W_DISPLINESIZE 8 +#define W_DISPHOSTSIZE 24 static void pr_header(time_t *, int); -static struct stat *ttystat(char *, int); +static struct stat *ttystat(char *); static void usage(int); static int this_is_uptime(const char *s); @@ -135,7 +137,6 @@ main(int argc, char *argv[]) struct kinfo_proc *kp; struct kinfo_proc *dkp; struct stat *stp; - FILE *ut; time_t touched; int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid; const char *memf, *nlistf, *p; @@ -208,16 +209,15 @@ main(int argc, char *argv[]) errx(1, "%s", errbuf); (void)time(&now); - if ((ut = fopen(_PATH_UTMP, "r")) == NULL) - err(1, "%s", _PATH_UTMP); if (*argv) sel_users = argv; - for (nusers = 0; fread(&utmp, sizeof(utmp), 1, ut);) { - if (utmp.ut_name[0] == '\0') + setutxent(); + for (nusers = 0; (utmp = getutxent()) != NULL;) { + if (utmp->ut_type != USER_PROCESS) continue; - if (!(stp = ttystat(utmp.ut_line, UT_LINESIZE))) + if (!(stp = ttystat(utmp->ut_line))) continue; /* corrupted record */ ++nusers; if (wcmd == 0) @@ -228,7 +228,7 @@ main(int argc, char *argv[]) usermatch = 0; for (user = sel_users; !usermatch && *user; user++) - if (!strncmp(utmp.ut_name, *user, UT_NAMESIZE)) + if (!strcmp(utmp->ut_user, *user)) usermatch = 1; if (!usermatch) continue; @@ -237,7 +237,7 @@ main(int argc, char *argv[]) errx(1, "calloc"); *nextp = ep; nextp = &ep->next; - memmove(&ep->utmp, &utmp, sizeof(struct utmp)); + memmove(&ep->utmp, utmp, sizeof *utmp); ep->tdev = stp->st_rdev; /* * If this is the console device, attempt to ascertain @@ -250,14 +250,14 @@ main(int argc, char *argv[]) (void)sysctlbyname("machdep.consdev", &ep->tdev, &size, NULL, 0); } touched = stp->st_atime; - if (touched < ep->utmp.ut_time) { + if (touched < ep->utmp.ut_tv.tv_sec) { /* tty untouched since before login */ - touched = ep->utmp.ut_time; + touched = ep->utmp.ut_tv.tv_sec; } if ((ep->idle = now - touched) < 0) ep->idle = 0; } - (void)fclose(ut); + endutxent(); if (header || wcmd == 0) { pr_header(&now, nusers); @@ -271,11 +271,11 @@ main(int argc, char *argv[]) #define HEADER_FROM "FROM" #define HEADER_LOGIN_IDLE "LOGIN@ IDLE " #define HEADER_WHAT "WHAT\n" -#define WUSED (UT_NAMESIZE + UT_LINESIZE + W_DISPHOSTSIZE + \ +#define WUSED (W_DISPUSERSIZE + W_DISPLINESIZE + W_DISPHOSTSIZE + \ sizeof(HEADER_LOGIN_IDLE) + 3) /* header width incl. spaces */ (void)printf("%-*.*s %-*.*s %-*.*s %s", - UT_NAMESIZE, UT_NAMESIZE, HEADER_USER, - UT_LINESIZE, UT_LINESIZE, HEADER_TTY, + W_DISPUSERSIZE, W_DISPUSERSIZE, HEADER_USER, + W_DISPLINESIZE, W_DISPLINESIZE, HEADER_TTY, W_DISPHOSTSIZE, W_DISPHOSTSIZE, HEADER_FROM, HEADER_LOGIN_IDLE HEADER_WHAT); } @@ -347,7 +347,6 @@ main(int argc, char *argv[]) } for (ep = ehead; ep != NULL; ep = ep->next) { - char host_buf[UT_HOSTSIZE + 1]; struct addrinfo hints, *res; struct sockaddr_storage ss; struct sockaddr *sa = (struct sockaddr *)&ss; @@ -356,9 +355,7 @@ main(int argc, char *argv[]) time_t t; int isaddr; - host_buf[UT_HOSTSIZE] = '\0'; - strncpy(host_buf, ep->utmp.ut_host, UT_HOSTSIZE); - p = *host_buf ? host_buf : "-"; + p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; if ((x_suffix = strrchr(p, ':')) != NULL) { if ((dot = strchr(x_suffix, '.')) != NULL && strchr(dot+1, '.') == NULL) @@ -419,13 +416,13 @@ main(int argc, char *argv[]) } } (void)printf("%-*.*s %-*.*s %-*.*s ", - UT_NAMESIZE, UT_NAMESIZE, ep->utmp.ut_name, - UT_LINESIZE, UT_LINESIZE, + W_DISPUSERSIZE, W_DISPUSERSIZE, ep->utmp.ut_user, + W_DISPLINESIZE, W_DISPLINESIZE, strncmp(ep->utmp.ut_line, "tty", 3) && strncmp(ep->utmp.ut_line, "cua", 3) ? ep->utmp.ut_line : ep->utmp.ut_line + 3, W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-"); - t = _time_to_time32(ep->utmp.ut_time); + t = ep->utmp.ut_tv.tv_sec; longattime = pr_attime(&t, &now); longidle = pr_idle(ep->idle); (void)printf("%.*s\n", argwidth - longidle - longattime, @@ -496,12 +493,12 @@ pr_header(time_t *nowp, int nusers) } static struct stat * -ttystat(char *line, int sz) +ttystat(char *line) { static struct stat sb; char ttybuf[MAXPATHLEN]; - (void)snprintf(ttybuf, sizeof(ttybuf), "%s%.*s", _PATH_DEV, sz, line); + (void)snprintf(ttybuf, sizeof(ttybuf), "%s%s", _PATH_DEV, line); if (stat(ttybuf, &sb) == 0) { return (&sb); } else From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 01:27:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5646A106566C; Sun, 6 Dec 2009 01:27:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45AE98FC16; Sun, 6 Dec 2009 01:27: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 nB61RSlp005985; Sun, 6 Dec 2009 01:27:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB61RSel005983; Sun, 6 Dec 2009 01:27:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912060127.nB61RSel005983@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Dec 2009 01:27: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: r200173 - head/usr.sbin/pw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 01:27:28 -0000 Author: ed Date: Sun Dec 6 01:27:28 2009 New Revision: 200173 URL: http://svn.freebsd.org/changeset/base/200173 Log: Make pw(8) build without . The size of the username record in utmp files should not influence the maximum username length. Right now ut_user/ut_name is big enough, so in this case it's dead code anyway. Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Dec 6 01:10:30 2009 (r200172) +++ head/usr.sbin/pw/pw_user.c Sun Dec 6 01:27:28 2009 (r200173) @@ -41,16 +41,11 @@ static const char rcsid[] = #include #include #include -#include #include #include "pw.h" #include "bitmap.h" -#if (MAXLOGNAME-1) > UT_NAMESIZE -#define LOGNAMESIZE UT_NAMESIZE -#else #define LOGNAMESIZE (MAXLOGNAME-1) -#endif static char locked_str[] = "*LOCKED*"; From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 01:29:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CDFC1065672; Sun, 6 Dec 2009 01:29:49 +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 6C5E28FC0A; Sun, 6 Dec 2009 01:29: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 nB61Tnfi006056; Sun, 6 Dec 2009 01:29:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB61TnVw006054; Sun, 6 Dec 2009 01:29:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912060129.nB61TnVw006054@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Dec 2009 01:29: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: r200174 - head/usr.sbin/repquota X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 01:29:49 -0000 Author: ed Date: Sun Dec 6 01:29:49 2009 New Revision: 200174 URL: http://svn.freebsd.org/changeset/base/200174 Log: Don't depend on . MAXLOGNAME seems more applicable in this case, because UT_NAMESIZE refers to the username field in utmp files, which is clearly unrelated to repquota(8). Modified: head/usr.sbin/repquota/repquota.c Modified: head/usr.sbin/repquota/repquota.c ============================================================================== --- head/usr.sbin/repquota/repquota.c Sun Dec 6 01:27:28 2009 (r200173) +++ head/usr.sbin/repquota/repquota.c Sun Dec 6 01:29:49 2009 (r200174) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* Let's be paranoid about block size */ #if 10 > DEV_BSHIFT @@ -227,9 +226,9 @@ repquota(struct fstab *fs, int type, cha } fclose(qf); printf("%*s Block limits File limits\n", - max(UT_NAMESIZE,10), " "); + max(MAXLOGNAME-1,10), " "); printf("%s%*s used soft hard grace used soft hard grace\n", - type == USRQUOTA ? "User " : "Group", max(UT_NAMESIZE,10), " "); + type == USRQUOTA ? "User " : "Group", max(MAXLOGNAME-1,10), " "); for (id = 0; id <= highid[type]; id++) { fup = lookup(id, type); if (fup == 0) @@ -237,7 +236,7 @@ repquota(struct fstab *fs, int type, cha if (fup->fu_dqblk.dqb_curinodes == 0 && fup->fu_dqblk.dqb_curblocks == 0) continue; - printf("%-*s ", max(UT_NAMESIZE,10), fup->fu_name); + printf("%-*s ", max(MAXLOGNAME-1,10), fup->fu_name); printf("%c%c %8lu %8lu %8lu %6s", fup->fu_dqblk.dqb_bsoftlimit && fup->fu_dqblk.dqb_curblocks >= From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 01:45:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A633106566C; Sun, 6 Dec 2009 01:45:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 866DE8FC0A; Sun, 6 Dec 2009 01:45: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 nB61jtkU006472; Sun, 6 Dec 2009 01:45:55 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB61jtQV006465; Sun, 6 Dec 2009 01:45:55 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200912060145.nB61jtQV006465@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 6 Dec 2009 01:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200175 - in stable/8/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 01:45:55 -0000 Author: np Date: Sun Dec 6 01:45:55 2009 New Revision: 200175 URL: http://svn.freebsd.org/changeset/base/200175 Log: MFC r199237, r199238, r199239, r199240, r200003 r199237: sc->rev and is_offload(sc) will always be 0 during probe. Wait till attach to get correct values. r199238: Make sure *some* edc is setup even for an unknown transceiver (assume it is optical). r199239: The 10GBASE-T card should use an IPG of 1. Also enable the check for low power startup on this card. r199240: Don't disable the XGMAC's tx on ifconfig down. It is unnecessary and can cause false backpressure in the chip. Fix a us/ms mixup while here. r200003: T3 firmware 7.8.0 for cxgb(4) Modified: stable/8/sys/dev/cxgb/common/cxgb_ael1002.c stable/8/sys/dev/cxgb/common/cxgb_aq100x.c stable/8/sys/dev/cxgb/common/cxgb_common.h stable/8/sys/dev/cxgb/common/cxgb_xgmac.c stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/cxgb/cxgb_t3fw.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_ael1002.c Sun Dec 6 01:29:49 2009 (r200174) +++ stable/8/sys/dev/cxgb/common/cxgb_ael1002.c Sun Dec 6 01:45:55 2009 (r200175) @@ -1270,7 +1270,7 @@ static int ael2005_reset(struct cphy *ph return err; phy->modtype = (u8)err; - if (err == phy_modtype_none || err == phy_modtype_unknown) + if (err == phy_modtype_none) err = 0; else if (err == phy_modtype_twinax || err == phy_modtype_twinax_long) err = ael2005_setup_twinax_edc(phy, err); @@ -1981,7 +1981,7 @@ static int ael2020_reset(struct cphy *ph if (err < 0) return err; phy->modtype = (u8)err; - if (err == phy_modtype_none || err == phy_modtype_unknown) + if (err == phy_modtype_none) err = 0; else if (err == phy_modtype_twinax || err == phy_modtype_twinax_long) err = ael2020_setup_twinax_edc(phy, err); Modified: stable/8/sys/dev/cxgb/common/cxgb_aq100x.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Sun Dec 6 01:29:49 2009 (r200174) +++ stable/8/sys/dev/cxgb/common/cxgb_aq100x.c Sun Dec 6 01:45:55 2009 (r200175) @@ -515,13 +515,11 @@ t3_aq100x_phy_prep(pinfo_t *pinfo, int p CH_WARN(adapter, "PHY%d: unknown firmware %d.%d\n", phy_addr, v >> 8, v & 0xff); -#if 0 /* The PHY should start in really-low-power mode. */ (void) mdio_read(phy, MDIO_DEV_PMA_PMD, MII_BMCR, &v); if ((v & BMCR_PDOWN) == 0) CH_WARN(adapter, "PHY%d does not start in low power mode.\n", phy_addr); -#endif /* * Verify XAUI and 1000-X settings, but let prep succeed no matter what. Modified: stable/8/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_common.h Sun Dec 6 01:29:49 2009 (r200174) +++ stable/8/sys/dev/cxgb/common/cxgb_common.h Sun Dec 6 01:45:55 2009 (r200175) @@ -97,7 +97,7 @@ enum { enum { FW_VERSION_MAJOR = 7, - FW_VERSION_MINOR = 7, + FW_VERSION_MINOR = 8, FW_VERSION_MICRO = 0 }; Modified: stable/8/sys/dev/cxgb/common/cxgb_xgmac.c ============================================================================== --- stable/8/sys/dev/cxgb/common/cxgb_xgmac.c Sun Dec 6 01:29:49 2009 (r200174) +++ stable/8/sys/dev/cxgb/common/cxgb_xgmac.c Sun Dec 6 01:45:55 2009 (r200175) @@ -508,7 +508,7 @@ int t3_mac_set_mtu(struct cmac *mac, uns thres /= 10; thres = mtu > thres ? (mtu - thres + 7) / 8 : 0; thres = max(thres, 8U); /* need at least 8 */ - ipg = (adap->params.rev == T3_REV_C) ? 0 : 1; + ipg = (port_type == 9 || adap->params.rev != T3_REV_C) ? 1 : 0; t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset, V_TXFIFOTHRESH(M_TXFIFOTHRESH) | V_TXIPG(M_TXIPG), V_TXFIFOTHRESH(thres) | V_TXIPG(ipg)); Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Sun Dec 6 01:29:49 2009 (r200174) +++ stable/8/sys/dev/cxgb/cxgb_main.c Sun Dec 6 01:45:55 2009 (r200175) @@ -1989,14 +1989,14 @@ cxgb_uninit_synchronized(struct port_inf t3_set_reg_field(sc, A_XGM_RXFIFO_CFG + pi->mac.offset, V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM), 0); - DELAY(100); + DELAY(100 * 1000); /* Wait for TXFIFO empty */ t3_wait_op_done(sc, A_XGM_TXFIFO_CFG + pi->mac.offset, F_TXFIFO_EMPTY, 1, 20, 5); - DELAY(100); - t3_mac_disable(&pi->mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); + DELAY(100 * 1000); + t3_mac_disable(&pi->mac, MAC_DIRECTION_RX); pi->phy.ops->power_down(&pi->phy, 1); Modified: stable/8/sys/dev/cxgb/cxgb_t3fw.h ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_t3fw.h Sun Dec 6 01:29:49 2009 (r200174) +++ stable/8/sys/dev/cxgb/cxgb_t3fw.h Sun Dec 6 01:45:55 2009 (r200175) @@ -32,8 +32,8 @@ $FreeBSD$ #define U (unsigned char) -static unsigned int t3fw_length = 30772; -static unsigned char t3fw[30772] = { +static unsigned int t3fw_length = 30840; +static unsigned char t3fw[30840] = { U 0x60, U 0x00, U 0x74, U 0x00, U 0x20, U 0x03, U 0x80, U 0x00, U 0x20, U 0x03, U 0x70, U 0x00, @@ -55,13 +55,13 @@ static unsigned char t3fw[30772] = { U 0x1F, U 0xFF, U 0xC0, U 0x00, U 0xE3, U 0x00, U 0x04, U 0x3C, U 0x02, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6B, U 0xE8, + U 0x20, U 0x00, U 0x6C, U 0x34, U 0x1F, U 0xFF, U 0xC2, U 0x90, - U 0x20, U 0x00, U 0x6C, U 0x30, + U 0x20, U 0x00, U 0x6C, U 0x7C, U 0x1F, U 0xFF, U 0xC2, U 0x94, - U 0x20, U 0x00, U 0x6C, U 0x70, + U 0x20, U 0x00, U 0x6C, U 0xBC, U 0x1F, U 0xFF, U 0xC2, U 0x98, - U 0x20, U 0x00, U 0x6C, U 0xE4, + U 0x20, U 0x00, U 0x6D, U 0x30, U 0x1F, U 0xFF, U 0xC2, U 0x9C, U 0x20, U 0x00, U 0x03, U 0xC0, U 0xC0, U 0x00, U 0x00, U 0xE4, @@ -396,11 +396,11 @@ static unsigned char t3fw[30772] = { U 0x20, U 0x00, U 0x03, U 0xB0, U 0xE3, U 0x00, U 0x0D, U 0x3C, U 0x20, U 0x00, U 0x03, U 0xB0, - U 0x20, U 0x00, U 0x6E, U 0x08, + U 0x20, U 0x00, U 0x6E, U 0x54, U 0xE3, U 0x00, U 0x0D, U 0x3C, - U 0x20, U 0x00, U 0x6E, U 0x08, - U 0x20, U 0x00, U 0x6E, U 0x08, - U 0xE3, U 0x00, U 0x77, U 0x94, + U 0x20, U 0x00, U 0x6E, U 0x54, + U 0x20, U 0x00, U 0x6E, U 0x54, + U 0xE3, U 0x00, U 0x77, U 0xE0, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, @@ -408,8 +408,8 @@ static unsigned char t3fw[30772] = { U 0x1F, U 0xFC, U 0x00, U 0x00, U 0x1F, U 0xFF, U 0xC5, U 0x90, U 0x1F, U 0xFF, U 0xC6, U 0x70, - U 0x20, U 0x00, U 0x6E, U 0x08, - U 0x20, U 0x00, U 0x6E, U 0x08, + U 0x20, U 0x00, U 0x6E, U 0x58, + U 0x20, U 0x00, U 0x6E, U 0x58, U 0xDE, U 0xFF, U 0xFE, U 0x00, U 0x00, U 0x00, U 0x08, U 0x0C, U 0xDE, U 0xAD, U 0xBE, U 0xEF, @@ -616,47 +616,47 @@ static unsigned char t3fw[30772] = { U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x55, U 0x08, - U 0x20, U 0x00, U 0x53, U 0xD8, - U 0x20, U 0x00, U 0x55, U 0x08, - U 0x20, U 0x00, U 0x55, U 0x08, - U 0x20, U 0x00, U 0x53, U 0x14, - U 0x20, U 0x00, U 0x53, U 0x14, - U 0x20, U 0x00, U 0x53, U 0x14, - U 0x20, U 0x00, U 0x51, U 0x54, - U 0x20, U 0x00, U 0x51, U 0x54, - U 0x20, U 0x00, U 0x51, U 0x4C, - U 0x20, U 0x00, U 0x50, U 0xB8, - U 0x20, U 0x00, U 0x4F, U 0x60, - U 0x20, U 0x00, U 0x4D, U 0x40, - U 0x20, U 0x00, U 0x4B, U 0x14, - U 0x00, U 0x00, U 0x00, U 0x00, - U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x54, U 0xD8, - U 0x20, U 0x00, U 0x53, U 0xA4, - U 0x20, U 0x00, U 0x54, U 0x48, - U 0x20, U 0x00, U 0x54, U 0x48, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x51, U 0x44, - U 0x20, U 0x00, U 0x51, U 0xFC, - U 0x20, U 0x00, U 0x4E, U 0x80, - U 0x20, U 0x00, U 0x4C, U 0xF0, - U 0x20, U 0x00, U 0x4A, U 0xC0, + U 0x20, U 0x00, U 0x55, U 0x54, + U 0x20, U 0x00, U 0x54, U 0x24, + U 0x20, U 0x00, U 0x55, U 0x54, + U 0x20, U 0x00, U 0x55, U 0x54, + U 0x20, U 0x00, U 0x53, U 0x60, + U 0x20, U 0x00, U 0x53, U 0x60, + U 0x20, U 0x00, U 0x53, U 0x60, + U 0x20, U 0x00, U 0x51, U 0xA0, + U 0x20, U 0x00, U 0x51, U 0xA0, + U 0x20, U 0x00, U 0x51, U 0x98, + U 0x20, U 0x00, U 0x51, U 0x04, + U 0x20, U 0x00, U 0x4F, U 0xAC, + U 0x20, U 0x00, U 0x4D, U 0x8C, + U 0x20, U 0x00, U 0x4B, U 0x60, + U 0x00, U 0x00, U 0x00, U 0x00, + U 0x00, U 0x00, U 0x00, U 0x00, + U 0x20, U 0x00, U 0x55, U 0x24, + U 0x20, U 0x00, U 0x53, U 0xF0, + U 0x20, U 0x00, U 0x54, U 0x94, + U 0x20, U 0x00, U 0x54, U 0x94, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x51, U 0x90, + U 0x20, U 0x00, U 0x52, U 0x48, + U 0x20, U 0x00, U 0x4E, U 0xCC, + U 0x20, U 0x00, U 0x4D, U 0x3C, + U 0x20, U 0x00, U 0x4B, U 0x0C, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, U 0x20, U 0x00, U 0x0B, U 0xE8, U 0x20, U 0x00, U 0x3A, U 0xA8, U 0x20, U 0x00, U 0x04, U 0xC0, - U 0x20, U 0x00, U 0x46, U 0xB4, + U 0x20, U 0x00, U 0x46, U 0xFC, U 0x20, U 0x00, U 0x0B, U 0xE0, U 0x20, U 0x00, U 0x41, U 0xC0, U 0x20, U 0x00, U 0x03, U 0xF0, - U 0x20, U 0x00, U 0x46, U 0x74, - U 0x20, U 0x00, U 0x4A, U 0x9C, + U 0x20, U 0x00, U 0x46, U 0xBC, + U 0x20, U 0x00, U 0x4A, U 0xE8, U 0x20, U 0x00, U 0x3E, U 0xCC, U 0x20, U 0x00, U 0x3D, U 0xE8, U 0x20, U 0x00, U 0x3A, U 0x24, @@ -666,7 +666,7 @@ static unsigned char t3fw[30772] = { U 0x20, U 0x00, U 0x3C, U 0x44, U 0x20, U 0x00, U 0x2D, U 0xB0, U 0x20, U 0x00, U 0x28, U 0x44, - U 0x20, U 0x00, U 0x67, U 0x8C, + U 0x20, U 0x00, U 0x67, U 0xD8, U 0x20, U 0x00, U 0x23, U 0xD0, U 0x20, U 0x00, U 0x20, U 0xB0, U 0x20, U 0x00, U 0x20, U 0x5C, @@ -851,22 +851,22 @@ static unsigned char t3fw[30772] = { U 0x0B, U 0xBB, U 0x90, U 0x00, U 0x53, U 0x00, U 0x00, U 0x00, U 0x63, U 0xFF, U 0xFC, U 0x00, - U 0x20, U 0x00, U 0x6B, U 0xC4, + U 0x20, U 0x00, U 0x6C, U 0x10, U 0x10, U 0xFF, U 0xFF, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6B, U 0xE8, + U 0x20, U 0x00, U 0x6C, U 0x34, U 0x00, U 0xD2, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6C, U 0x30, + U 0x20, U 0x00, U 0x6C, U 0x7C, U 0x00, U 0xD3, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6C, U 0x70, + U 0x20, U 0x00, U 0x6C, U 0xBC, U 0x00, U 0xD4, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, - U 0x20, U 0x00, U 0x6C, U 0xE4, + U 0x20, U 0x00, U 0x6D, U 0x30, U 0x00, U 0xD5, U 0x31, U 0x10, U 0xFF, U 0xFE, U 0x0A, U 0x00, U 0x00, U 0x00, U 0x00, U 0x00, @@ -893,8 +893,8 @@ static unsigned char t3fw[30772] = { U 0xFA, U 0xD3, U 0x0F, U 0x77, U 0x6B, U 0x06, U 0x90, U 0x60, U 0xB4, U 0x66, U 0x77, U 0x63, - U 0xF8, U 0x54, U 0x15, U 0xD3, - U 0x54, U 0x1A, U 0x7E, U 0x0F, + U 0xF8, U 0x54, U 0x15, U 0xE6, + U 0x54, U 0x1A, U 0x91, U 0x0F, U 0x14, U 0x00, U 0x63, U 0xFF, U 0xF9, U 0x00, U 0x00, U 0x00, U 0x6C, U 0x10, U 0x04, U 0xC0, @@ -1107,7 +1107,7 @@ static unsigned char t3fw[30772] = { U 0xFC, U 0x13, U 0x2C, U 0x16, U 0x18, U 0x2B, U 0x12, U 0x1A, U 0x2A, U 0x12, U 0x1B, U 0xDC, - U 0x50, U 0x58, U 0x19, U 0x91, + U 0x50, U 0x58, U 0x19, U 0xA4, U 0xC0, U 0xD0, U 0xC0, U 0x90, U 0x2E, U 0x5C, U 0xF4, U 0x2C, U 0x12, U 0x17, U 0x28, U 0x12, @@ -1345,7 +1345,7 @@ static unsigned char t3fw[30772] = { U 0xFC, U 0x2A, U 0x00, U 0x00, U 0x64, U 0x50, U 0xC0, U 0xDA, U 0x20, U 0xDB, U 0xC0, U 0x58, - U 0x16, U 0x65, U 0xC0, U 0x20, + U 0x16, U 0x78, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xC0, U 0x91, U 0x63, U 0xFD, U 0x7A, U 0x00, U 0xC0, U 0x91, U 0x63, U 0xFA, @@ -1354,7 +1354,7 @@ static unsigned char t3fw[30772] = { U 0x0A, U 0x80, U 0xC0, U 0x9A, U 0x29, U 0x24, U 0x68, U 0x2C, U 0x70, U 0x07, U 0x58, U 0x15, - U 0x55, U 0xD2, U 0xA0, U 0xD1, + U 0x68, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x03, U 0x47, U 0x0B, U 0x18, U 0xED, U 0x4F, U 0xDB, U 0x70, U 0xA8, U 0x28, U 0x78, @@ -1362,7 +1362,7 @@ static unsigned char t3fw[30772] = { U 0xF8, U 0xD9, U 0xB0, U 0x63, U 0xFA, U 0x61, U 0x00, U 0x00, U 0x2A, U 0x2C, U 0x74, U 0xDB, - U 0x40, U 0x58, U 0x0E, U 0xD1, + U 0x40, U 0x58, U 0x0E, U 0xE3, U 0x63, U 0xFA, U 0xE4, U 0x00, U 0x00, U 0x29, U 0x22, U 0x1D, U 0x2D, U 0x25, U 0x02, U 0x7B, @@ -1386,7 +1386,7 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0xD1, U 0x2E, U 0x0A, U 0x80, U 0xC0, U 0x9E, U 0x29, U 0x24, U 0x68, U 0x2C, U 0x70, - U 0x07, U 0x58, U 0x15, U 0x34, + U 0x07, U 0x58, U 0x15, U 0x47, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xC0, U 0x94, U 0x63, U 0xFB, U 0xC9, U 0xC0, U 0x96, U 0x63, @@ -1472,7 +1472,7 @@ static unsigned char t3fw[30772] = { U 0x28, U 0x2D, U 0xF6, U 0x85, U 0xC8, U 0x5A, U 0x2A, U 0x2C, U 0x74, U 0xDB, U 0x40, U 0x58, - U 0x0E, U 0x64, U 0xD2, U 0xA0, + U 0x0E, U 0x76, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x00, U 0x29, U 0xCC, U 0xF9, @@ -1497,26 +1497,26 @@ static unsigned char t3fw[30772] = { U 0x75, U 0x63, U 0xFF, U 0x7D, U 0x00, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, - U 0x40, U 0x58, U 0x15, U 0x3A, + U 0x40, U 0x58, U 0x15, U 0x4D, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x15, U 0xC9, + U 0xB6, U 0x58, U 0x15, U 0xDC, U 0x63, U 0xFF, U 0xE5, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x15, - U 0xC7, U 0x63, U 0xFF, U 0xDC, + U 0xDA, U 0x63, U 0xFF, U 0xDC, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, - U 0x50, U 0x58, U 0x16, U 0x55, + U 0x50, U 0x58, U 0x16, U 0x68, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC8, U 0x58, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x58, U 0x14, - U 0xA7, U 0x2A, U 0x21, U 0x02, + U 0xBA, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAF, U 0xBD, U 0xC0, U 0x94, U 0x09, U 0xA9, U 0x02, U 0x29, U 0x25, U 0x02, U 0x63, U 0xFF, U 0xB2, U 0x00, U 0x00, U 0x2B, U 0x21, U 0x04, U 0x58, - U 0x14, U 0x53, U 0x1D, U 0xEC, + U 0x14, U 0x66, U 0x1D, U 0xEC, U 0xAF, U 0xC0, U 0xE0, U 0x2E, U 0x24, U 0x66, U 0x8F, U 0x30, U 0x2B, U 0x20, U 0x0C, U 0x0F, @@ -1527,7 +1527,7 @@ static unsigned char t3fw[30772] = { U 0xFC, U 0x50, U 0x64, U 0xCF, U 0x56, U 0x2B, U 0x21, U 0x04, U 0xC0, U 0xC0, U 0x58, U 0x14, - U 0x48, U 0x1D, U 0xEC, U 0xA4, + U 0x5B, U 0x1D, U 0xEC, U 0xA4, U 0xC0, U 0xE0, U 0x8F, U 0x30, U 0x2B, U 0x20, U 0x0C, U 0x0F, U 0x8F, U 0x14, U 0x63, U 0xFF, @@ -1535,7 +1535,7 @@ static unsigned char t3fw[30772] = { U 0x2B, U 0x21, U 0x04, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0x58, - U 0x14, U 0x40, U 0x1D, U 0xEC, + U 0x14, U 0x53, U 0x1D, U 0xEC, U 0x9C, U 0xC0, U 0xE0, U 0x2E, U 0x24, U 0x66, U 0x8F, U 0x30, U 0x2B, U 0x20, U 0x0C, U 0x0F, @@ -1574,7 +1574,7 @@ static unsigned char t3fw[30772] = { U 0xAC, U 0xFD, U 0x65, U 0xA0, U 0xC2, U 0xCC, U 0x5F, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0x8C, - U 0x11, U 0x58, U 0x14, U 0xED, + U 0x11, U 0x58, U 0x15, U 0x00, U 0xC0, U 0x51, U 0x9A, U 0x13, U 0xC7, U 0xBF, U 0x9B, U 0xA9, U 0x8E, U 0x13, U 0x2E, U 0xE2, @@ -1613,19 +1613,19 @@ static unsigned char t3fw[30772] = { U 0x20, U 0x7F, U 0x89, U 0x05, U 0x29, U 0xD2, U 0x85, U 0x65, U 0x91, U 0x65, U 0xDA, U 0x20, - U 0x58, U 0x15, U 0x58, U 0xC9, + U 0x58, U 0x15, U 0x6B, U 0xC9, U 0x5C, U 0x60, U 0x01, U 0xFF, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x15, U 0x55, + U 0xB6, U 0x58, U 0x15, U 0x68, U 0x60, U 0x00, U 0x0C, U 0x00, U 0xC0, U 0x90, U 0x63, U 0xFF, U 0xB5, U 0x00, U 0x00, U 0xDA, - U 0x20, U 0x58, U 0x15, U 0x51, + U 0x20, U 0x58, U 0x15, U 0x64, U 0x65, U 0x51, U 0xE4, U 0x8D, U 0x13, U 0x8C, U 0x11, U 0xDB, U 0xD0, U 0x8D, U 0xD0, U 0x02, U 0x2A, U 0x02, U 0x0D, U 0x6D, - U 0x51, U 0x58, U 0x13, U 0xC3, + U 0x51, U 0x58, U 0x13, U 0xD6, U 0x9A, U 0x13, U 0x64, U 0xA1, U 0xCE, U 0xC7, U 0x5F, U 0x8F, U 0xA1, U 0x95, U 0xA9, U 0xC0, @@ -1643,7 +1643,7 @@ static unsigned char t3fw[30772] = { U 0x09, U 0x9D, U 0x02, U 0x64, U 0x81, U 0x59, U 0xC9, U 0xD3, U 0x8A, U 0x10, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x13, U 0xD3, + U 0x04, U 0x58, U 0x13, U 0xE6, U 0x8A, U 0x13, U 0xC0, U 0xB0, U 0x2B, U 0x24, U 0x66, U 0x2E, U 0xA2, U 0x09, U 0x2A, U 0xA0, @@ -1700,7 +1700,7 @@ static unsigned char t3fw[30772] = { U 0xE4, U 0xCF, U 0x2B, U 0xBC, U 0x20, U 0x2B, U 0xC6, U 0x85, U 0x2A, U 0x2C, U 0x74, U 0x8B, - U 0x11, U 0x58, U 0x0D, U 0x7F, + U 0x11, U 0x58, U 0x0D, U 0x91, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x28, U 0x20, U 0x3D, U 0xC0, U 0xE0, U 0x7C, U 0x87, U 0x7F, @@ -1734,14 +1734,14 @@ static unsigned char t3fw[30772] = { U 0xF0, U 0x63, U 0xFE, U 0x95, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x11, U 0xDD, - U 0x50, U 0x58, U 0x15, U 0x71, + U 0x50, U 0x58, U 0x15, U 0x84, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0xE1, U 0x63, U 0xFF, U 0x7A, U 0x8B, U 0x13, U 0x8C, U 0x11, U 0xDD, U 0x50, U 0xC0, U 0xAA, U 0x2E, U 0x0A, U 0x80, U 0x2A, U 0x24, U 0x68, U 0xDA, - U 0x20, U 0x58, U 0x13, U 0xD1, + U 0x20, U 0x58, U 0x13, U 0xE4, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x6C, U 0x10, U 0x06, U 0x29, @@ -1851,19 +1851,19 @@ static unsigned char t3fw[30772] = { U 0x72, U 0x63, U 0xFF, U 0x66, U 0x00, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, - U 0x40, U 0x58, U 0x13, U 0xD8, + U 0x40, U 0x58, U 0x13, U 0xEB, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x14, - U 0x68, U 0x63, U 0xFF, U 0xE8, + U 0x7B, U 0x63, U 0xFF, U 0xE8, U 0xC0, U 0xA0, U 0x63, U 0xFE, U 0x82, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x14, U 0x64, + U 0xB6, U 0x58, U 0x14, U 0x77, U 0x63, U 0xFF, U 0xD9, U 0x00, U 0xDB, U 0x40, U 0x2A, U 0x2C, - U 0x74, U 0x58, U 0x0C, U 0xDF, + U 0x74, U 0x58, U 0x0C, U 0xF1, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x8A, U 0x10, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x12, U 0xF7, + U 0x04, U 0x58, U 0x13, U 0x0A, U 0x1E, U 0xEB, U 0x46, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x63, U 0xFE, U 0xB1, U 0x00, @@ -1893,14 +1893,14 @@ static unsigned char t3fw[30772] = { U 0x22, U 0xD2, U 0x85, U 0xCF, U 0x25, U 0x60, U 0x00, U 0x0D, U 0x00, U 0xDA, U 0x60, U 0xC0, - U 0xB6, U 0x58, U 0x14, U 0x40, + U 0xB6, U 0x58, U 0x14, U 0x53, U 0xC8, U 0x5A, U 0x60, U 0x01, U 0x0F, U 0x00, U 0xDA, U 0x60, - U 0x58, U 0x14, U 0x3D, U 0x65, + U 0x58, U 0x14, U 0x50, U 0x65, U 0x51, U 0x06, U 0xDC, U 0x40, U 0xDB, U 0x30, U 0x8D, U 0x30, U 0xDA, U 0x60, U 0x0D, U 0x6D, - U 0x51, U 0x58, U 0x12, U 0xB0, + U 0x51, U 0x58, U 0x12, U 0xC3, U 0xD3, U 0xA0, U 0x64, U 0xA0, U 0xF3, U 0x84, U 0xA1, U 0xC0, U 0x51, U 0x04, U 0x04, U 0x47, @@ -1911,7 +1911,7 @@ static unsigned char t3fw[30772] = { U 0x2C, U 0x64, U 0x66, U 0x6F, U 0xC6, U 0x02, U 0x70, U 0x96, U 0x0A, U 0x2B, U 0x61, U 0x04, - U 0x58, U 0x12, U 0xC7, U 0xC0, + U 0x58, U 0x12, U 0xDA, U 0xC0, U 0xB0, U 0x2B, U 0x64, U 0x66, U 0x65, U 0x50, U 0xB4, U 0x2A, U 0x3C, U 0x10, U 0xC0, U 0xE7, @@ -1961,7 +1961,7 @@ static unsigned char t3fw[30772] = { U 0xFF, U 0x60, U 0x00, U 0x00, U 0x2A, U 0x6C, U 0x74, U 0xC0, U 0xB2, U 0xDC, U 0x20, U 0xDD, - U 0x40, U 0x58, U 0x12, U 0xA5, + U 0x40, U 0x58, U 0x12, U 0xB8, U 0xC0, U 0xB0, U 0x63, U 0xFF, U 0x63, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x00, @@ -2013,7 +2013,7 @@ static unsigned char t3fw[30772] = { U 0xA6, U 0x9D, U 0x2F, U 0x35, U 0x02, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x30, U 0xC0, - U 0xB6, U 0x58, U 0x13, U 0xC8, + U 0xB6, U 0x58, U 0x13, U 0xDB, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x6C, U 0x10, U 0x06, U 0x2A, U 0x20, U 0x06, U 0x94, U 0x10, @@ -2024,7 +2024,7 @@ static unsigned char t3fw[30772] = { U 0x92, U 0x0A, U 0xCC, U 0x5F, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0x8C, U 0x10, U 0x58, U 0x13, - U 0x2C, U 0xC0, U 0x51, U 0xD3, + U 0x3F, U 0xC0, U 0x51, U 0xD3, U 0xA0, U 0xC7, U 0xAF, U 0x9A, U 0x3A, U 0xC0, U 0xD0, U 0x1C, U 0xEA, U 0xA5, U 0x14, U 0xEA, @@ -2154,37 +2154,37 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, - U 0x10, U 0x58, U 0x12, U 0xA9, + U 0x10, U 0x58, U 0x12, U 0xBC, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xC0, U 0x91, U 0x63, U 0xFF, U 0x8F, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x13, U 0x37, + U 0xB6, U 0x58, U 0x13, U 0x4A, U 0x63, U 0xFF, U 0xE1, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x13, - U 0x35, U 0x63, U 0xFF, U 0xD8, + U 0x48, U 0x63, U 0xFF, U 0xD8, U 0x2B, U 0x21, U 0x04, U 0x58, - U 0x11, U 0xCC, U 0x1E, U 0xEA, + U 0x11, U 0xDF, U 0x1E, U 0xEA, U 0x1D, U 0x2B, U 0x20, U 0x0C, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x8F, U 0x3A, U 0x63, U 0xFE, U 0x4D, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, U 0x50, U 0x58, U 0x13, - U 0xBE, U 0xD2, U 0xA0, U 0xD1, + U 0xD1, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x2A, U 0x2C, U 0x74, U 0x8B, U 0x10, U 0x58, U 0x0B, - U 0xA7, U 0xD2, U 0xA0, U 0xD1, + U 0xB9, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x29, U 0x21, U 0x38, U 0xC0, U 0x88, U 0x79, U 0x83, U 0x2E, U 0x8C, U 0x31, U 0x0C, U 0xFC, U 0x50, U 0x64, U 0xCE, U 0x22, U 0x2B, U 0x21, U 0x04, U 0xC0, U 0xC0, U 0x58, U 0x11, - U 0xBB, U 0xC0, U 0xD0, U 0x1E, + U 0xCE, U 0xC0, U 0xD0, U 0x1E, U 0xEA, U 0x0C, U 0x8F, U 0x3A, U 0x2B, U 0x20, U 0x0C, U 0x63, U 0xFE, U 0x0D, U 0xDA, U 0x20, - U 0x58, U 0x13, U 0x1D, U 0x63, + U 0x58, U 0x13, U 0x30, U 0x63, U 0xFF, U 0x7A, U 0xDA, U 0x20, U 0x5B, U 0xFF, U 0x22, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x00, @@ -2192,7 +2192,7 @@ static unsigned char t3fw[30772] = { U 0x21, U 0x04, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0x58, U 0x11, - U 0xAF, U 0x1E, U 0xEA, U 0x00, + U 0xC2, U 0x1E, U 0xEA, U 0x00, U 0x2B, U 0x20, U 0x0C, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x8F, U 0x3A, U 0x63, U 0xFD, @@ -2376,7 +2376,7 @@ static unsigned char t3fw[30772] = { U 0xCF, U 0x0B, U 0x4B, U 0x0B, U 0x2B, U 0xC6, U 0x85, U 0xC0, U 0xB0, U 0x8C, U 0x15, U 0x58, - U 0x11, U 0x9C, U 0xD2, U 0xA0, + U 0x11, U 0xAF, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x8A, U 0x35, U 0x6F, U 0xA5, U 0x46, U 0xD8, U 0x30, U 0x8B, U 0xD5, U 0x6D, @@ -2388,7 +2388,7 @@ static unsigned char t3fw[30772] = { U 0x08, U 0x0B, U 0x47, U 0x65, U 0xB1, U 0x0B, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x2C, U 0x12, - U 0x05, U 0x58, U 0x11, U 0xBF, + U 0x05, U 0x58, U 0x11, U 0xD2, U 0xD3, U 0xA0, U 0xC0, U 0xC1, U 0xC0, U 0xD0, U 0x2D, U 0xA4, U 0x03, U 0x9C, U 0x14, U 0x63, @@ -2401,25 +2401,25 @@ static unsigned char t3fw[30772] = { U 0x88, U 0x14, U 0xCC, U 0x87, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x58, U 0x11, - U 0xB3, U 0xC0, U 0x20, U 0xD1, + U 0xC6, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x12, U 0x42, + U 0xB6, U 0x58, U 0x12, U 0x55, U 0x63, U 0xFF, U 0xE4, U 0x00, U 0x00, U 0xDA, U 0x20, U 0x8B, - U 0x10, U 0x58, U 0x12, U 0x3F, + U 0x10, U 0x58, U 0x12, U 0x52, U 0x63, U 0xFF, U 0xD8, U 0x00, U 0x9E, U 0x17, U 0x8A, U 0x12, U 0x2B, U 0x21, U 0x04, U 0x58, - U 0x10, U 0xD5, U 0x8E, U 0x17, + U 0x10, U 0xE8, U 0x8E, U 0x17, U 0xC0, U 0x90, U 0x29, U 0x24, U 0x66, U 0x63, U 0xFE, U 0x34, U 0xC0, U 0x80, U 0x63, U 0xFE, U 0x06, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0xDD, - U 0x50, U 0x58, U 0x12, U 0xC7, + U 0x50, U 0x58, U 0x12, U 0xDA, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x12, - U 0x33, U 0x63, U 0xFF, U 0xA7, + U 0x46, U 0x63, U 0xFF, U 0xA7, U 0x00, U 0x2B, U 0x21, U 0x38, U 0xC0, U 0xA8, U 0x7B, U 0xAB, U 0x02, U 0x60, U 0x01, U 0x04, @@ -2427,7 +2427,7 @@ static unsigned char t3fw[30772] = { U 0x50, U 0x64, U 0xCE, U 0x04, U 0x8A, U 0x12, U 0x2B, U 0x21, U 0x04, U 0xC0, U 0xC0, U 0x98, - U 0x17, U 0x58, U 0x10, U 0xC3, + U 0x17, U 0x58, U 0x10, U 0xD6, U 0x8E, U 0x17, U 0x63, U 0xFD, U 0xF3, U 0x2D, U 0x21, U 0x38, U 0x2D, U 0xDC, U 0xFF, U 0x0D, @@ -2458,7 +2458,7 @@ static unsigned char t3fw[30772] = { U 0x8D, U 0x14, U 0x2E, U 0x0A, U 0x80, U 0xC0, U 0x8E, U 0x28, U 0x24, U 0x68, U 0x58, U 0x11, - U 0x05, U 0xD2, U 0xA0, U 0xD1, + U 0x18, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x2E, U 0x7C, U 0x48, U 0x19, U 0xE8, U 0xF5, U 0x2A, U 0x32, U 0x16, U 0x2B, U 0x76, @@ -2483,7 +2483,7 @@ static unsigned char t3fw[30772] = { U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0xC9, U 0xC0, U 0x9E, U 0x17, U 0x8A, U 0x12, U 0x58, - U 0x10, U 0x8C, U 0x8E, U 0x17, + U 0x10, U 0x9F, U 0x8E, U 0x17, U 0xC0, U 0x34, U 0x8F, U 0x20, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0xC0, U 0x68, U 0x26, @@ -2493,7 +2493,7 @@ static unsigned char t3fw[30772] = { U 0x66, U 0x98, U 0x17, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, U 0x24, U 0x66, U 0x58, - U 0x10, U 0x82, U 0x8E, U 0x17, + U 0x10, U 0x95, U 0x8E, U 0x17, U 0x87, U 0x16, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x63, U 0xFC, U 0xE6, U 0x8D, U 0x35, @@ -2578,13 +2578,13 @@ static unsigned char t3fw[30772] = { U 0xCD, U 0x2D, U 0x25, U 0x23, U 0xC8, U 0x55, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x58, U 0x10, - U 0x7B, U 0x29, U 0x21, U 0x02, + U 0x8E, U 0x29, U 0x21, U 0x02, U 0xCC, U 0x96, U 0xC0, U 0xE8, U 0x0E, U 0x9E, U 0x02, U 0x2E, U 0x25, U 0x02, U 0xCC, U 0x57, U 0xDA, U 0x20, U 0xDB, U 0x30, - U 0xDC, U 0x40, U 0x58, U 0x10, - U 0xFC, U 0xC0, U 0x20, U 0xD1, + U 0xDC, U 0x40, U 0x58, U 0x11, + U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x2C, U 0x20, U 0x66, U 0x89, U 0x31, U 0xB1, U 0xCC, U 0x0C, U 0x0C, U 0x47, U 0x2C, @@ -2694,28 +2694,28 @@ static unsigned char t3fw[30772] = { U 0x20, U 0xD1, U 0x0F, U 0x00, U 0xC0, U 0x9A, U 0x63, U 0xFF, U 0xC6, U 0xDA, U 0x20, U 0x58, - U 0x11, U 0x20, U 0x63, U 0xFE, + U 0x11, U 0x33, U 0x63, U 0xFE, U 0x38, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x11, U 0x1D, + U 0xB6, U 0x58, U 0x11, U 0x30, U 0x63, U 0xFE, U 0x2E, U 0x00, U 0x68, U 0x97, U 0x3C, U 0x2B, U 0x9C, U 0xFD, U 0x64, U 0xBE, U 0x24, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0xDB, - U 0x70, U 0x58, U 0x10, U 0xD9, + U 0x70, U 0x58, U 0x10, U 0xEC, U 0xC0, U 0xC0, U 0xC0, U 0xD1, U 0x0A, U 0xDA, U 0x39, U 0x0A, U 0xDC, U 0x38, U 0x65, U 0xCD, U 0xE0, U 0x63, U 0xFE, U 0x09, U 0x8A, U 0x10, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x0F, U 0xAA, + U 0x04, U 0x58, U 0x0F, U 0xBD, U 0xC0, U 0xB0, U 0x2B, U 0x24, U 0x66, U 0x63, U 0xFE, U 0x21, U 0xDB, U 0x40, U 0x2A, U 0x2C, - U 0x74, U 0x58, U 0x09, U 0x8B, + U 0x74, U 0x58, U 0x09, U 0x9D, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x0F, - U 0xAF, U 0x63, U 0xFC, U 0xF7, + U 0xC2, U 0x63, U 0xFC, U 0xF7, U 0x6C, U 0x10, U 0x04, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x6C, U 0x10, U 0x04, U 0x29, @@ -2744,7 +2744,7 @@ static unsigned char t3fw[30772] = { U 0x9B, U 0x68, U 0x98, U 0x0B, U 0x2A, U 0x9C, U 0xF9, U 0x65, U 0xA1, U 0xB2, U 0x02, U 0x2A, - U 0x02, U 0x58, U 0x0F, U 0x91, + U 0x02, U 0x58, U 0x0F, U 0xA4, U 0x89, U 0x37, U 0x1B, U 0xE7, U 0xD7, U 0xC8, U 0x91, U 0x64, U 0x52, U 0x0E, U 0x2A, U 0x21, @@ -2787,7 +2787,7 @@ static unsigned char t3fw[30772] = { U 0x55, U 0x60, U 0x00, U 0x1E, U 0x2A, U 0x20, U 0x0C, U 0xC1, U 0xB2, U 0x8C, U 0x20, U 0x58, - U 0x11, U 0x03, U 0x9A, U 0x18, + U 0x11, U 0x16, U 0x9A, U 0x18, U 0x64, U 0xA2, U 0x45, U 0x8D, U 0x67, U 0x63, U 0xFF, U 0xCF, U 0xC0, U 0xC0, U 0x63, U 0xFF, @@ -2802,7 +2802,7 @@ static unsigned char t3fw[30772] = { U 0x01, U 0x99, U 0xD7, U 0xA0, U 0xDA, U 0x20, U 0xDB, U 0x70, U 0xC1, U 0xC8, U 0x2D, U 0x21, - U 0x20, U 0x58, U 0x10, U 0x9D, + U 0x20, U 0x58, U 0x10, U 0xB0, U 0x8C, U 0x26, U 0x8B, U 0x27, U 0x9A, U 0x16, U 0x0C, U 0xBB, U 0x0C, U 0x7A, U 0xB3, U 0x34, @@ -2820,7 +2820,7 @@ static unsigned char t3fw[30772] = { U 0x02, U 0x60, U 0x00, U 0x97, U 0xCF, U 0x58, U 0x60, U 0x00, U 0x1F, U 0xDA, U 0x20, U 0x8B, - U 0x16, U 0x58, U 0x10, U 0x63, + U 0x16, U 0x58, U 0x10, U 0x76, U 0x65, U 0xA1, U 0x38, U 0x63, U 0xFF, U 0xBD, U 0xC0, U 0x81, U 0xC0, U 0x90, U 0x8F, U 0x18, @@ -2829,7 +2829,7 @@ static unsigned char t3fw[30772] = { U 0x97, U 0xF5, U 0x63, U 0xFF, U 0xD2, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0xDC, U 0x40, U 0x58, - U 0x10, U 0x07, U 0xC0, U 0x51, + U 0x10, U 0x1A, U 0xC0, U 0x51, U 0xD6, U 0xA0, U 0xC0, U 0xC0, U 0x2B, U 0xA0, U 0x10, U 0x2C, U 0xA4, U 0x03, U 0x9B, U 0x17, @@ -2854,7 +2854,7 @@ static unsigned char t3fw[30772] = { U 0x26, U 0x18, U 0x63, U 0xFE, U 0x96, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, - U 0x50, U 0x58, U 0x11, U 0x11, + U 0x50, U 0x58, U 0x11, U 0x24, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x30, U 0x2C, U 0x20, U 0x66, U 0x89, U 0x61, U 0xB1, @@ -2877,7 +2877,7 @@ static unsigned char t3fw[30772] = { U 0x16, U 0xDC, U 0x40, U 0x2F, U 0x22, U 0x13, U 0xDD, U 0x50, U 0xB1, U 0xFF, U 0x2F, U 0x26, - U 0x13, U 0x58, U 0x0F, U 0xA6, + U 0x13, U 0x58, U 0x0F, U 0xB9, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x00, U 0x28, U 0x20, U 0x3D, U 0x08, U 0x48, U 0x40, U 0x65, @@ -2902,28 +2902,28 @@ static unsigned char t3fw[30772] = { U 0xD1, U 0x00, U 0x00, U 0x00, U 0x65, U 0x50, U 0x81, U 0xDA, U 0x20, U 0xDB, U 0x60, U 0xDC, - U 0x40, U 0x58, U 0x0F, U 0xBD, + U 0x40, U 0x58, U 0x0F, U 0xD0, U 0xC0, U 0x20, U 0xC0, U 0xF0, U 0x2F, U 0xA4, U 0x03, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x10, U 0x4B, + U 0xB6, U 0x58, U 0x10, U 0x5E, U 0x63, U 0xFF, U 0xE0, U 0x00, U 0x00, U 0x6F, U 0x95, U 0x02, U 0x63, U 0xFD, U 0x6C, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, U 0x50, U 0xC4, - U 0xE0, U 0x58, U 0x0F, U 0x3E, + U 0xE0, U 0x58, U 0x0F, U 0x51, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0x8A, U 0x15, U 0x2B, U 0x21, - U 0x04, U 0x58, U 0x0E, U 0xDB, + U 0x04, U 0x58, U 0x0E, U 0xEE, U 0x23, U 0x24, U 0x66, U 0x28, U 0x60, U 0x10, U 0x98, U 0x17, U 0x63, U 0xFF, U 0x21, U 0x00, U 0xDA, U 0x20, U 0x58, U 0x10, - U 0x3E, U 0x63, U 0xFF, U 0xAB, + U 0x51, U 0x63, U 0xFF, U 0xAB, U 0xC8, U 0x58, U 0xDB, U 0x30, U 0xDA, U 0x20, U 0x58, U 0x0F, - U 0x22, U 0x2A, U 0x21, U 0x02, + U 0x35, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAF, U 0x9C, U 0xC0, U 0x94, U 0x09, U 0xA9, U 0x02, U 0x29, U 0x25, U 0x02, U 0x63, @@ -2932,11 +2932,11 @@ static unsigned char t3fw[30772] = { U 0xC0, U 0xA3, U 0x2E, U 0x0A, U 0x80, U 0x2A, U 0x24, U 0x68, U 0xDA, U 0x20, U 0x58, U 0x0F, - U 0x2B, U 0xD2, U 0xA0, U 0xD1, + U 0x3E, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x2B, U 0x20, U 0x0C, U 0x58, U 0x10, - U 0x53, U 0x63, U 0xFF, U 0x6B, + U 0x66, U 0x63, U 0xFF, U 0x6B, U 0x6C, U 0x10, U 0x04, U 0x28, U 0x20, U 0x06, U 0xC0, U 0x62, U 0x28, U 0x8C, U 0xF8, U 0x65, @@ -3007,7 +3007,7 @@ static unsigned char t3fw[30772] = { U 0xAF, U 0xE7, U 0x63, U 0xFF, U 0xA6, U 0x2A, U 0x2C, U 0x74, U 0xC0, U 0xB0, U 0x2C, U 0x0A, - U 0x02, U 0x58, U 0x0E, U 0x15, + U 0x02, U 0x58, U 0x0E, U 0x28, U 0x1C, U 0xE6, U 0xFB, U 0x9C, U 0xA0, U 0x8B, U 0x20, U 0x08, U 0xBB, U 0x11, U 0x06, U 0xBB, @@ -3017,10 +3017,10 @@ static unsigned char t3fw[30772] = { U 0x26, U 0x24, U 0x68, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0xDC, U 0x40, U 0xDD, U 0x50, U 0x58, - U 0x10, U 0x6F, U 0xD2, U 0xA0, + U 0x10, U 0x82, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x2B, U 0x20, U 0x0C, U 0x58, - U 0x0F, U 0xDA, U 0xC0, U 0x20, + U 0x0F, U 0xED, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0x00, U 0x00, U 0x6C, U 0x10, U 0x06, U 0x07, U 0x3D, U 0x14, U 0xC0, U 0x80, @@ -3239,7 +3239,7 @@ static unsigned char t3fw[30772] = { U 0x21, U 0x23, U 0x65, U 0xD4, U 0xA0, U 0xC0, U 0xA6, U 0x2B, U 0x0A, U 0x03, U 0x2C, U 0x22, - U 0x00, U 0x58, U 0x0F, U 0x17, + U 0x00, U 0x58, U 0x0F, U 0x2A, U 0x64, U 0xA3, U 0xB9, U 0x17, U 0xE5, U 0xE6, U 0x8E, U 0x38, U 0x9A, U 0x16, U 0x64, U 0xE3, @@ -3248,11 +3248,11 @@ static unsigned char t3fw[30772] = { U 0xF3, U 0x7E, U 0x83, U 0x11, U 0xC2, U 0xB0, U 0x8C, U 0x20, U 0x2A, U 0x20, U 0x0C, U 0x58, - U 0x0F, U 0x36, U 0xD7, U 0xA0, + U 0x0F, U 0x49, U 0xD7, U 0xA0, U 0xCD, U 0xA1, U 0x60, U 0x04, U 0xA2, U 0x00, U 0xC2, U 0xB0, U 0x8C, U 0x20, U 0x2A, U 0x20, - U 0x0C, U 0x58, U 0x0F, U 0x0A, + U 0x0C, U 0x58, U 0x0F, U 0x1D, U 0xD7, U 0xA0, U 0x64, U 0xA4, U 0x86, U 0x2F, U 0x21, U 0x2E, U 0x8B, U 0x68, U 0x0F, U 0xBF, @@ -3264,7 +3264,7 @@ static unsigned char t3fw[30772] = { U 0x4C, U 0xDA, U 0x20, U 0xDB, U 0x50, U 0xC1, U 0xC4, U 0x2D, U 0x21, U 0x1F, U 0x58, U 0x0E, - U 0xD0, U 0x8B, U 0x26, U 0x9A, + U 0xE3, U 0x8B, U 0x26, U 0x9A, U 0x18, U 0x9A, U 0x19, U 0x89, U 0x27, U 0x2A, U 0xAC, U 0x38, U 0x0B, U 0x99, U 0x0C, U 0x7A, @@ -3291,11 +3291,11 @@ static unsigned char t3fw[30772] = { U 0x93, U 0xC0, U 0xE0, U 0x63, U 0xFF, U 0xE2, U 0xDA, U 0x20, U 0x8B, U 0x18, U 0x58, U 0x0E, - U 0x8D, U 0x65, U 0xA2, U 0xB1, + U 0xA0, U 0x65, U 0xA2, U 0xB1, U 0x63, U 0xFF, U 0x9E, U 0x00, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x58, - U 0x0E, U 0x35, U 0xD6, U 0xA0, + U 0x0E, U 0x48, U 0xD6, U 0xA0, U 0xC0, U 0xC0, U 0xC0, U 0xD1, U 0x2D, U 0x16, U 0x04, U 0x2C, U 0xA4, U 0x03, U 0xDC, U 0x70, @@ -3346,12 +3346,12 @@ static unsigned char t3fw[30772] = { U 0x64, U 0x41, U 0x81, U 0xC0, U 0x44, U 0x2B, U 0x0A, U 0x00, U 0x8C, U 0x20, U 0x2A, U 0x20, - U 0x0C, U 0x58, U 0x0E, U 0xAC, + U 0x0C, U 0x58, U 0x0E, U 0xBF, U 0x0A, U 0xA7, U 0x02, U 0x65, U 0xA0, U 0x0F, U 0xC0, U 0xB0, U 0x2C, U 0x22, U 0x00, U 0x2A, U 0x20, U 0x0C, U 0x58, U 0x0E, - U 0xA8, U 0xD7, U 0xA0, U 0x64, + U 0xBB, U 0xD7, U 0xA0, U 0x64, U 0xAF, U 0xEF, U 0xDA, U 0x20, U 0xC1, U 0xBC, U 0xC1, U 0xC8, U 0x2D, U 0x21, U 0x20, U 0x8F, @@ -3360,7 +3360,7 @@ static unsigned char t3fw[30772] = { U 0x26, U 0x0E, U 0x99, U 0x0C, U 0x09, U 0x09, U 0x48, U 0x29, U 0x25, U 0x25, U 0x58, U 0x0E, - U 0x70, U 0xC0, U 0x90, U 0xC0, + U 0x83, U 0xC0, U 0x90, U 0xC0, U 0x50, U 0xC0, U 0xC2, U 0x88, U 0x60, U 0x9A, U 0x19, U 0x1E, U 0xE5, U 0x6E, U 0xC0, U 0xA1, @@ -3442,7 +3442,7 @@ static unsigned char t3fw[30772] = { U 0xFD, U 0x0B, U 0x2D, U 0xE6, U 0x85, U 0xDA, U 0x20, U 0x8B, U 0x19, U 0x8C, U 0x15, U 0x8D, - U 0x14, U 0x58, U 0x0D, U 0x71, + U 0x14, U 0x58, U 0x0D, U 0x84, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDC, U 0x70, U 0xDF, U 0x50, U 0xDB, U 0x60, U 0x2D, U 0x6C, @@ -3467,20 +3467,20 @@ static unsigned char t3fw[30772] = { U 0xFF, U 0xE8, U 0x88, U 0x14, U 0x65, U 0x81, U 0x68, U 0xDA, U 0x20, U 0xDB, U 0x60, U 0x8C, - U 0x15, U 0x58, U 0x0D, U 0x88, + U 0x15, U 0x58, U 0x0D, U 0x9B, U 0xC0, U 0x20, U 0xC0, U 0x90, U 0x29, U 0xA4, U 0x03, U 0xD1, U 0x0F, U 0x8A, U 0x16, U 0x2B, U 0x21, U 0x04, U 0x58, U 0x0C, - U 0xAF, U 0xC0, U 0xA0, U 0x2A, + U 0xC2, U 0xC0, U 0xA0, U 0x2A, U 0x24, U 0x66, U 0x8E, U 0x68, U 0x63, U 0xFD, U 0xCA, U 0x00, U 0x00, U 0x2B, U 0x9C, U 0xF9, U 0x65, U 0xB0, U 0xFD, U 0xDA, - U 0x20, U 0x58, U 0x0C, U 0xB4, + U 0x20, U 0x58, U 0x0C, U 0xC7, U 0x63, U 0xFC, U 0x22, U 0x00, U 0x00, U 0xDA, U 0x20, U 0xC0, - U 0xB6, U 0x58, U 0x0E, U 0x0D, + U 0xB6, U 0x58, U 0x0E, U 0x20, U 0x63, U 0xFF, U 0xBA, U 0x00, U 0x2B, U 0x20, U 0x0C, U 0x0C, U 0xBE, U 0x11, U 0xA7, U 0xEE, @@ -3500,7 +3500,7 @@ static unsigned char t3fw[30772] = { U 0xC6, U 0x02, U 0x70, U 0x96, U 0x0C, U 0x8A, U 0x16, U 0x2B, U 0x21, U 0x04, U 0x58, U 0x0C, - U 0x93, U 0xC0, U 0xD0, U 0x2D, + U 0xA6, U 0xC0, U 0xD0, U 0x2D, U 0x24, U 0x66, U 0x8E, U 0x30, U 0x77, U 0xE7, U 0x4D, U 0x1C, U 0xE4, U 0xF1, U 0x1B, U 0xE4, @@ -3528,7 +3528,7 @@ static unsigned char t3fw[30772] = { U 0x8B, U 0x14, U 0x2C, U 0x25, U 0x23, U 0xC8, U 0xB7, U 0x02, U 0x2A, U 0x02, U 0x06, U 0x6B, - U 0x02, U 0x58, U 0x0C, U 0xC4, + U 0x02, U 0x58, U 0x0C, U 0xD7, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAE, U 0xF7, U 0xC0, U 0xD8, U 0x0D, U 0xAD, U 0x02, U 0x2D, @@ -3536,38 +3536,38 @@ static unsigned char t3fw[30772] = { U 0xEC, U 0x00, U 0x8E, U 0x14, U 0xC8, U 0xE8, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x58, U 0x0C, - U 0xBD, U 0x2A, U 0x21, U 0x02, + U 0xD0, U 0x2A, U 0x21, U 0x02, U 0x65, U 0xAE, U 0xDA, U 0x07, U 0xAF, U 0x02, U 0x2F, U 0x25, U 0x02, U 0x63, U 0xFE, U 0xD1, U 0x00, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x8D, - U 0x14, U 0x58, U 0x0E, U 0x61, + U 0x14, U 0x58, U 0x0E, U 0x74, U 0xD2, U 0xA0, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x2B, U 0x20, - U 0x0C, U 0x58, U 0x0D, U 0xCC, + U 0x0C, U 0x58, U 0x0D, U 0xDF, U 0x63, U 0xFE, U 0xB6, U 0x00, U 0xDA, U 0x20, U 0x2B, U 0x20, - U 0x0C, U 0x58, U 0x0D, U 0xEE, + U 0x0C, U 0x58, U 0x0E, U 0x01, U 0x63, U 0xFE, U 0xAA, U 0xDA, U 0x20, U 0xDB, U 0x30, U 0x8C, U 0x15, U 0x2D, U 0x12, U 0x04, U 0x2E, U 0x0A, U 0x80, U 0x28, U 0x0A, U 0x00, U 0x28, U 0x24, - U 0x68, U 0x58, U 0x0C, U 0xBC, + U 0x68, U 0x58, U 0x0C, U 0xCF, U 0x63, U 0xFA, U 0xE5, U 0x00, U 0xC0, U 0x20, U 0xD1, U 0x0F, U 0xDA, U 0x20, U 0x58, U 0x0D, - U 0xC0, U 0x89, U 0x14, U 0xCD, + U 0xD3, U 0x89, U 0x14, U 0xCD, U 0x92, U 0xDA, U 0x20, U 0xDB, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 01:59:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D1441065672; Sun, 6 Dec 2009 01:59:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4D28FC0A; Sun, 6 Dec 2009 01:59: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 nB61x6w1006921; Sun, 6 Dec 2009 01:59:06 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB61x65o006919; Sun, 6 Dec 2009 01:59:06 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200912060159.nB61x65o006919@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 6 Dec 2009 01:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200176 - stable/8/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 01:59:06 -0000 Author: np Date: Sun Dec 6 01:59:06 2009 New Revision: 200176 URL: http://svn.freebsd.org/changeset/base/200176 Log: MFC r199237: sc->rev and is_offload(sc) will always be 0 during probe. Wait till attach to get correct values. (missed this one in r200175) Modified: stable/8/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Sun Dec 6 01:45:55 2009 (r200175) +++ stable/8/sys/dev/cxgb/cxgb_main.c Sun Dec 6 01:59:06 2009 (r200176) @@ -355,7 +355,6 @@ cxgb_controller_probe(device_t dev) const struct adapter_info *ai; char *ports, buf[80]; int nports; - struct adapter *sc = device_get_softc(dev); ai = cxgb_get_adapter_info(dev); if (ai == NULL) @@ -367,9 +366,7 @@ cxgb_controller_probe(device_t dev) else ports = "ports"; - snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s", - ai->desc, is_offload(sc) ? "R" : "", - sc->params.rev, nports, ports); + snprintf(buf, sizeof(buf), "%s, %d %s", ai->desc, nports, ports); device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } @@ -665,8 +662,8 @@ cxgb_controller_attach(device_t dev) G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers), G_FW_VERSION_MICRO(vers)); - snprintf(buf, sizeof(buf), "%s\t E/C: %s S/N: %s", - ai->desc, + snprintf(buf, sizeof(buf), "%s %sNIC\t E/C: %s S/N: %s", + ai->desc, is_offload(sc) ? "R" : "", sc->params.vpd.ec, sc->params.vpd.sn); device_set_desc_copy(dev, buf); From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 02:44:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 044BA106566B; Sun, 6 Dec 2009 02:44:56 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD11F8FC0A; Sun, 6 Dec 2009 02:44:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB62itf1007961; Sun, 6 Dec 2009 02:44:55 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB62itqR007958; Sun, 6 Dec 2009 02:44:55 GMT (envelope-from np@svn.freebsd.org) Message-Id: <200912060244.nB62itqR007958@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 6 Dec 2009 02:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200177 - in stable/7/sys/dev/cxgb: . common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 02:44:56 -0000 Author: np Date: Sun Dec 6 02:44:55 2009 New Revision: 200177 URL: http://svn.freebsd.org/changeset/base/200177 Log: MFC r199237, r199238 sc->rev and is_offload(sc) will always be 0 during probe. Wait till attach to get correct values. Make sure *some* edc is setup even for an unknown transceiver (assume it is optical). Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c stable/7/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cxgb/common/cxgb_ael1002.c ============================================================================== --- stable/7/sys/dev/cxgb/common/cxgb_ael1002.c Sun Dec 6 01:59:06 2009 (r200176) +++ stable/7/sys/dev/cxgb/common/cxgb_ael1002.c Sun Dec 6 02:44:55 2009 (r200177) @@ -1250,7 +1250,7 @@ static int ael2005_reset(struct cphy *ph return err; phy->modtype = (u8)err; - if (err == phy_modtype_none || err == phy_modtype_unknown) + if (err == phy_modtype_none) err = 0; else if (err == phy_modtype_twinax || err == phy_modtype_twinax_long) err = ael2005_setup_twinax_edc(phy, err); Modified: stable/7/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/7/sys/dev/cxgb/cxgb_main.c Sun Dec 6 01:59:06 2009 (r200176) +++ stable/7/sys/dev/cxgb/cxgb_main.c Sun Dec 6 02:44:55 2009 (r200177) @@ -356,7 +356,6 @@ cxgb_controller_probe(device_t dev) const struct adapter_info *ai; char *ports, buf[80]; int nports; - struct adapter *sc = device_get_softc(dev); ai = cxgb_get_adapter_info(dev); if (ai == NULL) @@ -368,9 +367,7 @@ cxgb_controller_probe(device_t dev) else ports = "ports"; - snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s", - ai->desc, is_offload(sc) ? "R" : "", - sc->params.rev, nports, ports); + snprintf(buf, sizeof(buf), "%s, %d %s", ai->desc, nports, ports); device_set_desc_copy(dev, buf); return (BUS_PROBE_DEFAULT); } @@ -663,8 +660,8 @@ cxgb_controller_attach(device_t dev) G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers), G_FW_VERSION_MICRO(vers)); - snprintf(buf, sizeof(buf), "%s\t E/C: %s S/N: %s", - ai->desc, + snprintf(buf, sizeof(buf), "%s %sNIC\t E/C: %s S/N: %s", + ai->desc, is_offload(sc) ? "R" : "", sc->params.vpd.ec, sc->params.vpd.sn); device_set_desc_copy(dev, buf); From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 08:59:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DA621065676; Sun, 6 Dec 2009 08:59:21 +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 2C6178FC08; Sun, 6 Dec 2009 08:59: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 nB68xLDZ015243; Sun, 6 Dec 2009 08:59:21 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB68xKhl015241; Sun, 6 Dec 2009 08:59:20 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912060859.nB68xKhl015241@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Dec 2009 08:59: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: r200178 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 08:59:21 -0000 Author: ed Date: Sun Dec 6 08:59:19 2009 New Revision: 200178 URL: http://svn.freebsd.org/changeset/base/200178 Log: Make `make cleanilinks' work in /sys/modules. cleanilinks wasn't listed in . Instead of adding it to /sys/modules/Makefile, we'd better just add it to directly, so we don't need to change files like /sys/modules/sound/Makefile as well. This means you can finally clean up all those dangling symlinks created by individual module compilation at once. Modified: head/share/mk/bsd.subdir.mk Modified: head/share/mk/bsd.subdir.mk ============================================================================== --- head/share/mk/bsd.subdir.mk Sun Dec 6 02:44:55 2009 (r200177) +++ head/share/mk/bsd.subdir.mk Sun Dec 6 08:59:19 2009 (r200178) @@ -24,9 +24,9 @@ # This is a variant of install, which will # put the stuff into the right "distribution". # -# afterinstall, all, all-man, beforeinstall, checkdpadd, -# clean, cleandepend, cleandir, depend, install, lint, maninstall, -# manlint, obj, objlink, realinstall, regress, tags +# afterinstall, all, all-man, beforeinstall, checkdpadd, clean, +# cleandepend, cleandir, cleanilinks depend, install, lint, +# maninstall, manlint, obj, objlink, realinstall, regress, tags # .include @@ -66,9 +66,8 @@ ${SUBDIR}: .PHONY ${MAKE} all .for __target in all all-man checkdpadd clean cleandepend cleandir \ - depend distribute lint maninstall manlint \ - obj objlink realinstall regress tags \ - ${SUBDIR_TARGETS} + cleanilinks depend distribute lint maninstall manlint obj objlink \ + realinstall regress tags ${SUBDIR_TARGETS} ${__target}: _SUBDIR .endfor From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 09:36:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63EB7106566B; Sun, 6 Dec 2009 09:36:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C35A8FC0C; Sun, 6 Dec 2009 09:36: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 nB69aB54015990; Sun, 6 Dec 2009 09:36:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB69aB1Q015988; Sun, 6 Dec 2009 09:36:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200912060936.nB69aB1Q015988@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 6 Dec 2009 09:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200179 - stable/8/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 09:36:11 -0000 Author: bz Date: Sun Dec 6 09:36:11 2009 New Revision: 200179 URL: http://svn.freebsd.org/changeset/base/200179 Log: MFC r198467: Unconditionally call the setsockopt for IPV6_V6ONLY for v6 linux sockets no matter whether we are compiled as module or if our default of the net.inet6.ip6.v6only sysctl already matches what we would set. This avoids unnecessary complications with modules, VIMAGES, INET6 and the sysctl value, especially considering that most users will use linux compat as a module. Discussed with: kib, rwatson (weeks ago) Reviewed by: rwatson Modified: stable/8/sys/compat/linux/linux_socket.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/linux/linux_socket.c ============================================================================== --- stable/8/sys/compat/linux/linux_socket.c Sun Dec 6 08:59:19 2009 (r200178) +++ stable/8/sys/compat/linux/linux_socket.c Sun Dec 6 09:36:11 2009 (r200179) @@ -639,19 +639,12 @@ linux_socket(struct thread *td, struct l } #ifdef INET6 /* - * Linux AF_INET6 socket has IPV6_V6ONLY setsockopt set to 0 by - * default and some apps depend on this. So, set V6ONLY to 0 - * for Linux apps if the sysctl value is set to 1. + * Linux AF_INET6 socket has IPV6_V6ONLY setsockopt set to 0 by default + * and some apps depend on this. So, set V6ONLY to 0 for Linux apps. + * For simplicity we do this unconditionally of the net.inet6.ip6.v6only + * sysctl value. */ - if (bsd_args.domain == PF_INET6 -#ifndef KLD_MODULE - /* - * XXX: Avoid undefined symbol error with an IPv4 only - * kernel. - */ - && V_ip6_v6only -#endif - ) { + if (bsd_args.domain == PF_INET6) { int v6only; v6only = 0; From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 11:48:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C7DD1065670; Sun, 6 Dec 2009 11:48:54 +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 EF91A8FC08; Sun, 6 Dec 2009 11:48: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 nB6Bmru0020121; Sun, 6 Dec 2009 11:48:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6BmruQ020118; Sun, 6 Dec 2009 11:48:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912061148.nB6BmruQ020118@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Dec 2009 11:48: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: r200180 - in head/sys/cam: . ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 11:48:54 -0000 Author: mav Date: Sun Dec 6 11:48:53 2009 New Revision: 200180 URL: http://svn.freebsd.org/changeset/base/200180 Log: MFp4: If we panicked with SIM lock held, do not try to flush caches. Extra lock recursing will not make debugging easier. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/cam_periph.h Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sun Dec 6 09:36:11 2009 (r200179) +++ head/sys/cam/ata/ata_da.c Sun Dec 6 11:48:53 2009 (r200180) @@ -1040,6 +1040,9 @@ adashutdown(void * arg, int howto) TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; cam_periph_lock(periph); softc = (struct ada_softc *)periph->softc; /* Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Sun Dec 6 09:36:11 2009 (r200179) +++ head/sys/cam/cam_periph.h Sun Dec 6 11:48:53 2009 (r200180) @@ -190,5 +190,11 @@ cam_periph_unlock(struct cam_periph *per mtx_unlock(periph->sim->mtx); } +static __inline int +cam_periph_owned(struct cam_periph *periph) +{ + return (mtx_owned(periph->sim->mtx)); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 11:53:13 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B60B106566B; Sun, 6 Dec 2009 11:53:13 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 576D48FC12; Sun, 6 Dec 2009 11:53:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id F1AC19CB0E4; Sun, 6 Dec 2009 12:51:21 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jrr47tWzuLyh; Sun, 6 Dec 2009 12:51:19 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9786F9CB0FF; Sun, 6 Dec 2009 12:51:19 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id nB6BpJuw028332; Sun, 6 Dec 2009 12:51:19 +0100 (CET) (envelope-from rdivacky) Date: Sun, 6 Dec 2009 12:51:19 +0100 From: Roman Divacky To: Alexander Motin Message-ID: <20091206115119.GA25721@freebsd.org> References: <200912060010.nB60AD12004058@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912060010.nB60AD12004058@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: r200171 - in head: sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 11:53:13 -0000 On Sun, Dec 06, 2009 at 12:10:13AM +0000, Alexander Motin wrote: > Author: mav > Date: Sun Dec 6 00:10:13 2009 > New Revision: 200171 > URL: http://svn.freebsd.org/changeset/base/200171 > > Log: > MFp4: > Introduce ATA_CAM kernel option, turning ata(4) controller drivers into > cam(4) interface modules. When enabled, this options deprecates all ata(4) > peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers > (ada, cd, ...) and interfaces to be natively used instead. > > As side effect of this, ata(4) mode setting code was completely rewritten > to make controller API more strict and permit above change. While doing > this, SATA revision was separated from PATA mode. It allows DMA-incapable > SATA devices to operate and makes hw.ata.atapi_dma tunable work again. > > Also allow ata(4) controller drivers (except some specific or broken ones) > to handle larger data transfers. Previous constraint of 64K was artificial > and is not really required by PCI ATA BM specification or hardware. are there any performance benefits of the 64K limit removal? From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 12:37:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D28E1106566B; Sun, 6 Dec 2009 12:37:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 091658FC15; Sun, 6 Dec 2009 12:37:19 +0000 (UTC) Received: by bwz5 with SMTP id 5so2868123bwz.3 for ; Sun, 06 Dec 2009 04:37:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=hEQ73H6y1fx+xltqPWetrD1g1l4ddCIsiPLYFY7Uypo=; b=QphF2WtmmpCDtKaVqzg0NtYwLgzAYt+7DleOmEQk8EPS1y7eh/i9NYyZY1W63Q1CgN 6zSgZiAZgnFJAEXEpgQXzoilGJ4OHsY5SKbPCuVXn4rji2gkkAtFUXfWKOCt25Ydu5/t Ng0p9+BibG6RrZYWhVj2z1vCLsYkBXAyUC+Y0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=F6PsMU92weqMNwPyDMdRA/PgTO2x8e7z+7DaninK9E8lpDvzhsTMQVyfP08twXtnfd LtSqt/4dE/Bd6o1lz4OedYBCYZ/+vYRJwX+C+EFLv1EtikDoyqnyQdtls9K/bB5A3nbN 2OUlqk3NDiuujbTzoVKcBMm8E/PFTy9FqAaxg= Received: by 10.204.10.149 with SMTP id p21mr5710420bkp.3.1260103038834; Sun, 06 Dec 2009 04:37:18 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 16sm1628689fxm.12.2009.12.06.04.37.17 (version=SSLv3 cipher=RC4-MD5); Sun, 06 Dec 2009 04:37:18 -0800 (PST) Sender: Alexander Motin Message-ID: <4B1BA57B.4070302@FreeBSD.org> Date: Sun, 06 Dec 2009 14:37:15 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: Roman Divacky References: <200912060010.nB60AD12004058@svn.freebsd.org> <20091206115119.GA25721@freebsd.org> In-Reply-To: <20091206115119.GA25721@freebsd.org> X-Enigmail-Version: 0.96.0 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: r200171 - in head: sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 12:37:20 -0000 Roman Divacky wrote: > On Sun, Dec 06, 2009 at 12:10:13AM +0000, Alexander Motin wrote: >> Author: mav >> Date: Sun Dec 6 00:10:13 2009 >> New Revision: 200171 >> URL: http://svn.freebsd.org/changeset/base/200171 >> >> Log: >> MFp4: >> Introduce ATA_CAM kernel option, turning ata(4) controller drivers into >> cam(4) interface modules. When enabled, this options deprecates all ata(4) >> peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers >> (ada, cd, ...) and interfaces to be natively used instead. >> >> As side effect of this, ata(4) mode setting code was completely rewritten >> to make controller API more strict and permit above change. While doing >> this, SATA revision was separated from PATA mode. It allows DMA-incapable >> SATA devices to operate and makes hw.ata.atapi_dma tunable work again. >> >> Also allow ata(4) controller drivers (except some specific or broken ones) >> to handle larger data transfers. Previous constraint of 64K was artificial >> and is not really required by PCI ATA BM specification or hardware. > > are there any performance benefits of the 64K limit removal? Yes, but it depends on drive and controller. Also it reduces interrupt rate, CPU and command overhead. Also I prefer to have single system-wide tunable for this (MAXPHYS), instead of absolutely ungrounded hardcoded limitation in every driver. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 13:54:41 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19FD2106566C; Sun, 6 Dec 2009 13:54:41 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id B57978FC0A; Sun, 6 Dec 2009 13:54:40 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id nB6DsZnU063764; Sun, 6 Dec 2009 22:54:38 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sun, 06 Dec 2009 22:53:56 +0900 (JST) Message-Id: <20091206.225356.94987952.nyan@FreeBSD.org> To: ed@FreeBSD.org From: TAKAHASHI Yoshihiro In-Reply-To: <200912052026.nB5KQtH6099116@svn.freebsd.org> References: <200912052026.nB5KQtH6099116@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200161 - in head/sbin: init reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 13:54:41 -0000 In article <200912052026.nB5KQtH6099116@svn.freebsd.org> Ed Schouten writes: > Log: > Let init(8) and reboot(8) use utmpx to log wtmp entries. This broke 'make release' on i386 and pc98. cc -static -o fixit_crunch fixit_crunch.o cat.lo chmod.lo cp.lo dd.lo df.lo echo.lo ed.lo expr.lo kill.lo ln.lo ls.lo mkdir.lo mv.lo rm.lo rmdir.lo sleep.lo sync.lo bsdlabel.lo clri.lo dmesg.lo fdisk.lo mount.lo mount_cd9660.lo mount_msdosfs.lo reboot.lo swapon.lo umount.lo ftp.lo telnet.lo chown.lo -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil reboot.lo(.text+0x2f3): In function `main': : undefined reference to `ulog_pututxline' *** Error code 1 Stop in /usr/obj/usr/src/release/fixit_crunch. *** Error code 1 Stop in /usr/src/release. + umount /dev *** Error code 1 Stop in /work/test/pub/pc98/build/world/src/release. --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 14:04:17 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D3341065672; Sun, 6 Dec 2009 14:04:17 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id F0AF58FC17; Sun, 6 Dec 2009 14:04:16 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 68D961CCE6; Sun, 6 Dec 2009 15:04:16 +0100 (CET) Date: Sun, 6 Dec 2009 15:04:16 +0100 From: Ed Schouten To: TAKAHASHI Yoshihiro Message-ID: <20091206140416.GX64905@hoeg.nl> References: <200912052026.nB5KQtH6099116@svn.freebsd.org> <20091206.225356.94987952.nyan@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2y8j+ZQnxuzsbzfy" Content-Disposition: inline In-Reply-To: <20091206.225356.94987952.nyan@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200161 - in head/sbin: init reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 14:04:17 -0000 --2y8j+ZQnxuzsbzfy Content-Type: multipart/mixed; boundary="ZSRqT0vnbHyWXlI9" Content-Disposition: inline --ZSRqT0vnbHyWXlI9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, * TAKAHASHI Yoshihiro wrote: > This broke 'make release' on i386 and pc98. >=20 > cc > reboot.lo(.text+0x2f3): In function `main': > : undefined reference to `ulog_pututxline' Ugh. It's a little frustrating that this information is a bit scattered throughout the source tree. My current development box is building other code right now, so I can't run a make release myself. The attached patch should probably fix it, right? Thanks for informing me. --=20 Ed Schouten WWW: http://80386.nl/ --ZSRqT0vnbHyWXlI9 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="ulog-release.diff" Content-Transfer-Encoding: quoted-printable Index: release/pc98/fixit_crunch.conf =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- release/pc98/fixit_crunch.conf (revision 200169) +++ release/pc98/fixit_crunch.conf (working copy) @@ -44,4 +44,4 @@ progs chown ln chown chgrp =20 -libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil +libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil Index: release/i386/fixit_crunch.conf =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- release/i386/fixit_crunch.conf (revision 200169) +++ release/i386/fixit_crunch.conf (working copy) @@ -46,4 +46,4 @@ progs chroot ln chown chgrp =20 -libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil +libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil --ZSRqT0vnbHyWXlI9-- --2y8j+ZQnxuzsbzfy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksbueAACgkQ52SDGA2eCwV2fwCfeI2cwEqMmUPIDNG1ggHkzwAP nKcAn2cYxdgyjHriMbjuvt8Dl2ECoDxS =MgM0 -----END PGP SIGNATURE----- --2y8j+ZQnxuzsbzfy-- From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 14:20:31 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FB46106566C; Sun, 6 Dec 2009 14:20:31 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id C89EC8FC0C; Sun, 6 Dec 2009 14:20:30 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id nB6EKHPr063886; Sun, 6 Dec 2009 23:20:17 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sun, 06 Dec 2009 23:19:39 +0900 (JST) Message-Id: <20091206.231939.211176203.nyan@FreeBSD.org> To: ed@80386.nl From: TAKAHASHI Yoshihiro In-Reply-To: <20091206140416.GX64905@hoeg.nl> References: <200912052026.nB5KQtH6099116@svn.freebsd.org> <20091206.225356.94987952.nyan@FreeBSD.org> <20091206140416.GX64905@hoeg.nl> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200161 - in head/sbin: init reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 14:20:31 -0000 In article <20091206140416.GX64905@hoeg.nl> Ed Schouten writes: >> This broke 'make release' on i386 and pc98. >> >> reboot.lo(.text+0x2f3): In function `main': >> : undefined reference to `ulog_pututxline' > > Ugh. It's a little frustrating that this information is a bit scattered > throughout the source tree. My current development box is building other > code right now, so I can't run a make release myself. > > The attached patch should probably fix it, right? Thanks for informing > me. Yes, but please fix pc98/fixit-small_crunch.conf too. Thanks in advance. --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 14:22:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E66AE106566B; Sun, 6 Dec 2009 14:22:14 +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 D62CF8FC1D; Sun, 6 Dec 2009 14:22: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 nB6EMEVP023238; Sun, 6 Dec 2009 14:22:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6EMEWZ023234; Sun, 6 Dec 2009 14:22:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912061422.nB6EMEWZ023234@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Dec 2009 14:22: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: r200181 - in head/release: i386 pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 14:22:15 -0000 Author: ed Date: Sun Dec 6 14:22:14 2009 New Revision: 200181 URL: http://svn.freebsd.org/changeset/base/200181 Log: Don't forget to link the fixits against -lulog. reboot(8) now depends on it. Reported by: nyan Modified: head/release/i386/fixit_crunch.conf head/release/pc98/fixit-small_crunch.conf head/release/pc98/fixit_crunch.conf Modified: head/release/i386/fixit_crunch.conf ============================================================================== --- head/release/i386/fixit_crunch.conf Sun Dec 6 11:48:53 2009 (r200180) +++ head/release/i386/fixit_crunch.conf Sun Dec 6 14:22:14 2009 (r200181) @@ -46,4 +46,4 @@ progs chown progs chroot ln chown chgrp -libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil +libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil Modified: head/release/pc98/fixit-small_crunch.conf ============================================================================== --- head/release/pc98/fixit-small_crunch.conf Sun Dec 6 11:48:53 2009 (r200180) +++ head/release/pc98/fixit-small_crunch.conf Sun Dec 6 14:22:14 2009 (r200181) @@ -40,4 +40,4 @@ srcdirs /usr/src/usr.sbin progs chown ln chown chgrp -libs -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil +libs -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil Modified: head/release/pc98/fixit_crunch.conf ============================================================================== --- head/release/pc98/fixit_crunch.conf Sun Dec 6 11:48:53 2009 (r200180) +++ head/release/pc98/fixit_crunch.conf Sun Dec 6 14:22:14 2009 (r200181) @@ -44,4 +44,4 @@ srcdirs /usr/src/usr.sbin progs chown ln chown chgrp -libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lutil +libs -ledit -lgeom -lbsdxml -lsbuf -lkiconv -lkvm -lncurses -lulog -lutil From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 17:26:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1AB41065672; Sun, 6 Dec 2009 17:26: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 B08F48FC1A; Sun, 6 Dec 2009 17:26: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 nB6HQi6L026890; Sun, 6 Dec 2009 17:26:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6HQika026889; Sun, 6 Dec 2009 17:26:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912061726.nB6HQika026889@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 6 Dec 2009 17:26: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: r200182 - head/sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 17:26:44 -0000 Author: nwhitehorn Date: Sun Dec 6 17:26:43 2009 New Revision: 200182 URL: http://svn.freebsd.org/changeset/base/200182 Log: Unbreak build. Pointy hat to: me Modified: head/sys/powerpc/psim/ata_iobus.c Modified: head/sys/powerpc/psim/ata_iobus.c ============================================================================== --- head/sys/powerpc/psim/ata_iobus.c Sun Dec 6 14:22:14 2009 (r200181) +++ head/sys/powerpc/psim/ata_iobus.c Sun Dec 6 17:26:43 2009 (r200182) @@ -246,7 +246,7 @@ ata_iobus_sub_probe(device_t dev) } static int -ata_iobus_sub_setmode(device_t parent, int target, int mode); +ata_iobus_sub_setmode(device_t parent, int target, int mode) { /* Only ever PIO mode here... */ return (ATA_PIO); From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 18:04:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82D28106566B; Sun, 6 Dec 2009 18:04:27 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70F978FC1D; Sun, 6 Dec 2009 18:04: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 nB6I4RwD027653; Sun, 6 Dec 2009 18:04:27 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6I4R38027652; Sun, 6 Dec 2009 18:04:27 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912061804.nB6I4R38027652@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 6 Dec 2009 18:04: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: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 18:04:27 -0000 Author: luigi Date: Sun Dec 6 18:04:26 2009 New Revision: 200183 URL: http://svn.freebsd.org/changeset/base/200183 Log: restore setting of sin_len (was removed in 1.146 last february) as it seems that now it is necessary for 'forward' to work outside lo0. The bug (and fix) was reported on 8.0. This patch probably applies to RELENG_7 as well. It seems that 'pf' has a similar bug. Submitted by: Lytochkin Boris MFC after: 3 days Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Dec 6 17:26:43 2009 (r200182) +++ head/sbin/ipfw/ipfw2.c Sun Dec 6 18:04:26 2009 (r200183) @@ -2740,9 +2740,11 @@ chkarg: /* * In the kernel we assume AF_INET and use only - * sin_port and sin_addr. + * sin_port and sin_addr. Remember to set sin_len as + * the routing code seems to use it too. */ p->sa.sin_family = AF_INET; + p->sa.sin_len = sizeof(struct sockaddr_in); p->sa.sin_port = 0; /* * locate the address-port separator (':' or ',') From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 19:01:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E722B106566C; Sun, 6 Dec 2009 19:01:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D514D8FC1A; Sun, 6 Dec 2009 19:01: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 nB6J1Xre028818; Sun, 6 Dec 2009 19:01:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6J1X7L028816; Sun, 6 Dec 2009 19:01:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912061901.nB6J1X7L028816@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 6 Dec 2009 19:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200184 - stable/8/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 19:01:34 -0000 Author: luigi Date: Sun Dec 6 19:01:33 2009 New Revision: 200184 URL: http://svn.freebsd.org/changeset/base/200184 Log: mfc r200056 use qsort_r instead of heapsort; staticize two functions. Modified: stable/8/sbin/ipfw/dummynet.c Modified: stable/8/sbin/ipfw/dummynet.c ============================================================================== --- stable/8/sbin/ipfw/dummynet.c Sun Dec 6 18:04:26 2009 (r200183) +++ stable/8/sbin/ipfw/dummynet.c Sun Dec 6 19:01:33 2009 (r200184) @@ -78,7 +78,7 @@ static struct _s_x dummynet_params[] = { }; static int -sort_q(const void *pa, const void *pb) +sort_q(void *arg, const void *pa, const void *pb) { int rev = (co.do_sort < 0); int field = rev ? -co.do_sort : co.do_sort; @@ -121,7 +121,7 @@ list_queues(struct dn_flow_set *fs, stru return; if (co.do_sort != 0) - heapsort(q, fs->rq_elements, sizeof *q, sort_q); + qsort_r(q, fs->rq_elements, sizeof *q, NULL, sort_q); /* Print IPv4 flows */ index_printed = 0; @@ -486,7 +486,7 @@ is_valid_number(const char *s) * and return the numeric bandwidth value. * set clocking interface or bandwidth value */ -void +static void read_bandwidth(char *arg, int *bandwidth, char *if_name, int namelen) { if (*bandwidth != -1) @@ -530,7 +530,7 @@ struct point { double delay; }; -int +static int compare_points(const void *vp1, const void *vp2) { const struct point *p1 = vp1; From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 20:30:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D3481065672; Sun, 6 Dec 2009 20:30:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20F8F8FC13; Sun, 6 Dec 2009 20:30: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 nB6KUMJ0030725; Sun, 6 Dec 2009 20:30:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6KULbd030717; Sun, 6 Dec 2009 20:30:21 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912062030.nB6KULbd030717@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Dec 2009 20:30: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: r200185 - in head: lib/libulog sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 20:30:22 -0000 Author: ed Date: Sun Dec 6 20:30:21 2009 New Revision: 200185 URL: http://svn.freebsd.org/changeset/base/200185 Log: Add a libutempter compatibility interface to libulog. The ulog_login_pseudo(3) and ulog_logout_pseudo(3) interfaces provide a functionality identical to what libutempter has to offer. Just transform libutempter's calls into the before mentioned functions. libutempter doesn't work with utmpx, so instead of fixing I thought the easiest way would be to integrate this functionality. libutempter is used by applications like xterm and the KDE libraries, so if I ever change the underlying file format, these applications will keep working automatically. Also increase __FreeBSD_version to indicate the addition (as well as the import of libulog). Added: head/lib/libulog/utempter.c (contents, props changed) head/lib/libulog/utempter.h (contents, props changed) head/lib/libulog/utempter_add_record.3 (contents, props changed) Modified: head/lib/libulog/Makefile head/lib/libulog/Symbol.map head/sys/sys/param.h Modified: head/lib/libulog/Makefile ============================================================================== --- head/lib/libulog/Makefile Sun Dec 6 19:01:33 2009 (r200184) +++ head/lib/libulog/Makefile Sun Dec 6 20:30:21 2009 (r200185) @@ -1,12 +1,15 @@ # $FreeBSD$ +.include + LIB= ulog SHLIB_MAJOR= 0 -INCS= ulog.h +INCS= ulog.h utempter.h SRCS= ulog.h ulog_getutxent.c ulog_internal.h ulog_login.c \ - ulog_login_pseudo.c ulog_pututxline.c ulog_util.c + ulog_login_pseudo.c ulog_pututxline.c ulog_util.c utempter.c -MAN= ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 +MAN= ulog_getutxent.3 ulog_login.3 ulog_setutxfile.3 \ + utempter_add_record.3 MLINKS+=ulog_getutxent.3 ulog_endutxent.3 \ ulog_getutxent.3 ulog_getutxline.3 \ ulog_getutxent.3 ulog_pututxline.3 \ @@ -14,7 +17,12 @@ MLINKS+=ulog_getutxent.3 ulog_endutxent. ulog_login.3 ulog_login_pseudo.3 \ ulog_login.3 ulog_logout.3 \ ulog_login.3 ulog_logout_pseudo.3 \ - ulog_setutxfile.3 ulog_getutxuser.3 + ulog_setutxfile.3 ulog_getutxuser.3 \ + utempter_add_record.3 utempter_remove_added_record.3 \ + utempter_add_record.3 utempter_remove_record.3 \ + utempter_add_record.3 addToUtmp.3 \ + utempter_remove_added_record.3 removeFromUtmp.3 \ + utempter_remove_record.3 removeLineFromUtmp.3 # Add links to -style functions. MLINKS+=ulog_endutxent.3 endutxent.3 \ @@ -28,4 +36,14 @@ WARNS?= 6 VERSION_DEF= ${.CURDIR}/../libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map +.if ${MK_INSTALLLIB} != "no" +SYMLINKS+=libulog.a ${LIBDIR}/libutempter.a +.endif +.if !defined(NO_PIC) +SYMLINKS+=libulog.so ${LIBDIR}/libutempter.so +.endif +.if ${MK_PROFILE} != "no" +SYMLINKS+=libulog_p.a ${LIBDIR}/libutempter_p.a +.endif + .include Modified: head/lib/libulog/Symbol.map ============================================================================== --- head/lib/libulog/Symbol.map Sun Dec 6 19:01:33 2009 (r200184) +++ head/lib/libulog/Symbol.map Sun Dec 6 20:30:21 2009 (r200185) @@ -14,4 +14,11 @@ FBSD_1.2 { ulog_pututxline; ulog_setutxent; ulog_setutxfile; + + addToUtmp; + removeFromUtmp; + removeLineFromUtmp; + utempter_add_record; + utempter_remove_added_record; + utempter_remove_record; }; Added: head/lib/libulog/utempter.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/utempter.c Sun Dec 6 20:30:21 2009 (r200185) @@ -0,0 +1,84 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * 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 "ulog_internal.h" +#include "utempter.h" + +static int last_fd = -1; + +int +utempter_add_record(int fd, const char *host) +{ + + ulog_login_pseudo(fd, host); + last_fd = fd; + return (0); +} + +int +utempter_remove_added_record(void) +{ + + if (last_fd < 0) + return (0); + ulog_logout_pseudo(last_fd); + last_fd = -1; + return (0); +} + +int +utempter_remove_record(int fd) +{ + + ulog_logout_pseudo(fd); + if (last_fd == fd) + last_fd = -1; + return (0); +} + +void +addToUtmp(const char *pty __unused, const char *host, int fd) +{ + + utempter_add_record(fd, host); +} + +void +removeFromUtmp(void) +{ + + utempter_remove_added_record(); +} + +void +removeLineFromUtmp(const char *pty __unused, int fd) +{ + + utempter_remove_record(fd); +} Added: head/lib/libulog/utempter.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/utempter.h Sun Dec 6 20:30:21 2009 (r200185) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2009 Ed Schouten + * 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$ + */ + +#ifndef _UTEMPTER_H_ +#define _UTEMPTER_H_ + +#include + +__BEGIN_DECLS +int utempter_add_record(int, const char *); +int utempter_remove_added_record(void); +int utempter_remove_record(int); + +void addToUtmp(const char *, const char *, int); +void removeFromUtmp(void); +void removeLineFromUtmp(const char *, int); +__END_DECLS + +#endif /* !_UTEMPTER_H_ */ Added: head/lib/libulog/utempter_add_record.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libulog/utempter_add_record.3 Sun Dec 6 20:30:21 2009 (r200185) @@ -0,0 +1,106 @@ +.\" Copyright (c) 2009 Ed Schouten +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 6, 2009 +.Os +.Dt UTEMPTER_ADD_RECORD 3 +.Sh NAME +.Nm utempter_add_record , +.Nm utempter_remove_added_record , +.Nm utempter_remove_record , +.Nm addToUtmp , +.Nm removeFromUtmp , +.Nm removeLineFromUtmp +.Nd utempter compatibility interface +.Sh LIBRARY +.Lb libulog +.Sh SYNOPSIS +.In utempter.h +.Ft int +.Fn utempter_add_record "int fd" "const char *host" +.Ft int +.Fn utempter_remove_added_record "void" +.Ft int +.Fn utempter_remove_record "int fd" +.Ft void +.Fn addToUtmp "const char *pty" "const char *host" "int fd" +.Ft void +.Fn removeFromUtmp "void" +.Ft void +.Fn removeLineFromUtmp "const char *pty" "int fd" +.Sh DESCRIPTION +The +.Fn utempter_add_record +and +.Fn addToUtmp +functions add a login record to the database for the TTY belonging to +the pseudo-terminal master file descriptor +.Fa fd , +using the username corresponding with the real user ID of the calling +process and the optional hostname +.Fa host . +These functions are equivalent to +.Xr ulog_login_pseudo 3 . +.Pp +The +.Fn utempter_remove_record +and +.Fn removeLineFromUtmp +functions mark the login session as being closed for the TTY belonging +to the pseudo-terminal master file descriptor +.Fa fd . +These functions are equivalent to +.Xr ulog_logout_pseudo 3 . +.Pp +The +.Fn utempter_remove_added_record +and +.Fn removeFromUtmp +functions have the same properties as the previously mentioned +functions, except that they use an internally cached value of the file +descriptor passed to the login functions. +.Pp +The +.Fa pty +arguments of +.Fn addToUtmp +and +.Fn removeLineFromUtmp +are unused. +.Sh RETURN VALUES +In this implementation, the +.Fn utempter_add_record , +.Fn utempter_remove_added_record +and +.Fn utempter_remove_record +always return a value of 0. +.Sh SEE ALSO +.Xr ulog_login_pseudo 3 , +.Xr ulog_setutxfile 3 , +.Xr utmp 5 +.Sh HISTORY +These functions appeared in +.Fx 9.0 . Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 6 19:01:33 2009 (r200184) +++ head/sys/sys/param.h Sun Dec 6 20:30:21 2009 (r200185) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900003 /* Master, propagated to newvers */ +#define __FreeBSD_version 900004 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 20:59:05 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03D6F106568B; Sun, 6 Dec 2009 20:59:05 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id ADD508FC14; Sun, 6 Dec 2009 20:59:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C52229CB0E6; Sun, 6 Dec 2009 21:57:12 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zse72Q23qX4G; Sun, 6 Dec 2009 21:57:10 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 63C889CB10E; Sun, 6 Dec 2009 21:57:10 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id nB6KvARJ006649; Sun, 6 Dec 2009 21:57:10 +0100 (CET) (envelope-from rdivacky) Date: Sun, 6 Dec 2009 21:57:10 +0100 From: Roman Divacky To: Ed Schouten Message-ID: <20091206205710.GA6530@freebsd.org> References: <200912062030.nB6KULbd030717@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912062030.nB6KULbd030717@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: r200185 - in head: lib/libulog sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 20:59:05 -0000 On Sun, Dec 06, 2009 at 08:30:21PM +0000, Ed Schouten wrote: > Author: ed > Date: Sun Dec 6 20:30:21 2009 > New Revision: 200185 > URL: http://svn.freebsd.org/changeset/base/200185 > > Log: > Add a libutempter compatibility interface to libulog. > > The ulog_login_pseudo(3) and ulog_logout_pseudo(3) interfaces provide a > functionality identical to what libutempter has to offer. Just transform > libutempter's calls into the before mentioned functions. > > libutempter doesn't work with utmpx, so instead of fixing I thought the > easiest way would be to integrate this functionality. libutempter is > used by applications like xterm and the KDE libraries, so if I ever > change the underlying file format, these applications will keep working > automatically. > > Also increase __FreeBSD_version to indicate the addition (as well as the > import of libulog). this can mark the enabling of unzip building as well.... From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 21:07:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F331065676; Sun, 6 Dec 2009 21:07:47 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 736F98FC0C; Sun, 6 Dec 2009 21:07: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 nB6L7laT031650; Sun, 6 Dec 2009 21:07:47 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6L7lFI031648; Sun, 6 Dec 2009 21:07:47 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912062107.nB6L7lFI031648@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 6 Dec 2009 21:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200186 - stable/8/usr.bin/perror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 21:07:47 -0000 Author: edwin Date: Sun Dec 6 21:07:47 2009 New Revision: 200186 URL: http://svn.freebsd.org/changeset/base/200186 Log: MFC of r199642 The output of perror(1) is now showing local messages for locales supported by libc/nls PR: bin/140499 Approved by: gnn@ Modified: stable/8/usr.bin/perror/perror.c Directory Properties: stable/8/usr.bin/perror/ (props changed) Modified: stable/8/usr.bin/perror/perror.c ============================================================================== --- stable/8/usr.bin/perror/perror.c Sun Dec 6 20:30:21 2009 (r200185) +++ stable/8/usr.bin/perror/perror.c Sun Dec 6 21:07:47 2009 (r200186) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static void usage(void); @@ -43,6 +44,7 @@ main(int argc, char **argv) char *errstr; long errnum; + (void) setlocale(LC_MESSAGES, ""); if (argc != 2) usage(); From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 22:01:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C27C106566B; Sun, 6 Dec 2009 22:01:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59ECB8FC0A; Sun, 6 Dec 2009 22:01: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 nB6M1j3J032885; Sun, 6 Dec 2009 22:01:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6M1jsP032883; Sun, 6 Dec 2009 22:01:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912062201.nB6M1jsP032883@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Dec 2009 22:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200188 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 22:01:45 -0000 Author: jilles Date: Sun Dec 6 22:01:45 2009 New Revision: 200188 URL: http://svn.freebsd.org/changeset/base/200188 Log: MFC r198963: sh: Fix memory leak when using a variable in arithmetic like $((x)). Modified: stable/8/bin/sh/arith_lex.l Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/arith_lex.l ============================================================================== --- stable/8/bin/sh/arith_lex.l Sun Dec 6 21:42:25 2009 (r200187) +++ stable/8/bin/sh/arith_lex.l Sun Dec 6 22:01:45 2009 (r200188) @@ -51,6 +51,13 @@ __FBSDID("$FreeBSD$"); int yylex(void); +struct varname +{ + struct varname *next; + char name[1]; +}; +static struct varname *varnames; + #undef YY_INPUT #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; @@ -80,11 +87,14 @@ int yylex(void); * If variable doesn't exist, we should initialize * it to zero. */ - char *temp; + struct varname *temp; if (lookupvar(yytext) == NULL) setvarsafe(yytext, "0", 0); - temp = (char *)ckmalloc(strlen(yytext) + 1); - yylval.s_value = strcpy(temp, yytext); + temp = ckmalloc(sizeof(struct varname) + + strlen(yytext)); + temp->next = varnames; + varnames = temp; + yylval.s_value = strcpy(temp->name, yytext); return ARITH_VAR; } @@ -130,5 +140,15 @@ int yylex(void); void arith_lex_reset(void) { + struct varname *name, *next; + YY_NEW_FILE; + + name = varnames; + while (name != NULL) { + next = name->next; + ckfree(name); + name = next; + } + varnames = NULL; } From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 22:14:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE68F106566B; Sun, 6 Dec 2009 22:14:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AA858FC19; Sun, 6 Dec 2009 22:14: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 nB6MEw73033178; Sun, 6 Dec 2009 22:14:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6MEwRg033175; Sun, 6 Dec 2009 22:14:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912062214.nB6MEwRg033175@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Dec 2009 22:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200189 - in stable/8: lib/libc/gen tools/regression/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 22:14:58 -0000 Author: jilles Date: Sun Dec 6 22:14:58 2009 New Revision: 200189 URL: http://svn.freebsd.org/changeset/base/200189 Log: MFC r198406: wordexp(3): fix some bugs with signals and long outputs * retry various system calls on EINTR * retry the rest after a short read (common if there is more than about 1K of output) * block SIGCHLD like system(3) does (note that this does not and cannot work fully in threaded programs, they will need to be careful with wait functions) PR: 90580 Modified: stable/8/lib/libc/gen/wordexp.c stable/8/tools/regression/lib/libc/gen/test-wordexp.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/wordexp.c ============================================================================== --- stable/8/lib/libc/gen/wordexp.c Sun Dec 6 22:01:45 2009 (r200188) +++ stable/8/lib/libc/gen/wordexp.c Sun Dec 6 22:14:58 2009 (r200189) @@ -28,8 +28,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -73,6 +75,24 @@ wordexp(const char * __restrict words, w return (0); } +static size_t +we_read_fully(int fd, char *buffer, size_t len) +{ + size_t done; + ssize_t nread; + + done = 0; + do { + nread = _read(fd, buffer + done, len - done); + if (nread == -1 && errno == EINTR) + continue; + if (nread <= 0) + break; + done += nread; + } while (done != len); + return done; +} + /* * we_askshell -- * Use the `wordexp' /bin/sh builtin function to do most of the work @@ -90,20 +110,31 @@ we_askshell(const char *words, wordexp_t size_t sofs; /* Offset into we->we_strings */ size_t vofs; /* Offset into we->we_wordv */ pid_t pid; /* Process ID of child */ + pid_t wpid; /* waitpid return value */ int status; /* Child exit status */ + int error; /* Our return value */ + int serrno; /* errno to return */ char *ifs; /* IFS env. var. */ char *np, *p; /* Handy pointers */ char *nstrings; /* Temporary for realloc() */ char **nwv; /* Temporary for realloc() */ + sigset_t newsigblock, oldsigblock; + serrno = errno; if ((ifs = getenv("IFS")) == NULL) ifs = " \t\n"; if (pipe(pdes) < 0) return (WRDE_NOSPACE); /* XXX */ + (void)sigemptyset(&newsigblock); + (void)sigaddset(&newsigblock, SIGCHLD); + (void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); if ((pid = fork()) < 0) { + serrno = errno; _close(pdes[0]); _close(pdes[1]); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + errno = serrno; return (WRDE_NOSPACE); /* XXX */ } else if (pid == 0) { @@ -114,6 +145,7 @@ we_askshell(const char *words, wordexp_t int devnull; char *cmd; + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); _close(pdes[0]); if (_dup2(pdes[1], STDOUT_FILENO) < 0) _exit(1); @@ -139,10 +171,11 @@ we_askshell(const char *words, wordexp_t * the expanded words separated by nulls. */ _close(pdes[1]); - if (_read(pdes[0], wbuf, 8) != 8 || _read(pdes[0], bbuf, 8) != 8) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + if (we_read_fully(pdes[0], wbuf, 8) != 8 || + we_read_fully(pdes[0], bbuf, 8) != 8) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; } wbuf[8] = bbuf[8] = '\0'; nwords = strtol(wbuf, NULL, 16); @@ -162,33 +195,38 @@ we_askshell(const char *words, wordexp_t if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 + (flags & WRDE_DOOFFS ? we->we_offs : 0)) * sizeof(char *))) == NULL) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (WRDE_NOSPACE); + error = WRDE_NOSPACE; + goto cleanup; } we->we_wordv = nwv; if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (WRDE_NOSPACE); + error = WRDE_NOSPACE; + goto cleanup; } for (i = 0; i < vofs; i++) if (we->we_wordv[i] != NULL) we->we_wordv[i] += nstrings - we->we_strings; we->we_strings = nstrings; - if (_read(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { - _close(pdes[0]); - _waitpid(pid, &status, 0); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); + if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { + error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX; + serrno = errno; + goto cleanup; } - if (_waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || - WEXITSTATUS(status) != 0) { - _close(pdes[0]); - return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); - } + error = 0; +cleanup: _close(pdes[0]); + do + wpid = _waitpid(pid, &status, 0); + while (wpid < 0 && errno == EINTR); + (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); + if (error != 0) { + errno = serrno; + return (error); + } + if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0) + return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX); /* * Break the null-terminated expanded word strings out into Modified: stable/8/tools/regression/lib/libc/gen/test-wordexp.c ============================================================================== --- stable/8/tools/regression/lib/libc/gen/test-wordexp.c Sun Dec 6 22:01:45 2009 (r200188) +++ stable/8/tools/regression/lib/libc/gen/test-wordexp.c Sun Dec 6 22:14:58 2009 (r200189) @@ -32,17 +32,36 @@ #include __FBSDID("$FreeBSD$"); +#include + #include +#include +#include #include #include #include #include +static void +chld_handler(int x) +{ + int status, serrno; + + (void)x; + serrno = errno; + while (waitpid(-1, &status, WNOHANG) > 0) + ; + errno = serrno; +} + int main(int argc, char *argv[]) { + struct sigaction sa; wordexp_t we; int r; + int i; + char longdata[6 * 10000 + 1]; /* Test that the macros are there. */ (void)(WRDE_APPEND + WRDE_DOOFFS + WRDE_NOCMD + WRDE_REUSE + @@ -59,6 +78,15 @@ main(int argc, char *argv[]) assert(we.we_wordv[2] == NULL); wordfree(&we); + /* Long output. */ + for (i = 0; i < 10000; i++) + snprintf(longdata + 6 * i, 7, "%05d ", i); + r = wordexp(longdata, &we, 0); + assert(r == 0); + assert(we.we_wordc == 10000); + assert(we.we_wordv[10000] == NULL); + wordfree(&we); + /* WRDE_DOOFFS */ we.we_offs = 3; r = wordexp("hello world", &we, WRDE_DOOFFS); @@ -167,6 +195,20 @@ main(int argc, char *argv[]) r = wordexp("test } test", &we, 0); assert(r == WRDE_BADCHAR); + /* With a SIGCHLD handler that reaps all zombies. */ + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sa.sa_handler = chld_handler; + r = sigaction(SIGCHLD, &sa, NULL); + assert(r == 0); + r = wordexp("hello world", &we, 0); + assert(r == 0); + assert(we.we_wordc == 2); + assert(strcmp(we.we_wordv[0], "hello") == 0); + assert(strcmp(we.we_wordv[1], "world") == 0); + assert(we.we_wordv[2] == NULL); + wordfree(&we); + printf("PASS wordexp()\n"); printf("PASS wordfree()\n"); From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 22:46:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48305106566C; Sun, 6 Dec 2009 22:46:43 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 29F988FC16; Sun, 6 Dec 2009 22:46:41 +0000 (UTC) Received: by bwz5 with SMTP id 5so3097806bwz.3 for ; Sun, 06 Dec 2009 14:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=UJNXjvEhdPSKMU8ay+iRYH15SuVY97tVTvjSjEVE7jk=; b=wEw5Hgle9Ayg0VnYggVZ9GeV4kQTGtYLu9u8vCtnm/HBpOcmnhhy+jweYa5QANTzV2 /f8fAQ3iCX0DiJeneHyGwJL6hJt38CAXpoNPzrZXIEA1mF0k88vDAmez9dVObmoiVJgn w3l7G1ukL3A3Th9lGBqhCZfaVWmYbUV7eF1/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xx2M/IYhsT/1kjqtcgCoss6Ack8OmYXam1jQflunfLmKZaKS2WphVKbi18iu/fYYm9 PyDske0RNCQ+YvW3qOmRu9ec06L+GW8Mh++DsrsQ8QwPeZca/jRjA6BzqH2tyQsK3FaY yhIEQ3cuJf44PpdDYr/CW+nyuNSPz82CaL7Y0= MIME-Version: 1.0 Received: by 10.204.34.10 with SMTP id j10mr3603298bkd.77.1260139601015; Sun, 06 Dec 2009 14:46:41 -0800 (PST) In-Reply-To: <200912062201.nB6M1jsP032883@svn.freebsd.org> References: <200912062201.nB6M1jsP032883@svn.freebsd.org> Date: Sun, 6 Dec 2009 23:46:40 +0100 Message-ID: <6101e8c40912061446s79423b50le51dd7861fdcc333@mail.gmail.com> From: Oliver Pinter To: Jilles Tjoelker Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200188 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 22:46:43 -0000 this for 7-STABLE? On 12/6/09, Jilles Tjoelker wrote: > Author: jilles > Date: Sun Dec 6 22:01:45 2009 > New Revision: 200188 > URL: http://svn.freebsd.org/changeset/base/200188 > > Log: > MFC r198963: sh: Fix memory leak when using a variable in arithmetic > like $((x)). > > Modified: > stable/8/bin/sh/arith_lex.l > Directory Properties: > stable/8/bin/sh/ (props changed) > > Modified: stable/8/bin/sh/arith_lex.l > ============================================================================== > --- stable/8/bin/sh/arith_lex.l Sun Dec 6 21:42:25 2009 (r200187) > +++ stable/8/bin/sh/arith_lex.l Sun Dec 6 22:01:45 2009 (r200188) > @@ -51,6 +51,13 @@ __FBSDID("$FreeBSD$"); > > int yylex(void); > > +struct varname > +{ > + struct varname *next; > + char name[1]; > +}; > +static struct varname *varnames; > + > #undef YY_INPUT > #define YY_INPUT(buf,result,max) \ > result = (*buf = *arith_buf++) ? 1 : YY_NULL; > @@ -80,11 +87,14 @@ int yylex(void); > * If variable doesn't exist, we should initialize > * it to zero. > */ > - char *temp; > + struct varname *temp; > if (lookupvar(yytext) == NULL) > setvarsafe(yytext, "0", 0); > - temp = (char *)ckmalloc(strlen(yytext) + 1); > - yylval.s_value = strcpy(temp, yytext); > + temp = ckmalloc(sizeof(struct varname) + > + strlen(yytext)); > + temp->next = varnames; > + varnames = temp; > + yylval.s_value = strcpy(temp->name, yytext); > > return ARITH_VAR; > } > @@ -130,5 +140,15 @@ int yylex(void); > void > arith_lex_reset(void) > { > + struct varname *name, *next; > + > YY_NEW_FILE; > + > + name = varnames; > + while (name != NULL) { > + next = name->next; > + ckfree(name); > + name = next; > + } > + varnames = NULL; > } > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:05:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52DBE106566B; Sun, 6 Dec 2009 23:05:18 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2858C8FC08; Sun, 6 Dec 2009 23:05: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 nB6N5Ibu034466; Sun, 6 Dec 2009 23:05:18 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6N5I2S034464; Sun, 6 Dec 2009 23:05:18 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912062305.nB6N5I2S034464@svn.freebsd.org> From: Sean Farley Date: Sun, 6 Dec 2009 23:05: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: r200190 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:05:18 -0000 Author: scf Date: Sun Dec 6 23:05:17 2009 New Revision: 200190 URL: http://svn.freebsd.org/changeset/base/200190 Log: Improve the comment within getenv() explaining the search order it takes to find a variable. Include a note that it must not cause the internal environment to be generated since malloc() depends upon getenv(). To call malloc() would create a circular dependency. Recommended by: green Approved by: jilles MFC after: 1 week Modified: head/lib/libc/stdlib/getenv.c Modified: head/lib/libc/stdlib/getenv.c ============================================================================== --- head/lib/libc/stdlib/getenv.c Sun Dec 6 22:14:58 2009 (r200189) +++ head/lib/libc/stdlib/getenv.c Sun Dec 6 23:05:17 2009 (r200190) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007-2008 Sean C. Farley + * Copyright (c) 2007-2009 Sean C. Farley * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -160,7 +160,7 @@ __findenv(const char *name, size_t nameL /* * Find environment variable from end of array (more likely to be - * active). A variable created by putenv is always active or it is not + * active). A variable created by putenv is always active, or it is not * tracked in the array. */ for (ndx = *envNdx; ndx >= 0; ndx--) @@ -426,13 +426,14 @@ getenv(const char *name) } /* - * An empty environment (environ or its first value) regardless if - * environ has been copied before will return a NULL. + * Variable search order: + * 1. Check for an empty environ. This allows an application to clear + * the environment. + * 2. Search the external environ array. + * 3. Search the internal environment. * - * If the environment is not empty, find an environment variable via - * environ if environ has not been copied via an *env() call or been - * replaced by a running program, otherwise, use the rebuilt - * environment. + * Since malloc() depends upon getenv(), getenv() must never cause the + * internal environment storage to be generated. */ if (environ == NULL || environ[0] == NULL) return (NULL); From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:27:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C8541065693; Sun, 6 Dec 2009 23:27:25 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA278FC0A; Sun, 6 Dec 2009 23:27: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 nB6NROqR034891; Sun, 6 Dec 2009 23:27:24 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6NROLv034889; Sun, 6 Dec 2009 23:27:24 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912062327.nB6NROLv034889@svn.freebsd.org> From: Sean Farley Date: Sun, 6 Dec 2009 23:27: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: r200191 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:27:25 -0000 Author: scf Date: Sun Dec 6 23:27:24 2009 New Revision: 200191 URL: http://svn.freebsd.org/changeset/base/200191 Log: Change the behavior of setenv(), putenv() and unsetenv() to continue parsing instead of returning an error if a corrupt (not a "name=value" string) entry in the environ array is detected when (re)-building the internal environment. This should prevent applications or libraries from experiencing issues arising from the expectation that these calls will complete even with corrupt entries. The behavior is now as it was prior to 7.0. Reviewed by: jilles MFC after: 1 week Modified: head/lib/libc/stdlib/getenv.c Modified: head/lib/libc/stdlib/getenv.c ============================================================================== --- head/lib/libc/stdlib/getenv.c Sun Dec 6 23:05:17 2009 (r200190) +++ head/lib/libc/stdlib/getenv.c Sun Dec 6 23:27:24 2009 (r200191) @@ -361,8 +361,7 @@ __build_env(void) } else { __env_warnx(CorruptEnvValueMsg, envVars[envNdx].name, strlen(envVars[envNdx].name)); - errno = EFAULT; - goto Failure; + continue; } /* @@ -377,8 +376,7 @@ __build_env(void) false) == NULL) { __env_warnx(CorruptEnvFindMsg, envVars[envNdx].name, nameLen); - errno = EFAULT; - goto Failure; + continue; } envVars[activeNdx].active = true; } @@ -560,8 +558,7 @@ __merge_environ(void) if ((equals = strchr(*env, '=')) == NULL) { __env_warnx(CorruptEnvValueMsg, *env, strlen(*env)); - errno = EFAULT; - return (-1); + continue; } if (__setenv(*env, equals - *env, equals + 1, 1) == -1) From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:31:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05CE1106568F; Sun, 6 Dec 2009 23:31:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8F0D8FC17; Sun, 6 Dec 2009 23:31: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 nB6NVNo7035036; Sun, 6 Dec 2009 23:31:23 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6NVNDo035034; Sun, 6 Dec 2009 23:31:23 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912062331.nB6NVNDo035034@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 6 Dec 2009 23:31: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: r200193 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:31:24 -0000 Author: jilles Date: Sun Dec 6 23:31:23 2009 New Revision: 200193 URL: http://svn.freebsd.org/changeset/base/200193 Log: sh: Test ; as well as ; in the 'for' parser test. Modified: head/tools/regression/bin/sh/parser/for1.0 Modified: head/tools/regression/bin/sh/parser/for1.0 ============================================================================== --- head/tools/regression/bin/sh/parser/for1.0 Sun Dec 6 23:28:49 2009 (r200192) +++ head/tools/regression/bin/sh/parser/for1.0 Sun Dec 6 23:31:23 2009 (r200193) @@ -4,7 +4,7 @@ nl=' ' list=' a b c' for s1 in "$nl" " "; do - for s2 in "$nl" ";"; do + for s2 in "$nl" ";" ";$nl"; do for s3 in "$nl" " "; do r='' eval "for i${s1}in ${list}${s2}do${s3}r=\"\$r \$i\"; done" @@ -13,7 +13,7 @@ for s1 in "$nl" " "; do done done set -- $list -for s2 in "$nl" " " ";"; do # s2=";" is an extension to POSIX +for s2 in "$nl" " " ";" ";$nl"; do # s2=";" and ";$nl" are extensions to POSIX for s3 in "$nl" " "; do r='' eval "for i${s2}do${s3}r=\"\$r \$i\"; done" @@ -21,7 +21,7 @@ for s2 in "$nl" " " ";"; do # s2=";" is done done for s1 in "$nl" " "; do - for s2 in "$nl" ";"; do + for s2 in "$nl" ";" ";$nl"; do for s3 in "$nl" " "; do eval "for i${s1}in${s2}do${s3}exit 1; done" done From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:43:25 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D0B1065672; Sun, 6 Dec 2009 23:43:25 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4B08FC08; Sun, 6 Dec 2009 23:43:25 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB6NhOLk069436; Sun, 6 Dec 2009 17:43:24 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Sun, 6 Dec 2009 17:43:24 -0600 (CST) From: "Sean C. Farley" To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org In-Reply-To: <200912062305.nB6N5I2S034464@svn.freebsd.org> Message-ID: References: <200912062305.nB6N5I2S034464@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 X-Spam-Status: No, score=-3.0 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: Subject: Re: svn commit: r200190 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:43:25 -0000 On Sun, 6 Dec 2009, Sean Farley wrote: > Author: scf > Date: Sun Dec 6 23:05:17 2009 > New Revision: 200190 > URL: http://svn.freebsd.org/changeset/base/200190 > > Log: > Improve the comment within getenv() explaining the search order it takes to > find a variable. Include a note that it must not cause the internal > environment to be generated since malloc() depends upon getenv(). To call > malloc() would create a circular dependency. *snip* > Approved by: jilles That should be: Reviewed by: jilles Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:48:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB941065670; Sun, 6 Dec 2009 23:48:39 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F0408FC12; Sun, 6 Dec 2009 23:48: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 nB6Nmcnh035407; Sun, 6 Dec 2009 23:48:38 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6NmcLh035405; Sun, 6 Dec 2009 23:48:38 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200912062348.nB6NmcLh035405@svn.freebsd.org> From: Colin Percival Date: Sun, 6 Dec 2009 23:48: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: r200194 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:48:39 -0000 Author: cperciva Date: Sun Dec 6 23:48:38 2009 New Revision: 200194 URL: http://svn.freebsd.org/changeset/base/200194 Log: Register a request that all changes to *env(3) be reviewed by secteam prior to commit due to the problematic history of this code. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sun Dec 6 23:31:23 2009 (r200193) +++ head/MAINTAINERS Sun Dec 6 23:48:38 2009 (r200194) @@ -124,6 +124,8 @@ usr.bin/bluetooth emax Pre-commit review usr.sbin/bluetooth emax Pre-commit review preferred. gnu/usr.bin/send-pr bugmaster Pre-commit review requested. ncurses rafan Heads-up appreciated, try not to break it. +*env(3) secteam Due to the problematic security history of this + code, please have patches reviewed by secteam. Following are the entries from the Makefiles, and a few other sources. Please remove stale entries from both their origin, and this file. From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:51:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 173831065692; Sun, 6 Dec 2009 23:51:28 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 065E28FC0A; Sun, 6 Dec 2009 23:51:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB6NpRNq035488; Sun, 6 Dec 2009 23:51:27 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6NpRhv035486; Sun, 6 Dec 2009 23:51:27 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912062351.nB6NpRhv035486@svn.freebsd.org> From: Sean Farley Date: Sun, 6 Dec 2009 23:51: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: r200195 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:51:28 -0000 Author: scf Date: Sun Dec 6 23:51:27 2009 New Revision: 200195 URL: http://svn.freebsd.org/changeset/base/200195 Log: Update the getenv(3) man page to reflect the recent change to the behavior of setenv(), putenv() and unsetenv() when dealing with corrupt entries in environ. They now output a warning and complete their task without error. MFC after: 1 week Modified: head/lib/libc/stdlib/getenv.3 Modified: head/lib/libc/stdlib/getenv.3 ============================================================================== --- head/lib/libc/stdlib/getenv.3 Sun Dec 6 23:48:38 2009 (r200194) +++ head/lib/libc/stdlib/getenv.3 Sun Dec 6 23:51:27 2009 (r200195) @@ -107,6 +107,15 @@ function deletes all instances of the variable name pointed to by .Fa name from the list. +.Pp +If corruption (e.g., a name without a value) is detected while making a copy of +environ for internal usage, then +.Fn setenv , +.Fn unsetenv +and +.Fn putenv +will output a warning to stderr about the issue, drop the corrupt entry and +complete the task without error. .Sh RETURN VALUES The .Fn getenv @@ -159,15 +168,6 @@ The function or .Fn putenv failed because they were unable to allocate memory for the environment. -.It Bq Er EFAULT -The functions -.Fn setenv , -.Fn unsetenv -or -.Fn putenv -failed to make a valid copy of the environment due to the environment being -corrupt (i.e., a name without a value). A warning will be output to stderr with -information about the issue. .El .Sh SEE ALSO .Xr csh 1 , From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:55:50 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADE7A106566C; Sun, 6 Dec 2009 23:55:50 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f0f:20:2::11]) by mx1.freebsd.org (Postfix) with ESMTP id 776928FC15; Sun, 6 Dec 2009 23:55:50 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [IPv6:2001:470:1f0f:20:1::5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id nB6Ntn7h069724; Sun, 6 Dec 2009 17:55:49 -0600 (CST) (envelope-from scf@FreeBSD.org) Date: Sun, 6 Dec 2009 17:55:49 -0600 (CST) From: "Sean C. Farley" To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org In-Reply-To: <200912062327.nB6NROLv034889@svn.freebsd.org> Message-ID: References: <200912062327.nB6NROLv034889@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 X-Spam-Status: No, score=-3.0 required=4.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: Subject: Re: svn commit: r200191 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:55:50 -0000 On Sun, 6 Dec 2009, Sean Farley wrote: > Author: scf > Date: Sun Dec 6 23:27:24 2009 > New Revision: 200191 > URL: http://svn.freebsd.org/changeset/base/200191 > > Log: > Change the behavior of setenv(), putenv() and unsetenv() to continue parsing > instead of returning an error if a corrupt (not a "name=value" string) entry > in the environ array is detected when (re)-building the internal > environment. This should prevent applications or libraries from > experiencing issues arising from the expectation that these calls will > complete even with corrupt entries. The behavior is now as it was prior to > 7.0. I will reintroduce the regression test that Brian (green@) wrote with a tweak or two shortly. Sean -- scf@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Sun Dec 6 23:56:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4F6C1065694; Sun, 6 Dec 2009 23:56:54 +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 A44458FC3C; Sun, 6 Dec 2009 23:56:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB6NusBn035622; Sun, 6 Dec 2009 23:56:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB6NusBb035620; Sun, 6 Dec 2009 23:56:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912062356.nB6NusBb035620@svn.freebsd.org> From: Alexander Motin Date: Sun, 6 Dec 2009 23:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200196 - head/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2009 23:56:54 -0000 Author: mav Date: Sun Dec 6 23:56:54 2009 New Revision: 200196 URL: http://svn.freebsd.org/changeset/base/200196 Log: Add Asynchronous Notification support for controllers without SNTF capability by snooping SDB FIS receive area. It should be even faster then regular way, but less reliable. Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Dec 6 23:51:27 2009 (r200195) +++ head/sys/dev/ahci/ahci.c Sun Dec 6 23:56:54 2009 (r200196) @@ -1129,7 +1129,8 @@ ahci_notify_events(device_t dev, u_int32 struct cam_path *dpath; int i; - ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); + if (ch->caps & AHCI_CAP_SSNTF) + ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); if (bootverbose) device_printf(dev, "SNTF 0x%04x\n", status); for (i = 0; i < 16; i++) { @@ -1188,8 +1189,16 @@ ahci_ch_intr(void *data) /* Read command statuses. */ sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT); cstatus = ATA_INL(ch->r_mem, AHCI_P_CI); - if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF)) - sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); + if (istatus & AHCI_P_IX_SDB) { + if (ch->caps & AHCI_CAP_SSNTF) + sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); + else { + u_int8_t *fis = ch->dma.rfis + 0x58; + + if (fis[1] & 0x80) + sntf = (1 << (fis[1] & 0x0f)); + } + } /* Process PHY events */ if (istatus & (AHCI_P_IX_PC | AHCI_P_IX_PRC | AHCI_P_IX_OF | AHCI_P_IX_IF | AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) { From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 00:22:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 219D9106568B; Mon, 7 Dec 2009 00:22:11 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10FD28FC16; Mon, 7 Dec 2009 00:22: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 nB70MA6S036208; Mon, 7 Dec 2009 00:22:10 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB70MAHb036206; Mon, 7 Dec 2009 00:22:10 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912070022.nB70MAHb036206@svn.freebsd.org> From: Sean Farley Date: Mon, 7 Dec 2009 00:22: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: r200198 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 00:22:11 -0000 Author: scf Date: Mon Dec 7 00:22:10 2009 New Revision: 200198 URL: http://svn.freebsd.org/changeset/base/200198 Log: Revert behavior change to setenv(), unsetenv() and putenv() until a more thorough security review has been completed. Modified: head/lib/libc/stdlib/getenv.c Modified: head/lib/libc/stdlib/getenv.c ============================================================================== --- head/lib/libc/stdlib/getenv.c Mon Dec 7 00:15:39 2009 (r200197) +++ head/lib/libc/stdlib/getenv.c Mon Dec 7 00:22:10 2009 (r200198) @@ -361,7 +361,8 @@ __build_env(void) } else { __env_warnx(CorruptEnvValueMsg, envVars[envNdx].name, strlen(envVars[envNdx].name)); - continue; + errno = EFAULT; + goto Failure; } /* @@ -376,7 +377,8 @@ __build_env(void) false) == NULL) { __env_warnx(CorruptEnvFindMsg, envVars[envNdx].name, nameLen); - continue; + errno = EFAULT; + goto Failure; } envVars[activeNdx].active = true; } @@ -558,7 +560,8 @@ __merge_environ(void) if ((equals = strchr(*env, '=')) == NULL) { __env_warnx(CorruptEnvValueMsg, *env, strlen(*env)); - continue; + errno = EFAULT; + return (-1); } if (__setenv(*env, equals - *env, equals + 1, 1) == -1) From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 00:54:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 823BA106566B; Mon, 7 Dec 2009 00:54:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 706ED8FC08; Mon, 7 Dec 2009 00:54: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 nB70s2DC036990; Mon, 7 Dec 2009 00:54:02 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB70s2a5036984; Mon, 7 Dec 2009 00:54:02 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912070054.nB70s2a5036984@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Dec 2009 00:54: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: r200200 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 00:54:02 -0000 Author: marcel Date: Mon Dec 7 00:54:02 2009 New Revision: 200200 URL: http://svn.freebsd.org/changeset/base/200200 Log: Allocate the VHPT for each CPU in cpu_mp_start(), rather than allocating MAXCPU VHPTs up-front. This allows us to max-out MAXCPU without memory waste -- MAXCPU is now 32 for SMP kernels. This change also eliminates the VHPT scaling based in the total memory in the system. It's the workload that determines the best size of the VHPT. The workload can be affected by the amount of memory, but not necessarily. For example, there's no performance difference between VHPT sizes of 256KB, 512KB and 1MB when building the LINT kernel. This was observed with a system that has 8GB of memory. By default the kernel will allocate a 1MB VHPT. The user can tune the system with the "machdep.vhpt.log2size" tunable. Modified: head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/ia64/pmap.c head/sys/ia64/include/param.h head/sys/ia64/include/pcpu.h head/sys/ia64/include/pmap.h Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Mon Dec 7 00:29:10 2009 (r200199) +++ head/sys/ia64/ia64/mp_machdep.c Mon Dec 7 00:54:02 2009 (r200200) @@ -76,7 +76,6 @@ void ia64_ap_startup(void); /* Variables used by os_boot_rendez and ia64_ap_startup */ struct pcpu *ap_pcpu; void *ap_stack; -uint64_t ap_vhpt; volatile int ap_delay; volatile int ap_awake; volatile int ap_spin; @@ -116,13 +115,15 @@ void ia64_ap_startup(void) { volatile struct ia64_interrupt_block *ib = IA64_INTERRUPT_BLOCK; + uint64_t vhpt; int vector; pcpup = ap_pcpu; ia64_set_k4((intptr_t)pcpup); - map_vhpt(ap_vhpt); - ia64_set_pta(ap_vhpt + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); + vhpt = PCPU_GET(vhpt); + map_vhpt(vhpt); + ia64_set_pta(vhpt + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); ia64_srlz_i(); ap_awake = 1; @@ -261,9 +262,14 @@ cpu_mp_start() pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask; if (pc->pc_cpuid > 0) { ap_pcpu = pc; + pc->pc_vhpt = pmap_alloc_vhpt(); + if (pc->pc_vhpt == 0) { + printf("SMP: WARNING: unable to allocate VHPT" + " for cpu%d", pc->pc_cpuid); + continue; + } ap_stack = malloc(KSTACK_PAGES * PAGE_SIZE, M_SMP, M_WAITOK); - ap_vhpt = pmap_vhpt_base[pc->pc_cpuid]; ap_delay = 2000; ap_awake = 0; Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Dec 7 00:29:10 2009 (r200199) +++ head/sys/ia64/ia64/pmap.c Mon Dec 7 00:54:02 2009 (r200200) @@ -217,8 +217,6 @@ int pmap_vhpt_nbuckets; SYSCTL_INT(_machdep_vhpt, OID_AUTO, nbuckets, CTLFLAG_RD, &pmap_vhpt_nbuckets, 0, ""); -uint64_t pmap_vhpt_base[MAXCPU]; - int pmap_vhpt_log2size = 0; TUNABLE_INT("machdep.vhpt.log2size", &pmap_vhpt_log2size); SYSCTL_INT(_machdep_vhpt, OID_AUTO, log2size, CTLFLAG_RD, @@ -277,6 +275,40 @@ pmap_steal_memory(vm_size_t size) return va; } +static void +pmap_initialize_vhpt(vm_offset_t vhpt) +{ + struct ia64_lpte *pte; + u_int i; + + pte = (struct ia64_lpte *)vhpt; + for (i = 0; i < pmap_vhpt_nbuckets; i++) { + pte[i].pte = 0; + pte[i].itir = 0; + pte[i].tag = 1UL << 63; /* Invalid tag */ + pte[i].chain = (uintptr_t)(pmap_vhpt_bucket + i); + } +} + +#ifdef SMP +MALLOC_DECLARE(M_SMP); + +vm_offset_t +pmap_alloc_vhpt(void) +{ + vm_offset_t vhpt; + vm_size_t size; + + size = 1UL << pmap_vhpt_log2size; + vhpt = (uintptr_t)contigmalloc(size, M_SMP, 0, 0UL, ~0UL, size, 0UL); + if (vhpt != 0) { + vhpt = IA64_PHYS_TO_RR7(ia64_tpa(vhpt)); + pmap_initialize_vhpt(vhpt); + } + return (vhpt); +} +#endif + /* * Bootstrap the system enough to run with virtual memory. */ @@ -284,8 +316,7 @@ void pmap_bootstrap() { struct ia64_pal_result res; - struct ia64_lpte *pte; - vm_offset_t base, limit; + vm_offset_t base; size_t size; int i, j, count, ridbits; @@ -365,94 +396,52 @@ pmap_bootstrap() ; count = i+2; - /* - * Figure out a useful size for the VHPT, based on the size of - * physical memory and try to locate a region which is large - * enough to contain the VHPT (which must be a power of two in - * size and aligned to a natural boundary). - * We silently bump up the VHPT size to the minimum size if the - * user has set the tunable too small. Likewise, the VHPT size - * is silently capped to the maximum allowed. - */ TUNABLE_INT_FETCH("machdep.vhpt.log2size", &pmap_vhpt_log2size); - if (pmap_vhpt_log2size == 0) { - pmap_vhpt_log2size = 15; - size = 1UL << pmap_vhpt_log2size; - while (size < Maxmem * 32) { - pmap_vhpt_log2size++; - size <<= 1; - } - } else if (pmap_vhpt_log2size < 15) + if (pmap_vhpt_log2size == 0) + pmap_vhpt_log2size = 20; + else if (pmap_vhpt_log2size < 15) pmap_vhpt_log2size = 15; - if (pmap_vhpt_log2size > 61) + else if (pmap_vhpt_log2size > 61) pmap_vhpt_log2size = 61; - pmap_vhpt_base[0] = 0; - base = limit = 0; + base = 0; size = 1UL << pmap_vhpt_log2size; - while (pmap_vhpt_base[0] == 0) { - if (bootverbose) - printf("Trying VHPT size 0x%lx\n", size); - for (i = 0; i < count; i += 2) { - base = (phys_avail[i] + size - 1) & ~(size - 1); - limit = base + MAXCPU * size; - if (limit <= phys_avail[i+1]) - /* - * VHPT can fit in this region - */ - break; - } - if (!phys_avail[i]) { - /* Can't fit, try next smaller size. */ - pmap_vhpt_log2size--; - size >>= 1; - } else - pmap_vhpt_base[0] = IA64_PHYS_TO_RR7(base); + for (i = 0; i < count; i += 2) { + base = (phys_avail[i] + size - 1) & ~(size - 1); + if (base + size <= phys_avail[i+1]) + break; } - if (pmap_vhpt_log2size < 15) - panic("Can't find space for VHPT"); - - if (bootverbose) - printf("Putting VHPT at 0x%lx\n", base); + if (!phys_avail[i]) + panic("Unable to allocate VHPT"); if (base != phys_avail[i]) { /* Split this region. */ - if (bootverbose) - printf("Splitting [%p-%p]\n", (void *)phys_avail[i], - (void *)phys_avail[i+1]); for (j = count; j > i; j -= 2) { phys_avail[j] = phys_avail[j-2]; phys_avail[j+1] = phys_avail[j-2+1]; } phys_avail[i+1] = base; - phys_avail[i+2] = limit; + phys_avail[i+2] = base + size; } else - phys_avail[i] = limit; + phys_avail[i] = base + size; - pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte); + base = IA64_PHYS_TO_RR7(base); + PCPU_SET(vhpt, base); + if (bootverbose) + printf("VHPT: address=%#lx, size=%#lx\n", base, size); + pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte); pmap_vhpt_bucket = (void *)pmap_steal_memory(pmap_vhpt_nbuckets * sizeof(struct ia64_bucket)); - pte = (struct ia64_lpte *)pmap_vhpt_base[0]; for (i = 0; i < pmap_vhpt_nbuckets; i++) { - pte[i].pte = 0; - pte[i].itir = 0; - pte[i].tag = 1UL << 63; /* Invalid tag */ - pte[i].chain = (uintptr_t)(pmap_vhpt_bucket + i); - /* Stolen memory is zeroed! */ + /* Stolen memory is zeroed. */ mtx_init(&pmap_vhpt_bucket[i].mutex, "VHPT bucket lock", NULL, MTX_NOWITNESS | MTX_SPIN); } - for (i = 1; i < MAXCPU; i++) { - pmap_vhpt_base[i] = pmap_vhpt_base[i - 1] + size; - bcopy((void *)pmap_vhpt_base[i - 1], (void *)pmap_vhpt_base[i], - size); - } - - map_vhpt(pmap_vhpt_base[0]); - ia64_set_pta(pmap_vhpt_base[0] + (1 << 8) + - (pmap_vhpt_log2size << 2) + 1); + pmap_initialize_vhpt(base); + map_vhpt(base); + ia64_set_pta(base + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); ia64_srlz_i(); virtual_avail = VM_MIN_KERNEL_ADDRESS; @@ -551,15 +540,16 @@ static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { struct ia64_lpte *pte; - int i, vhpt_ofs; + struct pcpu *pc; + u_int vhpt_ofs; KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), ("invalidating TLB for non-current pmap")); - vhpt_ofs = ia64_thash(va) - pmap_vhpt_base[PCPU_GET(cpuid)]; + vhpt_ofs = ia64_thash(va) - PCPU_GET(vhpt); critical_enter(); - for (i = 0; i < MAXCPU; i++) { - pte = (struct ia64_lpte *)(pmap_vhpt_base[i] + vhpt_ofs); + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + pte = (struct ia64_lpte *)(pc->pc_vhpt + vhpt_ofs); if (pte->tag == ia64_ttag(va)) pte->tag = 1UL << 63; } Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Mon Dec 7 00:29:10 2009 (r200199) +++ head/sys/ia64/include/param.h Mon Dec 7 00:54:02 2009 (r200200) @@ -59,7 +59,7 @@ #endif #if defined(SMP) || defined(KLD_MODULE) -#define MAXCPU 4 +#define MAXCPU 32 #else #define MAXCPU 1 #endif Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Mon Dec 7 00:29:10 2009 (r200199) +++ head/sys/ia64/include/pcpu.h Mon Dec 7 00:54:02 2009 (r200200) @@ -53,6 +53,7 @@ struct pcpu_stats { #define PCPU_MD_FIELDS \ struct pcb pc_pcb; /* Used by IPI_STOP */ \ struct pmap *pc_current_pmap; /* active pmap */ \ + vm_offset_t pc_vhpt; /* Address of VHPT */ \ uint64_t pc_lid; /* local CPU ID */ \ uint64_t pc_clock; /* Clock counter. */ \ uint64_t pc_clockadj; /* Clock adjust. */ \ Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Mon Dec 7 00:29:10 2009 (r200199) +++ head/sys/ia64/include/pmap.h Mon Dec 7 00:54:02 2009 (r200200) @@ -125,6 +125,7 @@ extern int pmap_vhpt_log2size; #define pmap_unmapbios(va, sz) pmap_unmapdev(va, sz) vm_offset_t pmap_steal_memory(vm_size_t); +vm_offset_t pmap_alloc_vhpt(void); void pmap_bootstrap(void); void pmap_kenter(vm_offset_t va, vm_offset_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 02:17:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED68106566B; Mon, 7 Dec 2009 02:17:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F247C8FC16; Mon, 7 Dec 2009 02:17: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 nB72HwOw038733; Mon, 7 Dec 2009 02:17:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB72HwJx038731; Mon, 7 Dec 2009 02:17:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912070217.nB72HwJx038731@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Dec 2009 02:17: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: r200202 - head/contrib/bind9/lib/isc/ia64/include/isc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 02:17:59 -0000 Author: marcel Date: Mon Dec 7 02:17:58 2009 New Revision: 200202 URL: http://svn.freebsd.org/changeset/base/200202 Log: Fix Read-After-Write (RAW) dependency violation for ar.ccv in isc_atomic_xadd() and isc_atomic_cmpxchg(). Approved by: dougb@ MFC after: 1 week Modified: head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Modified: head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h ============================================================================== --- head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Dec 7 01:46:39 2009 (r200201) +++ head/contrib/bind9/lib/isc/ia64/include/isc/atomic.h Mon Dec 7 02:17:58 2009 (r200202) @@ -41,7 +41,7 @@ isc_atomic_xadd(isc_int32_t *p, isc_int3 for (prev = *(volatile isc_int32_t *)p; ; prev = swapped) { swapped = prev + val; __asm__ volatile( - "mov ar.ccv=%2;" + "mov ar.ccv=%2;;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (swapped), "=m" (*p) : "r" (prev), "r" (swapped), "m" (*p) @@ -84,7 +84,7 @@ isc_atomic_cmpxchg(isc_int32_t *p, isc_i isc_int32_t ret; __asm__ volatile( - "mov ar.ccv=%2;" + "mov ar.ccv=%2;;" "cmpxchg4.acq %0=%4,%3,ar.ccv" : "=r" (ret), "=m" (*p) : "r" (cmpval), "r" (val), "m" (*p) From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 04:31:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7866B1065679 for ; Mon, 7 Dec 2009 04:31:23 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by mx1.freebsd.org (Postfix) with ESMTP id 0FAE78FC14 for ; Mon, 7 Dec 2009 04:31:22 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-064-179-227.pools.arcor-ip.net [88.64.179.227]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MgYIJ-1NUVh91qtz-00NNxF; Mon, 07 Dec 2009 05:31:21 +0100 Received: (qmail 4820 invoked from network); 7 Dec 2009 04:31:18 -0000 Received: from f8x64.laiers.local (192.168.4.188) by router.laiers.local with SMTP; 7 Dec 2009 04:31:18 -0000 From: Max Laier Organization: FreeBSD To: Luigi Rizzo Date: Mon, 7 Dec 2009 05:31:17 +0100 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RELEASE; KDE/4.3.1; amd64; ; ) References: <200912061804.nB6I4R38027652@svn.freebsd.org> In-Reply-To: <200912061804.nB6I4R38027652@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912070531.17758.max@love2party.net> X-Provags-ID: V01U2FsdGVkX19/ErNRu7wMUlZtxiGOkV6MJA+JkJu3oJd9GE4 jvGHz3rPBjI+FBq4P264Wr/AGfLKASBHiRPr6RSbCy92HxMAUt 2AFWQLAQ64E3R/XTdhhrQ== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 04:31:23 -0000 On Sunday 06 December 2009 19:04:27 Luigi Rizzo wrote: > Author: luigi > Date: Sun Dec 6 18:04:26 2009 > New Revision: 200183 > URL: http://svn.freebsd.org/changeset/base/200183 > > Log: > restore setting of sin_len (was removed in 1.146 last february) as > it seems that now it is necessary for 'forward' to work outside lo0. > The bug (and fix) was reported on 8.0. This patch probably applies > to RELENG_7 as well. > It seems that 'pf' has a similar bug. > > Submitted by: Lytochkin Boris Do you have a reference for me? > MFC after: 3 days > > Modified: > head/sbin/ipfw/ipfw2.c > > Modified: head/sbin/ipfw/ipfw2.c > =========================================================================== > === --- head/sbin/ipfw/ipfw2.c Sun Dec 6 17:26:43 2009 (r200182) > +++ head/sbin/ipfw/ipfw2.c Sun Dec 6 18:04:26 2009 (r200183) > @@ -2740,9 +2740,11 @@ chkarg: > > /* > * In the kernel we assume AF_INET and use only > - * sin_port and sin_addr. > + * sin_port and sin_addr. Remember to set sin_len as > + * the routing code seems to use it too. > */ > p->sa.sin_family = AF_INET; > + p->sa.sin_len = sizeof(struct sockaddr_in); > p->sa.sin_port = 0; > /* > * locate the address-port separator (':' or ',') > > > !DSPAM:4b1bf5b9894172410716004! > From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 05:11:54 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4153106566B; Mon, 7 Dec 2009 05:11:54 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC228FC14; Mon, 7 Dec 2009 05:11:54 +0000 (UTC) Received: from ameno.mahoroba.org (IDENT:5QQz6Wb7fFxNbui9aa1Ai1NPX8JGk79pJ/kZbXQ5UxJiDTS9qAMGGYcMpqM8kzsT@ameno.mahoroba.org [IPv6:2001:2f0:104:8010:20a:79ff:fe69:ee6b]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nB75BitR055451 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Dec 2009 14:11:48 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Mon, 07 Dec 2009 14:11:44 +0900 Message-ID: From: Hajimu UMEMOTO To: Ed Schouten In-Reply-To: <200912052009.nB5K9okL098577@svn.freebsd.org> References: <200912052009.nB5K9okL098577@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE-p1 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.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Mon, 07 Dec 2009 14:11:48 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 05:11:55 -0000 Hi, >>>>> On Sat, 5 Dec 2009 20:09:50 +0000 (UTC) >>>>> Ed Schouten said: ed> Author: ed ed> Date: Sat Dec 5 20:09:50 2009 ed> New Revision: 200157 ed> URL: http://svn.freebsd.org/changeset/base/200157 ed> Log: ed> Let date(1) use utmpx instead of logwtmp(). ed> ed> utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for ed> the same purpose as how we call logwtmp() here. ed> Modified: ed> head/bin/date/Makefile ed> head/bin/date/date.c I saw following message during boot: Dec 7 13:54:12 yoshino kernel: Shared object "libulog.so.0" not found, required by "date" Now, date(1) links libulog.so.0. The date(1) is in /bin, but libulog.so.0 is in /usr/lib. The libulog must be installed into /lib. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 05:57:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35925106566C; Mon, 7 Dec 2009 05:57:29 +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 244008FC08; Mon, 7 Dec 2009 05:57:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB75vTpq043105; Mon, 7 Dec 2009 05:57:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB75vT4h043103; Mon, 7 Dec 2009 05:57:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912070557.nB75vT4h043103@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Dec 2009 05:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200203 - head/lib/libulog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 05:57:29 -0000 Author: ed Date: Mon Dec 7 05:57:28 2009 New Revision: 200203 URL: http://svn.freebsd.org/changeset/base/200203 Log: Install libulog in /lib. Because several applications in /bin use libulog (or may use it in the nearby future), it must not live inside /usr. It seems like we don't need to add the copy from /usr/lib to ObsoleteFiles.inc, because it's cleaned up during installation of libulog automatically. Reported by: ume Modified: head/lib/libulog/Makefile Modified: head/lib/libulog/Makefile ============================================================================== --- head/lib/libulog/Makefile Mon Dec 7 02:17:58 2009 (r200202) +++ head/lib/libulog/Makefile Mon Dec 7 05:57:28 2009 (r200203) @@ -1,5 +1,7 @@ # $FreeBSD$ +SHLIBDIR?=/lib + .include LIB= ulog From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 05:57:53 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB2BB10656C0; Mon, 7 Dec 2009 05:57:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4878FC18; Mon, 7 Dec 2009 05:57:53 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 8E03E1CDB6; Mon, 7 Dec 2009 06:57:52 +0100 (CET) Date: Mon, 7 Dec 2009 06:57:52 +0100 From: Ed Schouten To: Hajimu UMEMOTO Message-ID: <20091207055752.GD64905@hoeg.nl> References: <200912052009.nB5K9okL098577@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="T9GM3FGAGf6RSG8v" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 05:57:53 -0000 --T9GM3FGAGf6RSG8v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Hajimu UMEMOTO wrote: > I saw following message during boot: >=20 > Dec 7 13:54:12 yoshino kernel: Shared object "libulog.so.0" not found, r= equired > by "date" >=20 > Now, date(1) links libulog.so.0. The date(1) is in /bin, but > libulog.so.0 is in /usr/lib. The libulog must be installed into /lib. This should be fixed now. Sorry for the noise! --=20 Ed Schouten WWW: http://80386.nl/ --T9GM3FGAGf6RSG8v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkscmWAACgkQ52SDGA2eCwU8GQCdHsCCijuQdyn2FW4H720Eecf4 58UAnijyw4JA74iwFE89NAWjUpOwsHDa =lrcc -----END PGP SIGNATURE----- --T9GM3FGAGf6RSG8v-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 06:05:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C94EF106566C; Mon, 7 Dec 2009 06:05:36 +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 B18A28FC15; Mon, 7 Dec 2009 06:05: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 nB765aAg043377; Mon, 7 Dec 2009 06:05:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB765ahB043372; Mon, 7 Dec 2009 06:05:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200912070605.nB765ahB043372@svn.freebsd.org> From: Hiroki Sato Date: Mon, 7 Dec 2009 06:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200204 - stable/8/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 06:05:36 -0000 Author: hrs Date: Mon Dec 7 06:05:36 2009 New Revision: 200204 URL: http://svn.freebsd.org/changeset/base/200204 Log: MFC: r197138: - The ifconfig(8) command now supports NDP flags which are handled by ndp(8). r198006: - Use printb() to display the "nd6 options=" line. Added: stable/8/sbin/ifconfig/af_nd6.c - copied, changed from r197138, head/sbin/ifconfig/af_nd6.c Modified: stable/8/sbin/ifconfig/Makefile stable/8/sbin/ifconfig/af_inet6.c stable/8/sbin/ifconfig/ifconfig.8 Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/Makefile ============================================================================== --- stable/8/sbin/ifconfig/Makefile Mon Dec 7 05:57:28 2009 (r200203) +++ stable/8/sbin/ifconfig/Makefile Mon Dec 7 06:05:36 2009 (r200204) @@ -18,6 +18,7 @@ SRCS+= af_link.c # LLC support SRCS+= af_inet.c # IPv4 support SRCS+= af_inet6.c # IPv6 support SRCS+= af_atalk.c # AppleTalk support +SRCS+= af_nd6.c # ND6 support SRCS+= ifclone.c # clone device support SRCS+= ifmac.c # MAC support Modified: stable/8/sbin/ifconfig/af_inet6.c ============================================================================== --- stable/8/sbin/ifconfig/af_inet6.c Mon Dec 7 05:57:28 2009 (r200203) +++ stable/8/sbin/ifconfig/af_inet6.c Mon Dec 7 06:05:36 2009 (r200204) @@ -67,6 +67,9 @@ static int prefix(void *, int); static char *sec2str(time_t); static int explicit_prefix = 0; +extern void setnd6flags(const char *, int, int, const struct afswtch *); +extern void setnd6defif(const char *, int, int, const struct afswtch *); + static char addr_buf[MAXHOSTNAMELEN *2 + 1]; /*for getnameinfo()*/ static void @@ -493,6 +496,16 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-deprecated", -IN6_IFF_DEPRECATED, setip6flags), DEF_CMD("autoconf", IN6_IFF_AUTOCONF, setip6flags), DEF_CMD("-autoconf", -IN6_IFF_AUTOCONF, setip6flags), + DEF_CMD("accept_rtadv", ND6_IFF_ACCEPT_RTADV, setnd6flags), + DEF_CMD("-accept_rtadv",-ND6_IFF_ACCEPT_RTADV, setnd6flags), + DEF_CMD("defaultif", 1, setnd6defif), + DEF_CMD("-defaultif", -1, setnd6defif), + DEF_CMD("ifdisabled", ND6_IFF_IFDISABLED, setnd6flags), + DEF_CMD("-ifdisabled", -ND6_IFF_IFDISABLED, setnd6flags), + DEF_CMD("nud", ND6_IFF_PERFORMNUD, setnd6flags), + DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags), + DEF_CMD("prefer_source",ND6_IFF_PREFER_SOURCE, setnd6flags), + DEF_CMD("-prefer_source",-ND6_IFF_PREFER_SOURCE,setnd6flags), DEF_CMD_ARG("pltime", setip6pltime), DEF_CMD_ARG("vltime", setip6vltime), DEF_CMD("eui64", 0, setip6eui64), Copied and modified: stable/8/sbin/ifconfig/af_nd6.c (from r197138, head/sbin/ifconfig/af_nd6.c) ============================================================================== --- head/sbin/ifconfig/af_nd6.c Sat Sep 12 22:08:20 2009 (r197138, copy source) +++ stable/8/sbin/ifconfig/af_nd6.c Mon Dec 7 06:05:36 2009 (r200204) @@ -56,17 +56,9 @@ static const char rcsid[] = #include "ifconfig.h" #define MAX_SYSCTL_TRY 5 - -static struct nd6_opt_list { - const char *label; - u_int mask; -} nd6_opts[] = { - { "IFDISABLED", ND6_IFF_IFDISABLED, }, - { "PERFORMNUD", ND6_IFF_PERFORMNUD, }, - { "ACCEPT_RTADV", ND6_IFF_ACCEPT_RTADV, }, - { "PREFER_SOURCE", ND6_IFF_PREFER_SOURCE, }, - { "AUTO_LINKLOCAL", ND6_IFF_AUTO_LINKLOCAL, }, -}; +#define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ + "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ + "\020DEFAULTIF" static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); @@ -153,9 +145,8 @@ nd6_status(int s) char *buf, *next; int mib[6], ntry; int s6; - int i, error; + int error; int isinet6, isdefif; - int nopts; /* Check if the interface has at least one IPv6 address. */ mib[0] = CTL_NET; @@ -220,22 +211,9 @@ nd6_status(int s) close(s6); if (nd.ndi.flags == 0 && !isdefif) return; - - nopts = 0; - printf("\tnd6 options=%d<", nd.ndi.flags); - for (i=0; i < sizeof(nd6_opts)/sizeof(nd6_opts[0]); i++) { - if (nd.ndi.flags & nd6_opts[i].mask) { - if (nopts++) - printf(","); - printf("%s", nd6_opts[i].label); - } - } - if (isdefif) { - if (nopts) - printf(","); - printf("DEFAULTIF"); - } - printf(">\n"); + printb("\tnd6 options", + (unsigned int)(nd.ndi.flags | (isdefif << 15)), ND6BITS); + putchar('\n'); } static struct afswtch af_nd6 = { Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Mon Dec 7 05:57:28 2009 (r200203) +++ stable/8/sbin/ifconfig/ifconfig.8 Mon Dec 7 06:05:36 2009 (r200204) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd July 8, 2009 +.Dd December 7, 2009 .Dt IFCONFIG 8 .Os .Sh NAME @@ -598,6 +598,38 @@ If the interface was reset when previous the hardware will be re-initialized. .El .Pp +The following parameters are for ICMPv6 Neightbor Discovery Protocol: +.Bl -tag -width indent +.It Cm accept_rtadv +Set a flag to enable accepting ICMPv6 Router Advertisement messages. +.It Cm -accept_rtadv +Clear a flag +.Cm accept_rtadv . +.It Cm defaultif +Set the specified interface as the default route when there is no +default router. +.It Cm -defaultif +Clear a flag +.Cm defaultif . +.It Cm ifdisabled +Set a flag to disable all of IPv6 network communications on the +specified interface. +.It Cm -ifdisabled +Clear a flag +.Cm ifdisabled . +.It Cm nud +Set a flag to enable Neighbor Unreachability Detection. +.It Cm -nud +Clear a flag +.Cm nud . +.It Cm prefer_source +Set a flag to prefer addesses on the interface as candidates of the +source address for outgoing packets. +.It Cm -prefer_source +Clear a flag +.Cm prefer_source . +.El +.Pp The following parameters are specific to cloning IEEE 802.11 wireless interfaces with the .Cm create From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 06:25:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C57751065670; Mon, 7 Dec 2009 06:25:19 +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 B32CF8FC08; Mon, 7 Dec 2009 06:25: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 nB76PJtR043798; Mon, 7 Dec 2009 06:25:19 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB76PJli043796; Mon, 7 Dec 2009 06:25:19 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200912070625.nB76PJli043796@svn.freebsd.org> From: Hiroki Sato Date: Mon, 7 Dec 2009 06:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200205 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 06:25:19 -0000 Author: hrs Date: Mon Dec 7 06:25:19 2009 New Revision: 200205 URL: http://svn.freebsd.org/changeset/base/200205 Log: MFC: r197144: - Add an extension of set_rcvar(), a new function set_rcvar_obsolete(), and $desc. The set_rcvar_obsolete() is to mark a variable as obsolete and define the new one. More specifically, a warning is displayed when a variable is removed or changed in the source tree and the user still defines the old one. Modified: stable/8/etc/rc.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Mon Dec 7 06:05:36 2009 (r200204) +++ stable/8/etc/rc.subr Mon Dec 7 06:25:19 2009 (r200205) @@ -72,37 +72,63 @@ esac # functions # --------- +# set_rcvar [var] [defval] [desc] # -# set_rcvar base_var -# Set the variable name enabling a specific service. -# FreeBSD uses ${service}_enable, while NetBSD uses -# just the name of the service. For example: -# FreeBSD: sendmail_enable="YES" -# NetBSD : sendmail="YES" -# $1 - if $name is not the base to work of off, specify -# a different one +# Echo or define a rc.conf(5) variable name. Global variable +# $rcvars is used. +# +# If no argument is specified, echo "${name}_enable". +# +# If only a var is specified, echo "${var}_enable". +# +# If var and defval are specified, the ${var} is defined as +# rc.conf(5) variable and the default value is ${defvar}. An +# optional argument $desc can also be specified to add a +# description for that. # set_rcvar() { - if [ -z "$1" ]; then - base_var=${name} - else - base_var="$1" - fi - - case ${OSTYPE} in - FreeBSD) - echo ${base_var}_enable + case $# in + 0) + echo ${name}_enable ;; - NetBSD) - echo ${base_var} + 1) + echo ${1}_enable ;; *) - echo 'XXX' + debug "rcvar_define: \$$1=$2 is added" \ + " as a rc.conf(5) variable." + + local _var + _var=$1 + rcvars="${rcvars# } $_var" + eval ${_var}_defval=\"$2\" + shift 2 + # encode multiple lines of _desc + for l in "$@"; do + eval ${_var}_desc=\"\${${_var}_desc#^^}^^$l\" + done + eval ${_var}_desc=\"\${${_var}_desc#^^}\" ;; esac } +# set_rcvar_obsolete oldvar [newvar] [msg] +# Define obsolete variable. +# Global variable $rcvars_obsolete is used. +# +set_rcvar_obsolete() +{ + local _var + _var=$1 + debug "rcvar_obsolete: \$$1(old) -> \$$2(new) is defined" + + rcvars_obsolete="${rcvars_obsolete# } $1" + eval ${1}_newvar=\"$2\" + shift 2 + eval ${_var}_obsolete_msg=\"$*\" +} + # # force_depend script # Force a service to start. Intended for use by services @@ -415,6 +441,8 @@ check_startmsgs() # command_interpreter n If not empty, command is interpreted, so # call check_{pidfile,process}() appropriately. # +# desc n Description of script. +# # extra_commands n List of extra commands supported. # # pidfile n If set, use check_pidfile $pidfile $command, @@ -588,7 +616,7 @@ run_rc_command() esac eval _override_command=\$${name}_program - command=${_override_command:-$command} + command=${command:-${_override_command}} _keywords="start stop restart rcvar $extra_commands" rc_pid= @@ -792,14 +820,49 @@ $command $rc_flags $command_args" ;; rcvar) - echo "# $name" - if [ -n "$rcvar" ]; then - if checkyesno ${rcvar}; then - echo "${rcvar}=YES" - else - echo "${rcvar}=NO" - fi + echo -n "# $name" + if [ -n "$desc" ]; then + echo " : $desc" + else + echo "" fi + echo "#" + # Get unique vars in $rcvar $rcvars + for _v in $rcvar $rcvars; do + case $v in + $_v\ *|\ *$_v|*\ $_v\ *) ;; + *) v="${v# } $_v" ;; + esac + done + + # Display variables. + for _v in $v; do + if [ -z "$_v" ]; then + continue + fi + + eval _desc=\$${_v}_desc + eval _defval=\$${_v}_defval + _h="-" + + eval echo \"$_v=\\\"\$$_v\\\"\" + # decode multiple lines of _desc + while [ -n "$_desc" ]; do + case $_desc in + *^^*) + echo "# $_h ${_desc%%^^*}" + _desc=${_desc#*^^} + _h=" " + ;; + *) + echo "# $_h ${_desc}" + break + ;; + esac + done + echo "# (default: \"$_defval\")" + done + echo "" ;; *) @@ -910,7 +973,8 @@ run_rc_script() unset name command command_args command_interpreter \ extra_commands pidfile procname \ - rcvar required_dirs required_files required_vars + rcvar rcvars rcvars_obsolete required_dirs required_files \ + required_vars eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd case "$_file" in @@ -941,6 +1005,7 @@ run_rc_script() # load_rc_config() { + local _name _var _defval _v _msg _new _name=$1 if [ -z "$_name" ]; then err 3 'USAGE: load_rc_config name' @@ -967,6 +1032,36 @@ load_rc_config() # Old variable names support # [ -n "$enable_quotas" ] && quota_enable="$enable_quotas" + + # Set defaults if defined. + for _var in $rcvar $rcvars; do + _defval=`eval echo "\\\$${_var}_defval"` + if [ -n "$_defval" ]; then + eval : \${$_var:=\$${_var}_defval} + fi + done + + # check obsolete rc.conf variables + for _var in $rcvars_obsolete; do + _v=`eval echo \\$$_var` + _msg=`eval echo \\$${_var}_obsolete_msg` + _new=`eval echo \\$${_var}_newvar` + case $_v in + "") + ;; + *) + if [ -z "$_new" ]; then + _msg="Ignored." + else + eval $_new=\"\$$_var\" + if [ -z "$_msg" ]; then + _msg="Use \$$_new instead." + fi + fi + warn "\$$_var is obsolete. $_msg" + ;; + esac + done } # From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 06:37:12 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E66B106566B; Mon, 7 Dec 2009 06:37:12 +0000 (UTC) (envelope-from vova@parallels.com) Received: from relay.sw.ru (mailhub.sw.ru [195.214.232.25]) by mx1.freebsd.org (Postfix) with ESMTP id BD8BB8FC0C; Mon, 7 Dec 2009 06:37:11 +0000 (UTC) Received: from vbook.fbsd.ru ([10.30.1.111]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id nB7653Ui008627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 7 Dec 2009 09:05:04 +0300 (MSK) Received: from vova by vbook.fbsd.ru with local (Exim 4.71 (FreeBSD)) (envelope-from ) id 1NHWiT-0000bu-30; Mon, 07 Dec 2009 09:05:01 +0300 From: Vladimir Grebenschikov To: Ed Schouten In-Reply-To: <200912052009.nB5K9okL098577@svn.freebsd.org> References: <200912052009.nB5K9okL098577@svn.freebsd.org> Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: quoted-printable Date: Mon, 07 Dec 2009 09:05:00 +0300 Message-ID: <1260165900.1994.1.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port Sender: Vladimir Grebenschikov Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 06:37:12 -0000 Hi=20 Looks like this change broke boot process, it shows following message on early stage of boot: /libexec/ld-elf.so.1: Shared object "libulog.so.0" not found, required by "= date" date is used while /usr is not mounted yet, but libulog.so located in /use/lib: $ ldd /bin/date /bin/date: libulog.so.0 =3D> /usr/lib/libulog.so.0 (0x48090000) libc.so.7 =3D> /lib/libc.so.7 (0x48094000) $ -----Original Message----- From: Ed Schouten To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r200157 - head/bin/date Date: Sat, 5 Dec 2009 20:09:50 +0000 (UTC) Author: ed Date: Sat Dec 5 20:09:50 2009 New Revision: 200157 URL: http://svn.freebsd.org/changeset/base/200157 Log: Let date(1) use utmpx instead of logwtmp(). =20 utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for the same purpose as how we call logwtmp() here. Modified: head/bin/date/Makefile head/bin/date/date.c Modified: head/bin/date/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/bin/date/Makefile Sat Dec 5 20:05:25 2009 (r200156) +++ head/bin/date/Makefile Sat Dec 5 20:09:50 2009 (r200157) @@ -3,7 +3,7 @@ =20 PROG=3D date SRCS=3D date.c netdate.c vary.c -DPADD=3D ${LIBUTIL} -LDADD=3D -lutil +DPADD=3D ${LIBULOG} +LDADD=3D -lulog =20 .include Modified: head/bin/date/date.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- head/bin/date/date.c Sat Dec 5 20:05:25 2009 (r200156) +++ head/bin/date/date.c Sat Dec 5 20:09:50 2009 (r200157) @@ -48,11 +48,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include +#define _ULOG_POSIX_NAMES +#include #include =20 #include "extern.h" @@ -181,6 +182,7 @@ main(int argc, char *argv[]) static void setthetime(const char *fmt, const char *p, int jflag, int nflag) { + struct utmpx utx; struct tm *lt; struct timeval tv; const char *dot, *t; @@ -271,12 +273,16 @@ setthetime(const char *fmt, const char * if (!jflag) { /* set the time */ if (nflag || netsettime(tval)) { - logwtmp("|", "date", ""); + utx.ut_type =3D OLD_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); tv.tv_sec =3D tval; tv.tv_usec =3D 0; if (settimeofday(&tv, (struct timezone *)NULL)) err(1, "settimeofday (timeval)"); - logwtmp("{", "date", ""); + utx.ut_type =3D NEW_TIME; + gettimeofday(&utx.ut_tv, NULL); + pututxline(&utx); } =20 if ((p =3D getlogin()) =3D=3D NULL) _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" --=20 Vladimir B. Grebenschikov vova@fbsd.ru From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 06:41:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37C6F1065670; Mon, 7 Dec 2009 06:41:29 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 241D18FC0C; Mon, 7 Dec 2009 06:41:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB76fR1d044155; Mon, 7 Dec 2009 06:41:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB76fRW7044146; Mon, 7 Dec 2009 06:41:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912070641.nB76fRW7044146@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Dec 2009 06:41: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: r200207 - in head/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 06:41:29 -0000 Author: marcel Date: Mon Dec 7 06:41:27 2009 New Revision: 200207 URL: http://svn.freebsd.org/changeset/base/200207 Log: Define struct pcpu_md as the only MD field of struct pcpu (pc_acpi_id excluded, as it's used by MI code) and mode the sysctl variables from pcpu_stats to pcpu_md. Adjust all references accordingly. While nearby, change the PCPU sysctl tree so that they match the CPU device sysctl tree -- they are now children of a static node called "machdep.cpu" and are named only with their cpu ID. Modified: head/sys/ia64/ia64/clock.c head/sys/ia64/ia64/genassym.c head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/ia64/pmap.c head/sys/ia64/include/kdb.h head/sys/ia64/include/pcpu.h Modified: head/sys/ia64/ia64/clock.c ============================================================================== --- head/sys/ia64/ia64/clock.c Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/ia64/clock.c Mon Dec 7 06:41:27 2009 (r200207) @@ -64,9 +64,9 @@ void pcpu_initclock(void) { - PCPU_SET(clockadj, 0); - PCPU_SET(clock, ia64_get_itc()); - ia64_set_itm(PCPU_GET(clock) + ia64_clock_reload); + PCPU_SET(md.clockadj, 0); + PCPU_SET(md.clock, ia64_get_itc()); + ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload); ia64_set_itv(CLOCK_VECTOR); /* highest priority class */ ia64_srlz_d(); } Modified: head/sys/ia64/ia64/genassym.c ============================================================================== --- head/sys/ia64/ia64/genassym.c Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/ia64/genassym.c Mon Dec 7 06:41:27 2009 (r200207) @@ -91,7 +91,7 @@ ASSYM(MC_SPECIAL_RNAT, offsetof(mcontext ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_SIZE, PAGE_SIZE); -ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_current_pmap)); +ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_md.current_pmap)); ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread)); Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/ia64/interrupt.c Mon Dec 7 06:41:27 2009 (r200207) @@ -127,16 +127,16 @@ interrupt(struct trapframe *tf) * read the vector. */ if (vector == 0) { - PCPU_INC(stats.pcs_nextints); + PCPU_INC(md.stats.pcs_nextints); inta = ib->ib_inta; if (inta == 15) { - PCPU_INC(stats.pcs_nstrays); + PCPU_INC(md.stats.pcs_nstrays); __asm __volatile("mov cr.eoi = r0;; srlz.d"); goto stray; } vector = (int)inta; } else if (vector == 15) { - PCPU_INC(stats.pcs_nstrays); + PCPU_INC(md.stats.pcs_nstrays); goto stray; } @@ -145,7 +145,7 @@ interrupt(struct trapframe *tf) itc = ia64_get_itc(); - PCPU_INC(stats.pcs_nclks); + PCPU_INC(md.stats.pcs_nclks); #ifdef EVCNT_COUNTERS clock_intr_evcnt.ev_count++; #else @@ -154,8 +154,8 @@ interrupt(struct trapframe *tf) critical_enter(); - adj = PCPU_GET(clockadj); - clk = PCPU_GET(clock); + adj = PCPU_GET(md.clockadj); + clk = PCPU_GET(md.clock); delta = itc - clk; count = 0; while (delta >= ia64_clock_reload) { @@ -186,40 +186,40 @@ interrupt(struct trapframe *tf) adj = 0; adjust_excess++; } - PCPU_SET(clock, clk); - PCPU_SET(clockadj, adj); + PCPU_SET(md.clock, clk); + PCPU_SET(md.clockadj, adj); critical_exit(); ia64_srlz_d(); #ifdef SMP } else if (vector == ipi_vector[IPI_AST]) { - PCPU_INC(stats.pcs_nasts); + PCPU_INC(md.stats.pcs_nasts); CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid)); } else if (vector == ipi_vector[IPI_HIGH_FP]) { - PCPU_INC(stats.pcs_nhighfps); + PCPU_INC(md.stats.pcs_nhighfps); ia64_highfp_save_ipi(); } else if (vector == ipi_vector[IPI_RENDEZVOUS]) { - PCPU_INC(stats.pcs_nrdvs); + PCPU_INC(md.stats.pcs_nrdvs); CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid)); enable_intr(); smp_rendezvous_action(); disable_intr(); } else if (vector == ipi_vector[IPI_STOP]) { - PCPU_INC(stats.pcs_nstops); + PCPU_INC(md.stats.pcs_nstops); cpumask_t mybit = PCPU_GET(cpumask); /* Make sure IPI_STOP_HARD is mapped to IPI_STOP. */ KASSERT(IPI_STOP == IPI_STOP_HARD, ("%s: IPI_STOP_HARD not handled.", __func__)); - savectx(PCPU_PTR(pcb)); + savectx(PCPU_PTR(md.pcb)); atomic_set_int(&stopped_cpus, mybit); while ((started_cpus & mybit) == 0) cpu_spinwait(); atomic_clear_int(&started_cpus, mybit); atomic_clear_int(&stopped_cpus, mybit); } else if (vector == ipi_vector[IPI_PREEMPT]) { - PCPU_INC(stats.pcs_npreempts); + PCPU_INC(md.stats.pcs_npreempts); CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); __asm __volatile("mov cr.eoi = r0;; srlz.d"); enable_intr(); @@ -228,7 +228,7 @@ interrupt(struct trapframe *tf) goto stray; #endif } else { - PCPU_INC(stats.pcs_nhwints); + PCPU_INC(md.stats.pcs_nhwints); atomic_add_int(&td->td_intr_nesting_level, 1); ia64_dispatch_intr(tf, vector); atomic_subtract_int(&td->td_intr_nesting_level, 1); Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/ia64/machdep.c Mon Dec 7 06:41:27 2009 (r200207) @@ -101,6 +101,8 @@ __FBSDID("$FreeBSD$"); #include +SYSCTL_NODE(_machdep, OID_AUTO, cpu, CTLFLAG_RD, 0, ""); + u_int64_t processor_frequency; u_int64_t bus_frequency; u_int64_t itc_frequency; @@ -307,57 +309,58 @@ cpu_startup(void *dummy) * Create sysctl tree for per-CPU information. */ SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - pcs = &pc->pc_stats; - snprintf(nodename, sizeof(nodename), "cpu%u", pc->pc_cpuid); - sysctl_ctx_init(&pcs->pcs_sysctl_ctx); - pcs->pcs_sysctl_tree = SYSCTL_ADD_NODE(&pcs->pcs_sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, nodename, + snprintf(nodename, sizeof(nodename), "%u", pc->pc_cpuid); + sysctl_ctx_init(&pc->pc_md.sysctl_ctx); + pc->pc_md.sysctl_tree = SYSCTL_ADD_NODE(&pc->pc_md.sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_machdep_cpu), OID_AUTO, nodename, CTLFLAG_RD, NULL, ""); - if (pcs->pcs_sysctl_tree == NULL) + if (pc->pc_md.sysctl_tree == NULL) continue; - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + pcs = &pc->pc_md.stats; + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nasts", CTLFLAG_RD, &pcs->pcs_nasts, "Number of IPI_AST interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nclks", CTLFLAG_RD, &pcs->pcs_nclks, "Number of clock interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nextints", CTLFLAG_RD, &pcs->pcs_nextints, "Number of ExtINT interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nhighfps", CTLFLAG_RD, &pcs->pcs_nhighfps, "Number of IPI_HIGH_FP interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nhwints", CTLFLAG_RD, &pcs->pcs_nhwints, "Number of hardware (device) interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "npreempts", CTLFLAG_RD, &pcs->pcs_npreempts, "Number of IPI_PREEMPT interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nrdvs", CTLFLAG_RD, &pcs->pcs_nrdvs, "Number of IPI_RENDEZVOUS interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nstops", CTLFLAG_RD, &pcs->pcs_nstops, "Number of IPI_STOP interrupts"); - SYSCTL_ADD_ULONG(&pcs->pcs_sysctl_ctx, - SYSCTL_CHILDREN(pcs->pcs_sysctl_tree), OID_AUTO, + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, "nstrays", CTLFLAG_RD, &pcs->pcs_nstrays, "Number of stray vectors"); } Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/ia64/mp_machdep.c Mon Dec 7 06:41:27 2009 (r200207) @@ -121,7 +121,7 @@ ia64_ap_startup(void) pcpup = ap_pcpu; ia64_set_k4((intptr_t)pcpup); - vhpt = PCPU_GET(vhpt); + vhpt = PCPU_GET(md.vhpt); map_vhpt(vhpt); ia64_set_pta(vhpt + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); ia64_srlz_i(); @@ -226,7 +226,7 @@ cpu_mp_add(u_int acpiid, u_int apicid, u pc = pcpup; pc->pc_acpi_id = acpiid; - pc->pc_lid = lid; + pc->pc_md.lid = lid; all_cpus |= (1UL << cpuid); } @@ -240,8 +240,8 @@ cpu_mp_announce() pc = pcpu_find(i); if (pc != NULL) { printf("cpu%d: ACPI Id=%x, SAPIC Id=%x, SAPIC Eid=%x", - i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_lid), - LID_SAPIC_EID(pc->pc_lid)); + i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_md.lid), + LID_SAPIC_EID(pc->pc_md.lid)); if (i == 0) printf(" (BSP)\n"); else @@ -258,12 +258,12 @@ cpu_mp_start() ap_spin = 1; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - pc->pc_current_pmap = kernel_pmap; + pc->pc_md.current_pmap = kernel_pmap; pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask; if (pc->pc_cpuid > 0) { ap_pcpu = pc; - pc->pc_vhpt = pmap_alloc_vhpt(); - if (pc->pc_vhpt == 0) { + pc->pc_md.vhpt = pmap_alloc_vhpt(); + if (pc->pc_md.vhpt == 0) { printf("SMP: WARNING: unable to allocate VHPT" " for cpu%d", pc->pc_cpuid); continue; @@ -281,13 +281,13 @@ cpu_mp_start() do { DELAY(1000); } while (--ap_delay > 0); - pc->pc_awake = ap_awake; + pc->pc_md.awake = ap_awake; if (!ap_awake) printf("SMP: WARNING: cpu%d did not wake up\n", pc->pc_cpuid); } else - pc->pc_awake = 1; + pc->pc_md.awake = 1; } } @@ -304,7 +304,7 @@ cpu_mp_unleash(void *dummy) smp_cpus = 0; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { cpus++; - if (pc->pc_awake) { + if (pc->pc_md.awake) { kproc_create(ia64_store_mca_state, (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, "mca %u", pc->pc_cpuid); @@ -367,7 +367,7 @@ ipi_send(struct pcpu *cpu, int ipi) uint64_t vector; pipi = __MEMIO_ADDR(ia64_lapic_address | - ((cpu->pc_lid & LID_SAPIC_MASK) >> 12)); + ((cpu->pc_md.lid & LID_SAPIC_MASK) >> 12)); vector = (uint64_t)(ipi_vector[ipi] & 0xff); KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); *pipi = vector; Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/ia64/pmap.c Mon Dec 7 06:41:27 2009 (r200207) @@ -426,7 +426,7 @@ pmap_bootstrap() phys_avail[i] = base + size; base = IA64_PHYS_TO_RR7(base); - PCPU_SET(vhpt, base); + PCPU_SET(md.vhpt, base); if (bootverbose) printf("VHPT: address=%#lx, size=%#lx\n", base, size); @@ -455,7 +455,7 @@ pmap_bootstrap() kernel_pmap->pm_rid[i] = 0; kernel_pmap->pm_active = 1; TAILQ_INIT(&kernel_pmap->pm_pvlist); - PCPU_SET(current_pmap, kernel_pmap); + PCPU_SET(md.current_pmap, kernel_pmap); /* * Region 5 is mapped via the vhpt. @@ -543,13 +543,13 @@ pmap_invalidate_page(pmap_t pmap, vm_off struct pcpu *pc; u_int vhpt_ofs; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("invalidating TLB for non-current pmap")); - vhpt_ofs = ia64_thash(va) - PCPU_GET(vhpt); + vhpt_ofs = ia64_thash(va) - PCPU_GET(md.vhpt); critical_enter(); SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - pte = (struct ia64_lpte *)(pc->pc_vhpt + vhpt_ofs); + pte = (struct ia64_lpte *)(pc->pc_md.vhpt + vhpt_ofs); if (pte->tag == ia64_ttag(va)) pte->tag = 1UL << 63; } @@ -581,7 +581,7 @@ static void pmap_invalidate_all(pmap_t pmap) { - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("invalidating TLB for non-current pmap")); #ifdef SMP @@ -1162,7 +1162,7 @@ pmap_remove_pte(pmap_t pmap, struct ia64 int error; vm_page_t m; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("removing pte for non-current pmap")); /* @@ -1330,7 +1330,7 @@ pmap_remove_page(pmap_t pmap, vm_offset_ { struct ia64_lpte *pte; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("removing page for non-current pmap")); pte = pmap_find_vhpt(va); @@ -2241,7 +2241,7 @@ pmap_switch(pmap_t pm) int i; critical_enter(); - prevpm = PCPU_GET(current_pmap); + prevpm = PCPU_GET(md.current_pmap); if (prevpm == pm) goto out; if (prevpm != NULL) @@ -2258,7 +2258,7 @@ pmap_switch(pmap_t pm) } atomic_set_32(&pm->pm_active, PCPU_GET(cpumask)); } - PCPU_SET(current_pmap, pm); + PCPU_SET(md.current_pmap, pm); ia64_srlz_d(); out: Modified: head/sys/ia64/include/kdb.h ============================================================================== --- head/sys/ia64/include/kdb.h Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/include/kdb.h Mon Dec 7 06:41:27 2009 (r200207) @@ -33,7 +33,7 @@ #include #include -#define KDB_STOPPEDPCB(pc) (&(pc)->pc_pcb) +#define KDB_STOPPEDPCB(pc) (&(pc)->pc_md.pcb) static __inline void kdb_cpu_clear_singlestep(void) Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Mon Dec 7 06:27:47 2009 (r200206) +++ head/sys/ia64/include/pcpu.h Mon Dec 7 06:41:27 2009 (r200207) @@ -43,23 +43,26 @@ struct pcpu_stats { u_long pcs_nrdvs; /* IPI_RENDEZVOUS counter. */ u_long pcs_nstops; /* IPI_STOP counter. */ u_long pcs_nstrays; /* Stray interrupt counter. */ +}; +struct pcpu_md { + struct pcb pcb; /* Used by IPI_STOP */ + struct pmap *current_pmap; /* active pmap */ + vm_offset_t vhpt; /* Address of VHPT */ + uint64_t lid; /* local CPU ID */ + uint64_t clock; /* Clock counter. */ + uint64_t clockadj; /* Clock adjust. */ + uint32_t awake:1; /* CPU is awake? */ + struct pcpu_stats stats; /* Interrupt stats. */ #ifdef _KERNEL - struct sysctl_ctx_list pcs_sysctl_ctx; - struct sysctl_oid *pcs_sysctl_tree; + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; #endif }; #define PCPU_MD_FIELDS \ - struct pcb pc_pcb; /* Used by IPI_STOP */ \ - struct pmap *pc_current_pmap; /* active pmap */ \ - vm_offset_t pc_vhpt; /* Address of VHPT */ \ - uint64_t pc_lid; /* local CPU ID */ \ - uint64_t pc_clock; /* Clock counter. */ \ - uint64_t pc_clockadj; /* Clock adjust. */ \ - uint32_t pc_awake:1; /* CPU is awake? */ \ uint32_t pc_acpi_id; /* ACPI CPU id. */ \ - struct pcpu_stats pc_stats + struct pcpu_md pc_md /* MD fields. */ #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 07:33:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78080106568B; Mon, 7 Dec 2009 07:33:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 644288FC12; Mon, 7 Dec 2009 07:33:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB77XqO9045229; Mon, 7 Dec 2009 07:33:52 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB77Xq4u045211; Mon, 7 Dec 2009 07:33:52 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <200912070733.nB77Xq4u045211@svn.freebsd.org> From: Michael Tuexen Date: Mon, 7 Dec 2009 07:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200208 - in stable/8/sys: kern net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 07:33:52 -0000 Author: tuexen Date: Mon Dec 7 07:33:51 2009 New Revision: 200208 URL: http://svn.freebsd.org/changeset/base/200208 Log: MFC 197288,197326,197327,197328,197342,197914,197929, 197955,199365,199370,199371,199373,199866 This MFCs all SCTP/VNET relevant fixes from head. Approved by: rrs (mentor) Modified: stable/8/sys/kern/uipc_syscalls.c stable/8/sys/net/route.c stable/8/sys/netinet/in_proto.c stable/8/sys/netinet/sctp_asconf.c stable/8/sys/netinet/sctp_bsd_addr.c stable/8/sys/netinet/sctp_constants.h stable/8/sys/netinet/sctp_input.c stable/8/sys/netinet/sctp_os_bsd.h stable/8/sys/netinet/sctp_output.c stable/8/sys/netinet/sctp_pcb.c stable/8/sys/netinet/sctp_pcb.h stable/8/sys/netinet/sctp_structs.h stable/8/sys/netinet/sctp_sysctl.c stable/8/sys/netinet/sctp_timer.c stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c stable/8/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/uipc_syscalls.c ============================================================================== --- stable/8/sys/kern/uipc_syscalls.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/kern/uipc_syscalls.c Mon Dec 7 07:33:51 2009 (r200208) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2311,6 +2312,7 @@ sctp_peeloff(td, uap) goto done; td->td_retval[0] = fd; + CURVNET_SET(head->so_vnet); so = sonewconn(head, SS_ISCONNECTED); if (so == NULL) goto noconnection; @@ -2350,6 +2352,7 @@ noconnection: /* * Release explicitly held references before returning. */ + CURVNET_RESTORE(); done: if (nfp != NULL) fdrop(nfp, td); @@ -2428,9 +2431,11 @@ sctp_generic_sendmsg (td, uap) auio.uio_offset = 0; /* XXX */ auio.uio_resid = 0; len = auio.uio_resid = uap->mlen; + CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, (struct mbuf *)NULL, uap->flags, use_rcvinfo, u_sinfo, td); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -2538,9 +2543,11 @@ sctp_generic_sendmsg_iov(td, uap) } } len = auio.uio_resid; + CURVNET_SET(so->so_vnet); error = sctp_lower_sosend(so, to, &auio, (struct mbuf *)NULL, (struct mbuf *)NULL, uap->flags, use_rcvinfo, u_sinfo, td); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) @@ -2660,9 +2667,11 @@ sctp_generic_recvmsg(td, uap) if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif /* KTRACE */ + CURVNET_SET(so->so_vnet); error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL, fromsa, fromlen, &msg_flags, (struct sctp_sndrcvinfo *)&sinfo, 1); + CURVNET_RESTORE(); if (error) { if (auio.uio_resid != (int)len && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/net/route.c Mon Dec 7 07:33:51 2009 (r200208) @@ -1497,7 +1497,11 @@ rtinit1(struct ifaddr *ifa, int cmd, int ((struct sockaddr_dl *)rt->rt_gateway)->sdl_index = rt->rt_ifp->if_index; } + RT_ADDREF(rt); + RT_UNLOCK(rt); rt_newaddrmsg(cmd, ifa, error, rt); + RT_LOCK(rt); + RT_REMREF(rt); if (cmd == RTM_DELETE) { /* * If we are deleting, and we found an entry, Modified: stable/8/sys/netinet/in_proto.c ============================================================================== --- stable/8/sys/netinet/in_proto.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/in_proto.c Mon Dec 7 07:33:51 2009 (r200208) @@ -150,39 +150,42 @@ struct protosw inetsw[] = { }, #ifdef SCTP { - .pr_type = SOCK_DGRAM, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_init = sctp_init, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs -}, -{ - .pr_type = SOCK_SEQPACKET, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs + .pr_type = SOCK_DGRAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp_input, + .pr_ctlinput = sctp_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_init = sctp_init, +#ifdef VIMAGE + .pr_destroy = sctp_finish, +#endif + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp_usrreqs +}, +{ + .pr_type = SOCK_SEQPACKET, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp_input, + .pr_ctlinput = sctp_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp_usrreqs }, { - .pr_type = SOCK_STREAM, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_SCTP, - .pr_flags = PR_WANTRCVD, - .pr_input = sctp_input, - .pr_ctlinput = sctp_ctlinput, - .pr_ctloutput = sctp_ctloutput, - .pr_drain = sctp_drain, - .pr_usrreqs = &sctp_usrreqs + .pr_type = SOCK_STREAM, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_SCTP, + .pr_flags = PR_WANTRCVD, + .pr_input = sctp_input, + .pr_ctlinput = sctp_ctlinput, + .pr_ctloutput = sctp_ctloutput, + .pr_drain = sctp_drain, + .pr_usrreqs = &sctp_usrreqs }, #endif /* SCTP */ { Modified: stable/8/sys/netinet/sctp_asconf.c ============================================================================== --- stable/8/sys/netinet/sctp_asconf.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_asconf.c Mon Dec 7 07:33:51 2009 (r200208) @@ -881,7 +881,7 @@ send_reply: /* we probably don't need these operations */ (void)sa6_recoverscope(from6); sa6_embedscope(from6, - MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + MODULE_GLOBAL(ip6_use_defzone)); break; } Modified: stable/8/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/8/sys/netinet/sctp_bsd_addr.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_bsd_addr.c Mon Dec 7 07:33:51 2009 (r200208) @@ -89,6 +89,7 @@ sctp_wakeup_iterator(void) static void sctp_iterator_thread(void *v) { + CURVNET_SET((struct vnet *)v); SCTP_IPI_ITERATOR_WQ_LOCK(); SCTP_BASE_INFO(iterator_running) = 0; while (1) { @@ -96,10 +97,12 @@ sctp_iterator_thread(void *v) &SCTP_BASE_INFO(ipi_iterator_wq_mtx), 0, "waiting_for_work", 0); if (SCTP_BASE_INFO(threads_must_exit)) { + SCTP_IPI_ITERATOR_WQ_DESTROY(); kthread_exit(); } sctp_iterator_worker(); } + CURVNET_RESTORE(); } void @@ -108,7 +111,7 @@ sctp_startup_iterator(void) int ret; ret = kproc_create(sctp_iterator_thread, - (void *)NULL, + (void *)curvnet, &SCTP_BASE_INFO(thread_proc), RFPROC, SCTP_KTHREAD_PAGES, @@ -126,7 +129,7 @@ sctp_gather_internal_ifa_flags(struct sc ifa6 = (struct in6_ifaddr *)ifa->ifa; ifa->flags = ifa6->ia6_flags; - if (!MODULE_GLOBAL(MOD_INET6, ip6_use_deprecated)) { + if (!MODULE_GLOBAL(ip6_use_deprecated)) { if (ifa->flags & IN6_IFF_DEPRECATED) { ifa->localifa_flags |= SCTP_ADDR_IFA_UNUSEABLE; @@ -206,7 +209,8 @@ sctp_init_ifns_for_vrf(int vrfid) struct sctp_ifa *sctp_ifa; uint32_t ifa_flags; - TAILQ_FOREACH(ifn, &MODULE_GLOBAL(MOD_NET, ifnet), if_list) { + IFNET_RLOCK(); + TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { IF_ADDR_LOCK(ifn); TAILQ_FOREACH(ifa, &ifn->if_addrlist, ifa_list) { if (ifa->ifa_addr == NULL) { @@ -251,6 +255,7 @@ sctp_init_ifns_for_vrf(int vrfid) } IF_ADDR_UNLOCK(ifn); } + IFNET_RUNLOCK(); } void @@ -336,7 +341,8 @@ void struct ifnet *ifn; struct ifaddr *ifa; - TAILQ_FOREACH(ifn, &MODULE_GLOBAL(MOD_NET, ifnet), if_list) { + IFNET_RLOCK(); + TAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_list) { if (!(*pred) (ifn)) { continue; } @@ -344,6 +350,7 @@ void sctp_addr_change(ifa, add ? RTM_ADD : RTM_DELETE); } } + IFNET_RUNLOCK(); } struct mbuf * Modified: stable/8/sys/netinet/sctp_constants.h ============================================================================== --- stable/8/sys/netinet/sctp_constants.h Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_constants.h Mon Dec 7 07:33:51 2009 (r200208) @@ -87,10 +87,13 @@ __FBSDID("$FreeBSD$"); /* #define SCTP_AUDITING_ENABLED 1 used for debug/auditing */ #define SCTP_AUDIT_SIZE 256 +/* temporary disabled since it does not work with VNET. */ +#if 0 #define SCTP_USE_THREAD_BASED_ITERATOR 1 +#endif #define SCTP_KTRHEAD_NAME "sctp_iterator" -#define SCTP_KTHREAD_PAGES 2 +#define SCTP_KTHREAD_PAGES 0 /* If you support Multi-VRF how big to Modified: stable/8/sys/netinet/sctp_input.c ============================================================================== --- stable/8/sys/netinet/sctp_input.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_input.c Mon Dec 7 07:33:51 2009 (r200208) @@ -5876,7 +5876,7 @@ sctp_skip_csum_4: * idea, so I will leave it in place. */ if (inp && ipsec4_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(MOD_IPSEC, ipsec4stat).in_polvio++; + MODULE_GLOBAL(ipsec4stat).in_polvio++; SCTP_STAT_INCR(sctps_hdrops); goto bad; } Modified: stable/8/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/8/sys/netinet/sctp_os_bsd.h Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_os_bsd.h Mon Dec 7 07:33:51 2009 (r200208) @@ -78,10 +78,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef VIMAGE -#error "SCTP is not yet compatible with VIMAGE." -#endif - #ifdef IPSEC #include #include @@ -137,25 +133,21 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); #define SCTP_CTR6 CTR6 #endif -#define SCTP_BASE_INFO(__m) system_base_info.sctppcbinfo.__m -#define SCTP_BASE_STATS system_base_info.sctpstat -#define SCTP_BASE_STAT(__m) system_base_info.sctpstat.__m -#define SCTP_BASE_SYSCTL(__m) system_base_info.sctpsysctl.__m -#define SCTP_BASE_VAR(__m) system_base_info.__m - /* * Macros to expand out globals defined by various modules * to either a real global or a virtualized instance of one, * depending on whether VIMAGE is defined. */ -/* first define modules that supply us information */ -#define MOD_NET net -#define MOD_INET inet -#define MOD_INET6 inet6 -#define MOD_IPSEC ipsec - /* then define the macro(s) that hook into the vimage macros */ -#define MODULE_GLOBAL(__MODULE, __SYMBOL) V_ ## __SYMBOL +#define MODULE_GLOBAL(__SYMBOL) V_##__SYMBOL + +#define V_system_base_info VNET(system_base_info) +#define SCTP_BASE_INFO(__m) V_system_base_info.sctppcbinfo.__m +#define SCTP_BASE_STATS V_system_base_info.sctpstat +#define SCTP_BASE_STATS_SYSCTL VNET_NAME(system_base_info.sctpstat) +#define SCTP_BASE_STAT(__m) V_system_base_info.sctpstat.__m +#define SCTP_BASE_SYSCTL(__m) VNET_NAME(system_base_info.sctpsysctl.__m) +#define SCTP_BASE_VAR(__m) V_system_base_info.__m /* * @@ -263,10 +255,9 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); /* SCTP_ZONE_INIT: initialize the zone */ typedef struct uma_zone *sctp_zone_t; -#define UMA_ZFLAG_FULL 0x0020 #define SCTP_ZONE_INIT(zone, name, size, number) { \ zone = uma_zcreate(name, size, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,\ - UMA_ZFLAG_FULL); \ + 0); \ uma_zone_set_max(zone, number); \ } Modified: stable/8/sys/netinet/sctp_output.c ============================================================================== --- stable/8/sys/netinet/sctp_output.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_output.c Mon Dec 7 07:33:51 2009 (r200208) @@ -3829,7 +3829,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sin6 = &tmp; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } @@ -3883,7 +3883,7 @@ sctp_lowlevel_chunk_output(struct sctp_i if (net->src_addr_selected == 0) { sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } @@ -3906,7 +3906,7 @@ sctp_lowlevel_chunk_output(struct sctp_i } else { sin6 = (struct sockaddr_in6 *)&ro->ro_dst; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET_PKT(m, inp, stcb, net, SCTP_FROM_SCTP_OUTPUT, EINVAL); return (EINVAL); } @@ -5143,7 +5143,7 @@ do_a_abort: */ (void)sa6_recoverscope(sin6); stc.scope_id = sin6->sin6_scope_id; - sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); stc.loopback_scope = 1; stc.local_scope = 0; stc.site_scope = 1; @@ -5179,7 +5179,7 @@ do_a_abort: */ (void)sa6_recoverscope(sin6); stc.scope_id = sin6->sin6_scope_id; - sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); } else if (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr)) { /* * If the new destination is @@ -10768,7 +10768,7 @@ sctp_send_shutdown_complete2(struct mbuf /* Fill in the IPv6 header for the ABORT */ ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(MOD_INET6, ip6_defhlim); + ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; } else { @@ -11787,7 +11787,7 @@ sctp_send_abort(struct mbuf *m, int iphl /* Fill in the IP6 header for the ABORT */ ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(MOD_INET6, ip6_defhlim); + ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; } else { @@ -12014,7 +12014,7 @@ sctp_send_operr_to(struct mbuf *m, int i /* Fill in the IP6 header for the ABORT */ ip6_out->ip6_flow = ip6->ip6_flow; - ip6_out->ip6_hlim = MODULE_GLOBAL(MOD_INET6, ip6_defhlim); + ip6_out->ip6_hlim = MODULE_GLOBAL(ip6_defhlim); if (port) { ip6_out->ip6_nxt = IPPROTO_UDP; } else { @@ -13765,7 +13765,7 @@ sctp_v6src_match_nexthop(struct sockaddr return (0); /* get prefix entry of address */ - LIST_FOREACH(pfx, &MODULE_GLOBAL(MOD_INET6, nd_prefix), ndpr_entry) { + LIST_FOREACH(pfx, &MODULE_GLOBAL(nd_prefix), ndpr_entry) { if (pfx->ndpr_stateflags & NDPRF_DETACHED) continue; if (IN6_ARE_MASKED_ADDR_EQUAL(&pfx->ndpr_prefix.sin6_addr, Modified: stable/8/sys/netinet/sctp_pcb.c ============================================================================== --- stable/8/sys/netinet/sctp_pcb.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_pcb.c Mon Dec 7 07:33:51 2009 (r200208) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include -struct sctp_base_info system_base_info; +VNET_DEFINE(struct sctp_base_info, system_base_info); /* FIX: we don't handle multiple link local scopes */ /* "scopeless" replacement IN6_ARE_ADDR_EQUAL */ @@ -59,11 +59,11 @@ SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 struct sockaddr_in6 tmp_a, tmp_b; memcpy(&tmp_a, a, sizeof(struct sockaddr_in6)); - if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(&tmp_a, MODULE_GLOBAL(ip6_use_defzone)) != 0) { return 0; } memcpy(&tmp_b, b, sizeof(struct sockaddr_in6)); - if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(&tmp_b, MODULE_GLOBAL(ip6_use_defzone)) != 0) { return 0; } return (IN6_ARE_ADDR_EQUAL(&tmp_a.sin6_addr, &tmp_b.sin6_addr)); @@ -2008,7 +2008,7 @@ sctp_findassociation_addr(struct mbuf *m /* Get the scopes in properly to the sin6 addr's */ /* we probably don't need these operations */ (void)sa6_recoverscope(from6); - sa6_embedscope(from6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(from6, MODULE_GLOBAL(ip6_use_defzone)); break; } #endif @@ -2049,7 +2049,7 @@ sctp_findassociation_addr(struct mbuf *m /* Get the scopes in properly to the sin6 addr's */ /* we probably don't need these operations */ (void)sa6_recoverscope(to6); - sa6_embedscope(to6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + sa6_embedscope(to6, MODULE_GLOBAL(ip6_use_defzone)); break; } #endif @@ -2316,7 +2316,7 @@ sctp_inpcb_alloc(struct socket *so, uint } #endif /* IPSEC */ SCTP_INCR_EP_COUNT(); - inp->ip_inp.inp.inp_ip_ttl = MODULE_GLOBAL(MOD_INET, ip_defttl); + inp->ip_inp.inp.inp_ip_ttl = MODULE_GLOBAL(ip_defttl); SCTP_INP_INFO_WUNLOCK(); so->so_pcb = (caddr_t)inp; @@ -2688,7 +2688,7 @@ sctp_inpcb_bind(struct socket *so, struc if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { bindall = 0; /* KAME hack: embed scopeid */ - if (sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)) != 0) { + if (sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, EINVAL); return (EINVAL); } @@ -2814,8 +2814,8 @@ continue_anyway: int done; if (ip_inp->inp_flags & INP_HIGHPORT) { - first = MODULE_GLOBAL(MOD_INET, ipport_hifirstauto); - last = MODULE_GLOBAL(MOD_INET, ipport_hilastauto); + first = MODULE_GLOBAL(ipport_hifirstauto); + last = MODULE_GLOBAL(ipport_hilastauto); } else if (ip_inp->inp_flags & INP_LOWPORT) { if (p && (error = priv_check(p, PRIV_NETINET_RESERVEDPORT) @@ -2826,11 +2826,11 @@ continue_anyway: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_PCB, error); return (error); } - first = MODULE_GLOBAL(MOD_INET, ipport_lowfirstauto); - last = MODULE_GLOBAL(MOD_INET, ipport_lowlastauto); + first = MODULE_GLOBAL(ipport_lowfirstauto); + last = MODULE_GLOBAL(ipport_lowlastauto); } else { - first = MODULE_GLOBAL(MOD_INET, ipport_firstauto); - last = MODULE_GLOBAL(MOD_INET, ipport_lastauto); + first = MODULE_GLOBAL(ipport_firstauto); + last = MODULE_GLOBAL(ipport_lastauto); } if (first > last) { uint16_t temp; @@ -3756,7 +3756,7 @@ sctp_add_remote_addr(struct sctp_tcb *st struct sockaddr_in6 *sin6; sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; - (void)sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + (void)sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); sin6->sin6_scope_id = 0; } #endif @@ -5558,36 +5558,54 @@ sctp_pcb_finish(void) struct sctp_ifa *ifa; struct sctpvtaghead *chain; struct sctp_tagblock *twait_block, *prev_twait_block; + struct sctp_laddr *wi; + struct sctp_iterator *it; int i; +#if defined(SCTP_USE_THREAD_BASED_ITERATOR) + SCTP_BASE_INFO(threads_must_exit) = 1; + /* Wake the thread up so it will exit now */ + sctp_wakeup_iterator(); + +#endif + SCTP_OS_TIMER_STOP(&SCTP_BASE_INFO(addr_wq_timer.timer)); + SCTP_IPI_ITERATOR_WQ_LOCK(); + while ((wi = LIST_FIRST(&SCTP_BASE_INFO(addr_wq))) != NULL) { + LIST_REMOVE(wi, sctp_nxt_addr); + SCTP_DECR_LADDR_COUNT(); + SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_laddr), wi); + } + SCTP_IPI_ITERATOR_WQ_UNLOCK(); + while ((it = TAILQ_FIRST(&SCTP_BASE_INFO(iteratorhead))) != NULL) { + if (it->function_atend != NULL) { + (*it->function_atend) (it->pointer, it->val); + } + TAILQ_REMOVE(&SCTP_BASE_INFO(iteratorhead), it, sctp_nxt_itr); + SCTP_FREE(it, SCTP_M_ITER); + } + /* * free the vrf/ifn/ifa lists and hashes (be sure address monitor is * destroyed first). */ vrf_bucket = &SCTP_BASE_INFO(sctp_vrfhash)[(SCTP_DEFAULT_VRFID & SCTP_BASE_INFO(hashvrfmark))]; - vrf = LIST_FIRST(vrf_bucket); - while (vrf) { - ifn = LIST_FIRST(&vrf->ifnlist); - while (ifn) { - ifa = LIST_FIRST(&ifn->ifalist); - while (ifa) { + while ((vrf = LIST_FIRST(vrf_bucket)) != NULL) { + while ((ifn = LIST_FIRST(&vrf->ifnlist)) != NULL) { + while ((ifa = LIST_FIRST(&ifn->ifalist)) != NULL) { /* free the ifa */ LIST_REMOVE(ifa, next_bucket); LIST_REMOVE(ifa, next_ifa); SCTP_FREE(ifa, SCTP_M_IFA); - ifa = LIST_FIRST(&ifn->ifalist); } /* free the ifn */ LIST_REMOVE(ifn, next_bucket); LIST_REMOVE(ifn, next_ifn); SCTP_FREE(ifn, SCTP_M_IFN); - ifn = LIST_FIRST(&vrf->ifnlist); } SCTP_HASH_FREE(vrf->vrf_addr_hash, vrf->vrf_addr_hashmark); /* free the vrf */ LIST_REMOVE(vrf, next_vrf); SCTP_FREE(vrf, SCTP_M_VRF); - vrf = LIST_FIRST(vrf_bucket); } /* free the vrf hashes */ SCTP_HASH_FREE(SCTP_BASE_INFO(sctp_vrfhash), SCTP_BASE_INFO(hashvrfmark)); @@ -5614,9 +5632,7 @@ sctp_pcb_finish(void) /* free the locks and mutexes */ #ifdef SCTP_PACKET_LOGGING SCTP_IP_PKTLOG_DESTROY(); - #endif - SCTP_IPI_ITERATOR_WQ_DESTROY(); SCTP_IPI_ADDR_DESTROY(); SCTP_ITERATOR_LOCK_DESTROY(); SCTP_STATLOG_DESTROY(); @@ -6422,10 +6438,6 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, /* We look for anything larger than the cum-ack + 1 */ - SCTP_STAT_INCR(sctps_protocol_drain_calls); - if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { - return; - } asoc = &stcb->asoc; if (asoc->cumulative_tsn == asoc->highest_tsn_inside_map) { /* none we can reneg on. */ @@ -6588,22 +6600,37 @@ sctp_drain() * is LOW on MBUF's and needs help. This is where reneging will * occur. We really hope this does NOT happen! */ - struct sctp_inpcb *inp; - struct sctp_tcb *stcb; + VNET_ITERATOR_DECL(vnet_iter); + VNET_LIST_RLOCK_NOSLEEP(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + struct sctp_inpcb *inp; + struct sctp_tcb *stcb; - SCTP_INP_INFO_RLOCK(); - LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { - /* For each endpoint */ - SCTP_INP_RLOCK(inp); - LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { - /* For each association */ - SCTP_TCB_LOCK(stcb); - sctp_drain_mbufs(inp, stcb); - SCTP_TCB_UNLOCK(stcb); + SCTP_STAT_INCR(sctps_protocol_drain_calls); + if (SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { +#ifdef VIMAGE + continue; +#else + return; +#endif } - SCTP_INP_RUNLOCK(inp); + SCTP_INP_INFO_RLOCK(); + LIST_FOREACH(inp, &SCTP_BASE_INFO(listhead), sctp_list) { + /* For each endpoint */ + SCTP_INP_RLOCK(inp); + LIST_FOREACH(stcb, &inp->sctp_asoc_list, sctp_tcblist) { + /* For each association */ + SCTP_TCB_LOCK(stcb); + sctp_drain_mbufs(inp, stcb); + SCTP_TCB_UNLOCK(stcb); + } + SCTP_INP_RUNLOCK(inp); + } + SCTP_INP_INFO_RUNLOCK(); + CURVNET_RESTORE(); } - SCTP_INP_INFO_RUNLOCK(); + VNET_LIST_RUNLOCK_NOSLEEP(); } /* Modified: stable/8/sys/netinet/sctp_pcb.h ============================================================================== --- stable/8/sys/netinet/sctp_pcb.h Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_pcb.h Mon Dec 7 07:33:51 2009 (r200208) @@ -462,7 +462,7 @@ struct sctp_tcb { * goes with the base info. sctp_pcb.c has * the real definition. */ -extern struct sctp_base_info system_base_info; +VNET_DECLARE(struct sctp_base_info, system_base_info); #ifdef INET6 int SCTP6_ARE_ADDR_EQUAL(struct sockaddr_in6 *a, struct sockaddr_in6 *b); Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_structs.h Mon Dec 7 07:33:51 2009 (r200208) @@ -51,6 +51,7 @@ struct sctp_timer { void *ep; void *tcb; void *net; + void *vnet; /* for sanity checking */ void *self; Modified: stable/8/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/8/sys/netinet/sctp_sysctl.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_sysctl.c Mon Dec 7 07:33:51 2009 (r200208) @@ -930,7 +930,7 @@ SYSCTL_PROC(_net_inet_sctp, OID_AUTO, ou #endif SYSCTL_STRUCT(_net_inet_sctp, OID_AUTO, stats, CTLFLAG_RW, - &SCTP_BASE_STATS, sctpstat, + &SCTP_BASE_STATS_SYSCTL, sctpstat, "SCTP statistics (struct sctp_stat)"); SYSCTL_PROC(_net_inet_sctp, OID_AUTO, assoclist, CTLFLAG_RD, Modified: stable/8/sys/netinet/sctp_timer.c ============================================================================== --- stable/8/sys/netinet/sctp_timer.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_timer.c Mon Dec 7 07:33:51 2009 (r200208) @@ -1773,7 +1773,7 @@ sctp_pathmtu_timer(struct sctp_inpcb *in struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; /* KAME hack: embed scopeid */ - (void)sa6_embedscope(sin6, MODULE_GLOBAL(MOD_INET6, ip6_use_defzone)); + (void)sa6_embedscope(sin6, MODULE_GLOBAL(ip6_use_defzone)); } #endif Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctp_usrreq.c Mon Dec 7 07:33:51 2009 (r200208) @@ -544,7 +544,7 @@ sctp_attach(struct socket *so, int proto inp->sctp_flags &= ~SCTP_PCB_FLAGS_BOUND_V6; /* I'm not v6! */ ip_inp = &inp->ip_inp.inp; ip_inp->inp_vflag |= INP_IPV4; - ip_inp->inp_ip_ttl = MODULE_GLOBAL(MOD_INET, ip_defttl); + ip_inp->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); #ifdef IPSEC error = ipsec_init_policy(so, &ip_inp->inp_sp); #ifdef SCTP_LOG_CLOSING Modified: stable/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet/sctputil.c Mon Dec 7 07:33:51 2009 (r200208) @@ -1446,6 +1446,7 @@ sctp_timeout_handler(void *t) inp = (struct sctp_inpcb *)tmr->ep; stcb = (struct sctp_tcb *)tmr->tcb; net = (struct sctp_nets *)tmr->net; + CURVNET_SET((struct vnet *)tmr->vnet); did_output = 1; #ifdef SCTP_AUDITING_ENABLED @@ -1459,6 +1460,7 @@ sctp_timeout_handler(void *t) * SCTP_PRINTF("Stale SCTP timer fired (%p), ignoring...\n", * tmr); */ + CURVNET_RESTORE(); return; } tmr->stopped_from = 0xa001; @@ -1467,10 +1469,12 @@ sctp_timeout_handler(void *t) * SCTP_PRINTF("SCTP timer fired with invalid type: 0x%x\n", * tmr->type); */ + CURVNET_RESTORE(); return; } tmr->stopped_from = 0xa002; if ((tmr->type != SCTP_TIMER_TYPE_ADDR_WQ) && (inp == NULL)) { + CURVNET_RESTORE(); return; } /* if this is an iterator timeout, get the struct and clear inp */ @@ -1494,6 +1498,7 @@ sctp_timeout_handler(void *t) (tmr->type != SCTP_TIMER_TYPE_ASOCKILL)) ) { SCTP_INP_DECR_REF(inp); + CURVNET_RESTORE(); return; } } @@ -1505,6 +1510,7 @@ sctp_timeout_handler(void *t) if (inp) { SCTP_INP_DECR_REF(inp); } + CURVNET_RESTORE(); return; } } @@ -1517,6 +1523,7 @@ sctp_timeout_handler(void *t) if (stcb) { atomic_add_int(&stcb->asoc.refcnt, -1); } + CURVNET_RESTORE(); return; } tmr->stopped_from = 0xa006; @@ -1531,6 +1538,7 @@ sctp_timeout_handler(void *t) if (inp) { SCTP_INP_DECR_REF(inp); } + CURVNET_RESTORE(); return; } } @@ -1903,6 +1911,7 @@ out_decr: out_no_decr: SCTPDBG(SCTP_DEBUG_TIMER1, "Timer now complete (type %d)\n", type); + CURVNET_RESTORE(); } void @@ -2263,6 +2272,7 @@ sctp_timer_start(int t_type, struct sctp tmr->tcb = (void *)stcb; tmr->net = (void *)net; tmr->self = (void *)tmr; + tmr->vnet = (void *)curvnet; tmr->ticks = sctp_get_tick_count(); (void)SCTP_OS_TIMER_START(&tmr->timer, to_ticks, sctp_timeout_handler, tmr); return; Modified: stable/8/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/8/sys/netinet6/sctp6_usrreq.c Mon Dec 7 06:41:27 2009 (r200207) +++ stable/8/sys/netinet6/sctp6_usrreq.c Mon Dec 7 07:33:51 2009 (r200208) @@ -223,7 +223,7 @@ sctp_skip_csum: */ if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { /* XXX */ - MODULE_GLOBAL(MOD_IPSEC, ipsec6stat).in_polvio++; + MODULE_GLOBAL(ipsec6stat).in_polvio++; goto bad; } #endif /* IPSEC */ @@ -695,7 +695,7 @@ sctp6_attach(struct socket *so, int prot * socket as well, because the socket may be bound to an IPv6 * wildcard address, which may match an IPv4-mapped IPv6 address. */ - inp6->inp_ip_ttl = MODULE_GLOBAL(MOD_INET, ip_defttl); + inp6->inp_ip_ttl = MODULE_GLOBAL(ip_defttl); #endif /* * Hmm what about the IPSEC stuff that is missing here but in @@ -859,7 +859,7 @@ sctp6_send(struct socket *so, int flags, } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(MOD_INET6, ip6_v6only)) { + if (!MODULE_GLOBAL(ip6_v6only)) { struct sockaddr_in sin; /* convert v4-mapped into v4 addr and send */ @@ -990,7 +990,7 @@ sctp6_connect(struct socket *so, struct } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(MOD_INET6, ip6_v6only)) { + if (!MODULE_GLOBAL(ip6_v6only)) { /* convert v4-mapped into v4 addr */ in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); addr = (struct sockaddr *)&ss; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 07:41:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 364F5106566B; Mon, 7 Dec 2009 07:41:30 +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 24AF28FC08; Mon, 7 Dec 2009 07:41: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 nB77fU1S045411; Mon, 7 Dec 2009 07:41:30 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB77fUOh045409; Mon, 7 Dec 2009 07:41:30 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <200912070741.nB77fUOh045409@svn.freebsd.org> From: Hiroki Sato Date: Mon, 7 Dec 2009 07:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200209 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 07:41:30 -0000 Author: hrs Date: Mon Dec 7 07:41:29 2009 New Revision: 200209 URL: http://svn.freebsd.org/changeset/base/200209 Log: MFC: r197139 - Add afexists() to check if the specified address family exists on the system or not. r197697 - Add AF_IPX and AF_NATM to afexists(). Modified: stable/8/etc/network.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Mon Dec 7 07:33:51 2009 (r200208) +++ stable/8/etc/network.subr Mon Dec 7 07:41:29 2009 (r200209) @@ -276,6 +276,37 @@ wpaif() return 1 } +# afexists af +# Returns 0 if the address family is enabled in the kernel +# 1 otherwise. +afexists() +{ + local _af + _af=$1 + + case ${_af} in + inet) + ${SYSCTL_N} net.inet > /dev/null 2>&1 + ;; + inet6) + ${SYSCTL_N} net.inet6 > /dev/null 2>&1 + ;; + ipx) + ${SYSCTL_N} net.ipx > /dev/null 2>&1 + ;; + atm) + if [ -x /sbin/atmconfig ]; then + /sbin/atmconfig diag list > /dev/null 2>&1 + else + return 1 + fi + ;; + *) + err 1 "afexists(): Unsupported address family: $_af" + ;; + esac +} + # ipv6if if # Returns 0 if the interface should be configured for IPv6 and # 1 otherwise. From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 08:36:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB5D71065670; Mon, 7 Dec 2009 08:36:49 +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 A9B6B8FC22; Mon, 7 Dec 2009 08:36: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 nB78anX4046622; Mon, 7 Dec 2009 08:36:49 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB78anMY046620; Mon, 7 Dec 2009 08:36:49 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912070836.nB78anMY046620@svn.freebsd.org> From: Christian Brueffer Date: Mon, 7 Dec 2009 08:36:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200210 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 08:36:49 -0000 Author: brueffer Date: Mon Dec 7 08:36:49 2009 New Revision: 200210 URL: http://svn.freebsd.org/changeset/base/200210 Log: MFC: r197900 Improved one-line description of this module (taken from NOTES). Modified: stable/8/share/man/man4/lindev.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/lindev.4 ============================================================================== --- stable/8/share/man/man4/lindev.4 Mon Dec 7 07:41:29 2009 (r200209) +++ stable/8/share/man/man4/lindev.4 Mon Dec 7 08:36:49 2009 (r200210) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm lindev -.Nd the lindev module +.Nd Linux-specific pseudo devices support .Sh SYNOPSIS To compile this collection of linux-specific pseudo devices into the kernel, place the following line in your kernel configuration file: From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 08:38:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8D111065670; Mon, 7 Dec 2009 08:38:44 +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 C77468FC16; Mon, 7 Dec 2009 08:38: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 nB78ciUU046700; Mon, 7 Dec 2009 08:38:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB78ciPm046698; Mon, 7 Dec 2009 08:38:44 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200912070838.nB78ciPm046698@svn.freebsd.org> From: Christian Brueffer Date: Mon, 7 Dec 2009 08:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200211 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 08:38:45 -0000 Author: brueffer Date: Mon Dec 7 08:38:44 2009 New Revision: 200211 URL: http://svn.freebsd.org/changeset/base/200211 Log: MFC: r200019 Fix the dprintf() prototype. Modified: stable/8/lib/libc/stdio/printf.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/stdio/printf.3 ============================================================================== --- stable/8/lib/libc/stdio/printf.3 Mon Dec 7 08:36:49 2009 (r200210) +++ stable/8/lib/libc/stdio/printf.3 Mon Dec 7 08:38:44 2009 (r200211) @@ -32,7 +32,7 @@ .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 3, 2009 +.Dd December 2, 2009 .Dt PRINTF 3 .Os .Sh NAME @@ -55,7 +55,7 @@ .Ft int .Fn asprintf "char **ret" "const char *format" ... .Ft int -.Fn dprintf "int" "const char * restrict format" ... +.Fn dprintf "int fd" "const char * restrict format" ... .In stdarg.h .Ft int .Fn vprintf "const char * restrict format" "va_list ap" From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 09:07:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04431106566B; Mon, 7 Dec 2009 09:07:38 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id BA1268FC08; Mon, 7 Dec 2009 09:07:37 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 804A6730DA; Mon, 7 Dec 2009 09:59:27 +0100 (CET) Date: Mon, 7 Dec 2009 09:59:27 +0100 From: Luigi Rizzo To: Ed Schouten Message-ID: <20091207085927.GC57764@onelab2.iet.unipi.it> References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091207055752.GD64905@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 09:07:38 -0000 On Mon, Dec 07, 2009 at 06:57:52AM +0100, Ed Schouten wrote: > * Hajimu UMEMOTO wrote: > > I saw following message during boot: > > > > Dec 7 13:54:12 yoshino kernel: Shared object "libulog.so.0" not found, required > > by "date" > > > > Now, date(1) links libulog.so.0. The date(1) is in /bin, but > > libulog.so.0 is in /usr/lib. The libulog must be installed into /lib. Any chance to put libulog and other 'extension' libraries together (I would say into libc but perhaps that's too much). There are several apps which only relied on libc that now require -lulog, -ljail, -lsbuf, -lbsdxml (libexpat) They are all minuscule, 1-2 files each, but make life harder for developers to track the dependencies. Also, things like lsbuf are really useful in general, so having that widely available would be a good incentive for people to use it instead of rolling their own 'dynamic string manipulation' code again and again http://info.iet.unipi.it/~luigi/FreeBSD/#dynstring cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 09:41:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C5C1065672; Mon, 7 Dec 2009 09:41:13 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id C32418FC08; Mon, 7 Dec 2009 09:41:12 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id CA93C6D41B; Mon, 7 Dec 2009 09:41:11 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 6E0CB844E9; Mon, 7 Dec 2009 10:41:11 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Luigi Rizzo References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 10:41:11 +0100 In-Reply-To: <20091207085927.GC57764@onelab2.iet.unipi.it> (Luigi Rizzo's message of "Mon, 7 Dec 2009 09:59:27 +0100") Message-ID: <86iqcjt93c.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 09:41:13 -0000 Luigi Rizzo writes: > Also, things like lsbuf are really useful in general, so having > that widely available would be a good incentive for people to > use it instead of rolling their own 'dynamic string manipulation' > code again and again Userland libsbuf is an abomination. I wish I had protested more strenuously when the CAM people insisted on using the same code in userland as in the kernel; we actually lost functionality in the kernel version as a result. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 10:45:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7221065784; Mon, 7 Dec 2009 10:45:26 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 75EE48FC18; Mon, 7 Dec 2009 10:45:25 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id C1E6D73106; Mon, 7 Dec 2009 11:53:43 +0100 (CET) Date: Mon, 7 Dec 2009 11:53:43 +0100 From: Luigi Rizzo To: Dag-Erling Sm??rgrav Message-ID: <20091207105343.GA62012@onelab2.iet.unipi.it> References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86iqcjt93c.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 10:45:26 -0000 On Mon, Dec 07, 2009 at 10:41:11AM +0100, Dag-Erling Sm??rgrav wrote: > Luigi Rizzo writes: > > Also, things like lsbuf are really useful in general, so having > > that widely available would be a good incentive for people to > > use it instead of rolling their own 'dynamic string manipulation' > > code again and again > > Userland libsbuf is an abomination. I wish I had protested more > strenuously when the CAM people insisted on using the same code in > userland as in the kernel; we actually lost functionality in the kernel > version as a result. What do you mean exactly ? In any case i don't care whether we use the same or different code in userland and kernel, but i do care that we converge on one library to handle dynamic strings in a safe way, and promote the use of that library for our userland base code. One way to promote this is to put the code in libc so even lazy people won't need to remember to pass linker flags when using the library. Otherwise lots of people are going to use unsafe or non-reentrant variants based on sprintf/snprintf , even in the libraries. Just grep -r sprintf or snprintf in src/lib and you'll see how bad the situation is. libsbuf is as good as anything else with the same features. cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 10:55:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1E90106566C; Mon, 7 Dec 2009 10:55:16 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 8EEA38FC13; Mon, 7 Dec 2009 10:55:16 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 20EE37EA13; Mon, 7 Dec 2009 10:55:15 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id nB7Atct0042027; Mon, 7 Dec 2009 10:55:38 GMT (envelope-from phk@critter.freebsd.dk) To: Luigi Rizzo From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 07 Dec 2009 11:53:43 +0100." <20091207105343.GA62012@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 10:55:38 +0000 Message-ID: <42026.1260183338@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 10:55:16 -0000 In message <20091207105343.GA62012@onelab2.iet.unipi.it>, Luigi Rizzo writes: >One way to promote this is to put the code in libc so even lazy >people won't need to remember to pass linker flags when using the library. I don't think sbuf's belong in libc, unless we can persude POSIX to adopt them. Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 10:56:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8316E1065676; Mon, 7 Dec 2009 10:56:19 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 402B28FC18; Mon, 7 Dec 2009 10:56:19 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 6A1726D41B; Mon, 7 Dec 2009 10:56:18 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 3C8D3844E9; Mon, 7 Dec 2009 11:56:18 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Luigi Rizzo References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 11:56:18 +0100 In-Reply-To: <20091207105343.GA62012@onelab2.iet.unipi.it> (Luigi Rizzo's message of "Mon, 7 Dec 2009 11:53:43 +0100") Message-ID: <86ein7t5m5.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 10:56:19 -0000 Luigi Rizzo writes: > What do you mean exactly ? When libsbuf was ported to userland, sbuf_printf() was pessimized due to the limitations of libc's printf(). This makes certain parts of pseudofs extremely inefficient: for instance, if you read from a /proc/whatever that's backed by an sbuf, it has to generate the entire file even if you only asked for a small chunk at a large offset. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 11:10:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 683B31065693; Mon, 7 Dec 2009 11:10:19 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 0AFAB8FC29; Mon, 7 Dec 2009 11:10:19 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 745361CD84; Mon, 7 Dec 2009 12:10:18 +0100 (CET) Date: Mon, 7 Dec 2009 12:10:18 +0100 From: Ed Schouten To: Luigi Rizzo Message-ID: <20091207111018.GF64905@hoeg.nl> References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YxcAuBb71PAz0ECB" Content-Disposition: inline In-Reply-To: <20091207085927.GC57764@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r200157 - head/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 11:10:19 -0000 --YxcAuBb71PAz0ECB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Luigi, * Luigi Rizzo wrote: > Any chance to put libulog and other 'extension' libraries together > (I would say into libc but perhaps that's too much). Even though I agree having all these small libraries is not the way to=20 go, I really want to have the ulog functions in a separate library.=20 libulog is meant to be a migration tool towards a real utmpx=20 implementation. It basically implements the subset of utmpx we can support, but with a ulog_-prefix. I don't want to advertise it as being utmpx itself, this would only cause autofoo-based ports to break. By the time we gain proper utmpx support, I want to be able to phase out libulog, or at least move its non-redundant functionality into libutil. I guess libulog will be history by the time we release FreeBSD 10.0. --=20 Ed Schouten WWW: http://80386.nl/ --YxcAuBb71PAz0ECB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksc4poACgkQ52SDGA2eCwUtIwCfSTtxIBcsQelYajInIavebiO1 SGkAnRLPnzgTCVyXGkQ4f63B8BcB4nsi =ABE/ -----END PGP SIGNATURE----- --YxcAuBb71PAz0ECB-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 11:27:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F8201065670; Mon, 7 Dec 2009 11:27:29 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.211.194]) by mx1.freebsd.org (Postfix) with ESMTP id 2139E8FC0A; Mon, 7 Dec 2009 11:27:28 +0000 (UTC) Received: by ywh32 with SMTP id 32so4532771ywh.14 for ; Mon, 07 Dec 2009 03:27:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=2VaDQgvh51pefpO5lhrhYjrA00dPPSNbrvCNEZLWDJo=; b=Ek1kmE9BtoXOdlhRdHj6+aOy4C5JdQMQzSrCuAHz7ZFceSbgjel3O4zC6tw+xhi4R9 aA0I9HcfYJbCuCx+58FCtKd+bucczaBI0NlbZrl3FWbXocO/vEjrBsM3jDaqNmYmgL5G za/ziFdyTObnbW91o4iPJsZLvFq/D7XXTY7ac= 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=Jw9ZQvJOYj8qy7XSQ9vslXPqRDBqXJJRa3fmdudhwG9IPhyjqwOcnsugd/k9JWlxZv plA2gHc9yGkiI4NNEHoH32/ckVoPGFtAwZF20PedhdLw7pcaTaPm9OQqL0Gh6XaM5hAu A3NR/rFZ4Ia2LjZ5O3wv8myxJo96LH/ZhPZ4U= MIME-Version: 1.0 Sender: ermal.luci@gmail.com Received: by 10.150.75.6 with SMTP id x6mr11015469yba.283.1260183725081; Mon, 07 Dec 2009 03:02:05 -0800 (PST) In-Reply-To: <200912070531.17758.max@love2party.net> References: <200912061804.nB6I4R38027652@svn.freebsd.org> <200912070531.17758.max@love2party.net> From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Date: Mon, 7 Dec 2009 12:01:45 +0100 X-Google-Sender-Auth: c3a8847b13729a5a Message-ID: <9a542da30912070301x4ada4d0ct67ec8553a477aea2@mail.gmail.com> To: Max Laier Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 11:27:29 -0000 On Mon, Dec 7, 2009 at 5:31 AM, Max Laier wrote: > On Sunday 06 December 2009 19:04:27 Luigi Rizzo wrote: > > Author: luigi > > Date: Sun Dec 6 18:04:26 2009 > > New Revision: 200183 > > URL: http://svn.freebsd.org/changeset/base/200183 > > > > Log: > > restore setting of sin_len (was removed in 1.146 last february) as > > it seems that now it is necessary for 'forward' to work outside lo0. > > The bug (and fix) was reported on 8.0. This patch probably applies > > to RELENG_7 as well. > > It seems that 'pf' has a similar bug. > > > > Submitted by: Lytochkin Boris > > Do you have a reference for me? > I followed the thread but route-to sets the sin_len see this: http://fxr.watson.org/fxr/source/contrib/pf/net/pf.c?v=FREEBSD8#L6179 > > > MFC after: 3 days > > > > Modified: > > head/sbin/ipfw/ipfw2.c > > > > Modified: head/sbin/ipfw/ipfw2.c > > > =========================================================================== > > === --- head/sbin/ipfw/ipfw2.c Sun Dec 6 17:26:43 2009 > (r200182) > > +++ head/sbin/ipfw/ipfw2.c Sun Dec 6 18:04:26 2009 (r200183) > > @@ -2740,9 +2740,11 @@ chkarg: > > > > /* > > * In the kernel we assume AF_INET and use only > > - * sin_port and sin_addr. > > + * sin_port and sin_addr. Remember to set sin_len as > > + * the routing code seems to use it too. > > */ > > p->sa.sin_family = AF_INET; > > + p->sa.sin_len = sizeof(struct sockaddr_in); > > p->sa.sin_port = 0; > > /* > > * locate the address-port separator (':' or ',') > > > > > > !DSPAM:4b1bf5b9894172410716004! > > > -- Ermal From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:09:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F42F106568B; Mon, 7 Dec 2009 12:09:48 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 95F948FC23; Mon, 7 Dec 2009 12:09:44 +0000 (UTC) Received: by ewy3 with SMTP id 3so9619ewy.33 for ; Mon, 07 Dec 2009 04:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=i/U2PpJXBNpPVX3VRz1ofA+CeZDpNmWCc9T8pSLiE2Q=; b=nFriVEeQjFKqRcT3VBas6mAJFMQ7adacP+tT5mOQRt54QaDH7ymZH+QUVzB6vVNpgJ Si3emdsiJSh9VNdDvpk7SAPkvd7cYZD/MBiIPOdnA3GodlhncVDNuzp/DrT6hrzMDvh8 UbRX9tYptcaMyMBfEMf+QowKeffe2+y+W6yW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=f7VcLck3d54tcR/QGJN9TpTEKasMd8kR1Mcv3Z5W6OUB3BebdA3vekRmiYKoOK6Ojo D49zGtLWDThpD21Wt1WEFM8BloSpa8SDH8NpgVS4Ek0GO3gZXh+t2PL6j8d1u8Xu4CCL 0xQnv1AsO3Zf4Knp1JtBRoS9efe4BEl6aKG24= MIME-Version: 1.0 Received: by 10.216.87.83 with SMTP id x61mr2337683wee.7.1260187779167; Mon, 07 Dec 2009 04:09:39 -0800 (PST) In-Reply-To: <200912021634.nB2GYLSq031398@svn.freebsd.org> References: <200912021634.nB2GYLSq031398@svn.freebsd.org> From: Renato Botelho Date: Mon, 7 Dec 2009 10:09:19 -0200 Message-ID: <747dc8f30912070409u2c870e06p7c546c878311ed75@mail.gmail.com> To: Konstantin Belousov 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: r200038 - in head: contrib/gcc/config lib/csu/amd64 lib/csu/arm lib/csu/i386-elf lib/csu/ia64 lib/csu/mips lib/csu/powerpc lib/csu/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:09:48 -0000 On Wed, Dec 2, 2009 at 2:34 PM, Konstantin Belousov wrote= : > Author: kib > Date: Wed Dec =A02 16:34:20 2009 > New Revision: 200038 > URL: http://svn.freebsd.org/changeset/base/200038 > > Log: > =A0Properly support -fPIE by linking PIE binaries with specially-built > =A0Scrt1.o instead of crt1.o, since the later is built as non-PIC. > > =A0Separate i386-elf crt1.c into the pure assembler part and C code, > =A0supplying all data extracted by assembler stub as explicit parameters = [1]. > =A0Hide and localize _start1 symbol used as an interface between asm and > =A0C code. I've got this: root@botelhor:/usr/src/lib/csu/i386-elf# make cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crti.S cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crtn.S cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -DGCRT -c -o gcrt1_c.o /usr/src/lib/csu/i386-elf/crt1_c.c cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crt1_s.S ld -o gcrt1.o -r crt1_s.o gcrt1_c.o cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crt1_c.c make: don't know how to make /usr/src/lib/csu/i386-elf/crt1.c. Stop [1] 36086 exit 2 make --=20 Renato Botelho From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:14:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F8B106566B; Mon, 7 Dec 2009 12:14:38 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 452358FC18; Mon, 7 Dec 2009 12:14:38 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id BB50D730DA; Mon, 7 Dec 2009 13:22:56 +0100 (CET) Date: Mon, 7 Dec 2009 13:22:56 +0100 From: Luigi Rizzo To: Poul-Henning Kamp Message-ID: <20091207122256.GC64431@onelab2.iet.unipi.it> References: <20091207105343.GA62012@onelab2.iet.unipi.it> <42026.1260183338@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42026.1260183338@critter.freebsd.dk> User-Agent: Mutt/1.4.2.3i Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:14:38 -0000 On Mon, Dec 07, 2009 at 10:55:38AM +0000, Poul-Henning Kamp wrote: > In message <20091207105343.GA62012@onelab2.iet.unipi.it>, Luigi Rizzo writes: > > >One way to promote this is to put the code in libc so even lazy > >people won't need to remember to pass linker flags when using the library. > > I don't think sbuf's belong in libc, unless we can persude POSIX to > adopt them. right, then some other commonly used but not locked-by-standards place. libutil? libbsdstuffnotstandardizedbyposix ? Again my point (perhaps lost in the initial thread) was that the number of one-file libraries used in our base code is increasing: libsbuf, libjail, libbsdxml... to me, individual files are library members, there is no need to dedicate an entire library to a library member cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:19:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EC391065672; Mon, 7 Dec 2009 12:19:33 +0000 (UTC) (envelope-from rbgarga@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 64B4D8FC12; Mon, 7 Dec 2009 12:19:32 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so1119856eye.9 for ; Mon, 07 Dec 2009 04:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=IVpX2tSoHJNksbSzfjyxEwQiTY06vpWL84fKOjKGxWM=; b=M7GrzmrL6XeDppJR1msTI8T7A7n4hq8zv88FwlwcjqxZePsBVBW4sQFjqC5nJfSB67 sUlpXGxlEVg6exaSVSsKaKr4MShLz97Si7vsjRs9AyxDLbzfuSNRKNLQxsnPn/ZghRuC QZ9ygBQSOWZNQv82pRmywnFE6qooESMN0hojs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=pAL4ASJNQstPrjJ99YBHVxUhn2S5qhYYBznnQ8HLEUE4oQShROIDFFYM7UvmTJtx7i MaedCIseZyClL2eE5jAP2QR3oMlwhib/zUDmKisjQUe2zVPPHfjFpCdw7PVlBKZLOcAK 5rNxa1Yl+8ViE19YYhmZ071Ssgtf6Jfon1Jsk= MIME-Version: 1.0 Received: by 10.216.87.5 with SMTP id x5mr2338947wee.75.1260188371096; Mon, 07 Dec 2009 04:19:31 -0800 (PST) In-Reply-To: <747dc8f30912070409u2c870e06p7c546c878311ed75@mail.gmail.com> References: <200912021634.nB2GYLSq031398@svn.freebsd.org> <747dc8f30912070409u2c870e06p7c546c878311ed75@mail.gmail.com> From: Renato Botelho Date: Mon, 7 Dec 2009 10:19:11 -0200 Message-ID: <747dc8f30912070419g51db0a7i6cf1990b501985dc@mail.gmail.com> To: Konstantin Belousov 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: r200038 - in head: contrib/gcc/config lib/csu/amd64 lib/csu/arm lib/csu/i386-elf lib/csu/ia64 lib/csu/mips lib/csu/powerpc lib/csu/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:19:33 -0000 On Mon, Dec 7, 2009 at 10:09 AM, Renato Botelho wrote: > On Wed, Dec 2, 2009 at 2:34 PM, Konstantin Belousov wro= te: >> Author: kib >> Date: Wed Dec =A02 16:34:20 2009 >> New Revision: 200038 >> URL: http://svn.freebsd.org/changeset/base/200038 >> >> Log: >> =A0Properly support -fPIE by linking PIE binaries with specially-built >> =A0Scrt1.o instead of crt1.o, since the later is built as non-PIC. >> >> =A0Separate i386-elf crt1.c into the pure assembler part and C code, >> =A0supplying all data extracted by assembler stub as explicit parameters= [1]. >> =A0Hide and localize _start1 symbol used as an interface between asm and >> =A0C code. > > I've got this: > > root@botelhor:/usr/src/lib/csu/i386-elf# make > cc -O2 -pipe =A0-I/usr/src/lib/csu/i386-elf/../common > -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c > /usr/src/lib/csu/i386-elf/crti.S > cc -O2 -pipe =A0-I/usr/src/lib/csu/i386-elf/../common > -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c > /usr/src/lib/csu/i386-elf/crtn.S > cc -O2 -pipe =A0-I/usr/src/lib/csu/i386-elf/../common > -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wno-pointer-sign -DGCRT -c -o > gcrt1_c.o /usr/src/lib/csu/i386-elf/crt1_c.c > cc -O2 -pipe =A0-I/usr/src/lib/csu/i386-elf/../common > -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c > /usr/src/lib/csu/i386-elf/crt1_s.S > ld =A0-o gcrt1.o -r crt1_s.o gcrt1_c.o > cc -O2 -pipe =A0-I/usr/src/lib/csu/i386-elf/../common > -I/usr/src/lib/csu/i386-elf/../../libc/include -std=3Dgnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c > /usr/src/lib/csu/i386-elf/crt1_c.c > make: don't know how to make /usr/src/lib/csu/i386-elf/crt1.c. Stop > [1] =A0 =A036086 exit 2 =A0 =A0 make nevermind, rm -rf /usr/obj/usr/src/lib/csu fixed the problem. --=20 Renato Botelho From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:28:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E3221065697; Mon, 7 Dec 2009 12:28:06 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0DFAB8FC1F; Mon, 7 Dec 2009 12:28:05 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0521C6D41C; Mon, 7 Dec 2009 12:28:04 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D3A92844E9; Mon, 7 Dec 2009 13:28:04 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Poul-Henning Kamp" References: <42026.1260183338@critter.freebsd.dk> Date: Mon, 07 Dec 2009 13:28:04 +0100 In-Reply-To: <42026.1260183338@critter.freebsd.dk> (Poul-Henning Kamp's message of "Mon, 07 Dec 2009 10:55:38 +0000") Message-ID: <861vj7t1d7.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Luigi Rizzo Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:28:06 -0000 "Poul-Henning Kamp" writes: > Luigi Rizzo writes: > > One way to promote this is to put the code in libc so even lazy > > people won't need to remember to pass linker flags when using the libra= ry. > I don't think sbuf's belong in libc, unless we can persude POSIX to > adopt them. While I agree with you that we shouldn't merge libsbuf into libc, I should point out that we have tons of stuff in libc (e.g. err() and friends) that isn't in POSIX and probably never will be. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:36:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBF64106568F; Mon, 7 Dec 2009 12:36:50 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id AD3628FC18; Mon, 7 Dec 2009 12:36:50 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 7B6B97E99D; Mon, 7 Dec 2009 12:36:49 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id nB7CbDZE042551; Mon, 7 Dec 2009 12:37:13 GMT (envelope-from phk@critter.freebsd.dk) To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 07 Dec 2009 13:28:04 +0100." <861vj7t1d7.fsf@ds4.des.no> Date: Mon, 07 Dec 2009 12:37:13 +0000 Message-ID: <42550.1260189433@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Luigi Rizzo Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:36:51 -0000 In message <861vj7t1d7.fsf@ds4.des.no>, =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= writes: >"Poul-Henning Kamp" writes: >While I agree with you that we shouldn't merge libsbuf into libc, I >should point out that we have tons of stuff in libc (e.g. err() and >friends) that isn't in POSIX and probably never will be. I know. For a lot of the stuff, it reflects badly on POSIX (and/or ISO-C) that it isn't. Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:40:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A782F1065672; Mon, 7 Dec 2009 12:40:00 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 661198FC08; Mon, 7 Dec 2009 12:40:00 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 3C0617EA21; Mon, 7 Dec 2009 12:39:59 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id nB7CeN0H042579; Mon, 7 Dec 2009 12:40:23 GMT (envelope-from phk@critter.freebsd.dk) To: Luigi Rizzo From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 07 Dec 2009 13:22:56 +0100." <20091207122256.GC64431@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 12:40:23 +0000 Message-ID: <42578.1260189623@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:40:00 -0000 In message <20091207122256.GC64431@onelab2.iet.unipi.it>, Luigi Rizzo writes: >right, then some other commonly used but not locked-by-standards place. >libutil? libbsdstuffnotstandardizedbyposix ? I would be very happy to see a libposux, even more so, if the content were standardized across Linux and FreeBSD. >Again my point (perhaps lost in the initial thread) was that the number >of one-file libraries used in our base code is increasing: > libsbuf, libjail, libbsdxml... >to me, individual files are library members, there is no need to >dedicate an entire library to a library member Remember that shared libraries, you load all or nothing. With old fashioned .a libs, you cherrypicked the bits you needed. It can be argued that we should just dump everything in libc, but first, that would impair portability from FreeBSD, and second, it would be just plain sloppy... Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:44:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A2A10656A4; Mon, 7 Dec 2009 12:44:10 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 829498FC22; Mon, 7 Dec 2009 12:44:10 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id B8EF61CD84; Mon, 7 Dec 2009 13:44:09 +0100 (CET) Date: Mon, 7 Dec 2009 13:44:09 +0100 From: Ed Schouten To: Poul-Henning Kamp Message-ID: <20091207124409.GI64905@hoeg.nl> References: <20091207122256.GC64431@onelab2.iet.unipi.it> <42578.1260189623@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2yBc15QyH7gGExp9" Content-Disposition: inline In-Reply-To: <42578.1260189623@critter.freebsd.dk> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav , Luigi Rizzo Subject: Re: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:44:11 -0000 --2yBc15QyH7gGExp9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Poul-Henning Kamp wrote: > It can be argued that we should just dump everything in libc, but > first, that would impair portability from FreeBSD, and second, it > would be just plain sloppy... And would more likely cause namespace issues. Functions like login(3) and logout(3) really fill up the namespace. --=20 Ed Schouten WWW: http://80386.nl/ --2yBc15QyH7gGExp9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksc+JkACgkQ52SDGA2eCwW5QwCeORVyxHM+1G7F8VedfGsQ/KjS OvUAn2/y7TJBC2ZB6t4TS5sLR7/TLwRr =8Svc -----END PGP SIGNATURE----- --2yBc15QyH7gGExp9-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:46:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691CB106568F; Mon, 7 Dec 2009 12:46:18 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 297D78FC08; Mon, 7 Dec 2009 12:46:18 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id D6CC9730DA; Mon, 7 Dec 2009 13:54:36 +0100 (CET) Date: Mon, 7 Dec 2009 13:54:36 +0100 From: Luigi Rizzo To: Poul-Henning Kamp Message-ID: <20091207125436.GA71075@onelab2.iet.unipi.it> References: <20091207122256.GC64431@onelab2.iet.unipi.it> <42578.1260189623@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42578.1260189623@critter.freebsd.dk> User-Agent: Mutt/1.4.2.3i Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:46:18 -0000 On Mon, Dec 07, 2009 at 12:40:23PM +0000, Poul-Henning Kamp wrote: > In message <20091207122256.GC64431@onelab2.iet.unipi.it>, Luigi Rizzo writes: > > >right, then some other commonly used but not locked-by-standards place. > >libutil? libbsdstuffnotstandardizedbyposix ? > > I would be very happy to see a libposux, even more so, if the content > were standardized across Linux and FreeBSD. :) if we call it libyousux each party (posix, linux, bsd, ...) could pretend that the blame is on the others! From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:55:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AE661065672; Mon, 7 Dec 2009 12:55:00 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 48CDF8FC0C; Mon, 7 Dec 2009 12:55:00 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id DDCA37E98F; Mon, 7 Dec 2009 12:54:58 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id nB7CtMjL042648; Mon, 7 Dec 2009 12:55:22 GMT (envelope-from phk@critter.freebsd.dk) To: Luigi Rizzo From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 07 Dec 2009 13:54:36 +0100." <20091207125436.GA71075@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 12:55:22 +0000 Message-ID: <42647.1260190522@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Ed Schouten , src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Dag-Erling Sm??rgrav Subject: Re: the need for safe dynamic string libraries (was Re: svn commit: r200157 - head/bin/date) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:55:00 -0000 In message <20091207125436.GA71075@onelab2.iet.unipi.it>, Luigi Rizzo writes: >On Mon, Dec 07, 2009 at 12:40:23PM +0000, Poul-Henning Kamp wrote: >> I would be very happy to see a libposux, even more so, if the content >> were standardized across Linux and FreeBSD. >:) >if we call it libyousux each party (posix, linux, bsd, ...) >could pretend that the blame is on the others! The suckage is rightly POSIX', so libposux conveys the correct meaning. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 12:56:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5127106568D; Mon, 7 Dec 2009 12:56:14 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 94A0E8FC1A; Mon, 7 Dec 2009 12:56:14 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 51D4073106; Mon, 7 Dec 2009 14:04:33 +0100 (CET) Date: Mon, 7 Dec 2009 14:04:33 +0100 From: Luigi Rizzo To: Dag-Erling Sm??rgrav Message-ID: <20091207130433.GA71902@onelab2.iet.unipi.it> References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> <86ein7t5m5.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ein7t5m5.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 12:56:14 -0000 On Mon, Dec 07, 2009 at 11:56:18AM +0100, Dag-Erling Sm??rgrav wrote: > Luigi Rizzo writes: > > What do you mean exactly ? > > When libsbuf was ported to userland, sbuf_printf() was pessimized due to > the limitations of libc's printf(). This makes certain parts of but, isn't this an implementation detail ? What prevents the same API to have two different implementation, one for kernel, one for userland ? cheers luigi > pseudofs extremely inefficient: for instance, if you read from a > /proc/whatever that's backed by an sbuf, it has to generate the entire > file even if you only asked for a small chunk at a large offset. > > DES > -- > Dag-Erling Sm??rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 13:11:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790C4106568B; Mon, 7 Dec 2009 13:11:46 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 3524E8FC08; Mon, 7 Dec 2009 13:11:46 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 341E16D41B; Mon, 7 Dec 2009 13:11:45 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D0340844F2; Mon, 7 Dec 2009 14:11:44 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Luigi Rizzo References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> <86ein7t5m5.fsf@ds4.des.no> <20091207130433.GA71902@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 14:11:44 +0100 In-Reply-To: <20091207130433.GA71902@onelab2.iet.unipi.it> (Luigi Rizzo's message of "Mon, 7 Dec 2009 14:04:33 +0100") Message-ID: <86skbnrkrz.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 13:11:46 -0000 Luigi Rizzo writes: > "Dag-Erling Sm=C3=B8rgrav" writes: > > When libsbuf was ported to userland, sbuf_printf() was pessimized > > due to the limitations of libc's printf(). > but, isn't this an implementation detail ? What prevents the same > API to have two different implementation, one for kernel, one for userlan= d ? Maybe I wasn't entirely clear: functionality was removed from libsbuf because it could not be implemented in userland, because our printf(3) is badly implemented. To restore that functionality, we would have to either fork libsbuf or fix printf(3). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 13:22:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E60F01065693; Mon, 7 Dec 2009 13:22:58 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id A4FAF8FC20; Mon, 7 Dec 2009 13:22:58 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 3CF7273106; Mon, 7 Dec 2009 14:31:17 +0100 (CET) Date: Mon, 7 Dec 2009 14:31:17 +0100 From: Luigi Rizzo To: Dag-Erling Sm??rgrav Message-ID: <20091207133117.GA73597@onelab2.iet.unipi.it> References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> <86ein7t5m5.fsf@ds4.des.no> <20091207130433.GA71902@onelab2.iet.unipi.it> <86skbnrkrz.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86skbnrkrz.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 13:22:59 -0000 On Mon, Dec 07, 2009 at 02:11:44PM +0100, Dag-Erling Sm??rgrav wrote: > Luigi Rizzo writes: > > "Dag-Erling Sm??rgrav" writes: > > > When libsbuf was ported to userland, sbuf_printf() was pessimized > > > due to the limitations of libc's printf(). > > but, isn't this an implementation detail ? What prevents the same > > API to have two different implementation, one for kernel, one for userland ? > > Maybe I wasn't entirely clear: functionality was removed from libsbuf > because it could not be implemented in userland, because our printf(3) > is badly implemented. To restore that functionality, we would have to > either fork libsbuf or fix printf(3). i think i understood correctly. But my point is-- does the functionality that was removed rely on a different API, or we can keep the same API and have two different implementation of the hopefully few things that change between kernel and userland int sbuf_printf(struct sbuf *s, const char *fmt, ...) { // common code #ifdef _KERNEL ... the wonderful bits #else // crippled due to printf limitations #endif // more common code This does not seem too problematic... From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 13:38:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60B73106566B; Mon, 7 Dec 2009 13:38:11 +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 500F58FC14; Mon, 7 Dec 2009 13:38: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 nB7DcBQi055383; Mon, 7 Dec 2009 13:38:11 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7DcB3l055382; Mon, 7 Dec 2009 13:38:11 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912071338.nB7DcB3l055382@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 7 Dec 2009 13:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200212 - stable/7/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 13:38:11 -0000 Author: jh Date: Mon Dec 7 13:38:10 2009 New Revision: 200212 URL: http://svn.freebsd.org/changeset/base/200212 Log: MFC r197525: Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object. This completes the fix from r185586. Approved by: trasz (mentor) Modified: stable/7/sys/nfsserver/nfs_serv.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/7/sys/nfsserver/nfs_serv.c Mon Dec 7 08:38:44 2009 (r200211) +++ stable/7/sys/nfsserver/nfs_serv.c Mon Dec 7 13:38:10 2009 (r200212) @@ -1743,7 +1743,7 @@ nfsrv_create(struct nfsrv_descript *nfsd tl = nfsm_dissect_nonblock(u_int32_t *, NFSX_V3CREATEVERF); /* Unique bytes, endianness is not important. */ - cverf.tv_sec = tl[0]; + cverf.tv_sec = (int32_t)tl[0]; cverf.tv_nsec = tl[1]; exclusive_flag = 1; break; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 14:33:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505B91065672; Mon, 7 Dec 2009 14:33:39 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9858FC14; Mon, 7 Dec 2009 14:33:38 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0D2EF6D41B; Mon, 7 Dec 2009 14:33:38 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id D51B4844F2; Mon, 7 Dec 2009 15:33:37 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Luigi Rizzo References: <200912052009.nB5K9okL098577@svn.freebsd.org> <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> <86ein7t5m5.fsf@ds4.des.no> <20091207130433.GA71902@onelab2.iet.unipi.it> <86skbnrkrz.fsf@ds4.des.no> <20091207133117.GA73597@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 15:33:37 +0100 Message-ID: <86ocmavoou.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 14:33:39 -0000 Luigi Rizzo writes: > But my point is-- does the functionality that was removed rely > on a different API, or we can keep the same API and have two > different implementation of the hopefully few things that change > between kernel and userland Restoring sbuf_printf() to what it was would not change the API, but the semantics would be different in certain cases. The API would need to be extended to allow pseudofs to take full advantage of the changed semantics. (it is possible that the same functionality could be implemented in userland using funopen(3); such a solution would have all of the disadvantages of the current code except for the performance penalty, but none of its advantages) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 14:46:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C8E106566B; Mon, 7 Dec 2009 14:46:34 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id A09AE8FC24; Mon, 7 Dec 2009 14:46:34 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 1879B730DA; Mon, 7 Dec 2009 15:54:52 +0100 (CET) Date: Mon, 7 Dec 2009 15:54:52 +0100 From: Luigi Rizzo To: Dag-Erling Sm??rgrav Message-ID: <20091207145452.GA78854@onelab2.iet.unipi.it> References: <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> <86ein7t5m5.fsf@ds4.des.no> <20091207130433.GA71902@onelab2.iet.unipi.it> <86skbnrkrz.fsf@ds4.des.no> <20091207133117.GA73597@onelab2.iet.unipi.it> <86ocmavoou.fsf@ds4.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ocmavoou.fsf@ds4.des.no> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 14:46:35 -0000 On Mon, Dec 07, 2009 at 03:33:37PM +0100, Dag-Erling Sm??rgrav wrote: > Luigi Rizzo writes: > > But my point is-- does the functionality that was removed rely > > on a different API, or we can keep the same API and have two > > different implementation of the hopefully few things that change > > between kernel and userland > > Restoring sbuf_printf() to what it was would not change the API, but the > semantics would be different in certain cases. doesn't seem a big deal, we already have diffent behaviour in kernel vs userland for certain functions (e.g. printf() itself, if nothing else the format specifiers are different in some cases). From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 14:47:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09CAE10656B1; Mon, 7 Dec 2009 14:47:46 +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 45CF08FC15; Mon, 7 Dec 2009 14:47: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 nB7ElkZM056902; Mon, 7 Dec 2009 14:47:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7ElkJR056899; Mon, 7 Dec 2009 14:47:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912071447.nB7ElkJR056899@svn.freebsd.org> From: Ed Schouten Date: Mon, 7 Dec 2009 14:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200213 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 14:47:52 -0000 Author: ed Date: Mon Dec 7 14:47:45 2009 New Revision: 200213 URL: http://svn.freebsd.org/changeset/base/200213 Log: Gavin can has SVN access. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon Dec 7 13:38:10 2009 (r200212) +++ svnadmin/conf/access Mon Dec 7 14:47:45 2009 (r200213) @@ -77,6 +77,7 @@ fjoe flz gad gallatin +gavin ghelmer gibbs glebius Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Dec 7 13:38:10 2009 (r200212) +++ svnadmin/conf/mentors Mon Dec 7 14:47:45 2009 (r200213) @@ -13,6 +13,7 @@ cbzimmer sam dchagin kib eri mlaier Co-mentor: thompsa +gavin ed ivoras gnn jh trasz Co-mentor: rwatson jinmei gnn From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 14:56:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D38D9106566B; Mon, 7 Dec 2009 14:56:10 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 8C3C28FC19; Mon, 7 Dec 2009 14:56:10 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id CA7FD6D41C; Mon, 7 Dec 2009 14:56:09 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id A6E1A844E9; Mon, 7 Dec 2009 15:56:09 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Luigi Rizzo References: <20091207055752.GD64905@hoeg.nl> <20091207085927.GC57764@onelab2.iet.unipi.it> <86iqcjt93c.fsf@ds4.des.no> <20091207105343.GA62012@onelab2.iet.unipi.it> <86ein7t5m5.fsf@ds4.des.no> <20091207130433.GA71902@onelab2.iet.unipi.it> <86skbnrkrz.fsf@ds4.des.no> <20091207133117.GA73597@onelab2.iet.unipi.it> <86ocmavoou.fsf@ds4.des.no> <20091207145452.GA78854@onelab2.iet.unipi.it> Date: Mon, 07 Dec 2009 15:56:09 +0100 In-Reply-To: <20091207145452.GA78854@onelab2.iet.unipi.it> (Luigi Rizzo's message of "Mon, 7 Dec 2009 15:54:52 +0100") Message-ID: <86bpiavnna.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: the need for safe dynamic string libraries X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 14:56:10 -0000 Luigi Rizzo writes: > "Dag-Erling Sm=C3=B8rgrav" writes: > > Restoring sbuf_printf() to what it was would not change the API, but > > the semantics would be different in certain cases. > doesn't seem a big deal, we already have diffent behaviour in > kernel vs userland for certain functions (e.g. printf() itself, > if nothing else the format specifiers are different in some cases). There are parts of CAM that are shared between the kernel and userland (which is why libsbuf was created in the first place)... OTOH, I don't think they use the sbuf API in such a way that they would be affected. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 15:15:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BE73106566B; Mon, 7 Dec 2009 15:15:09 +0000 (UTC) (envelope-from guido@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF9838FC15; Mon, 7 Dec 2009 15:15: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 nB7FF8M3057494; Mon, 7 Dec 2009 15:15:08 GMT (envelope-from guido@svn.freebsd.org) Received: (from guido@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7FF8GN057493; Mon, 7 Dec 2009 15:15:08 GMT (envelope-from guido@svn.freebsd.org) Message-Id: <200912071515.nB7FF8GN057493@svn.freebsd.org> From: Guido van Rooij Date: Mon, 7 Dec 2009 15:15: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: r200214 - head/sys/fs/ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 15:15:09 -0000 Author: guido Date: Mon Dec 7 15:15:08 2009 New Revision: 200214 URL: http://svn.freebsd.org/changeset/base/200214 Log: Fix ntfs such that it understand media with a non-512-bytes sector size: 1. Fixups are always done on 512 byte chunks (in stead of sectors). This is kind of stupid. 2. Conevrt between NTFS blocknumbers (the blocksize equals the media sector size) and the bread() and getblk() blocknr (which are 512-byte sized) NB: this change should not affect ntfs for 512-byte sector sizes. Modified: head/sys/fs/ntfs/ntfs.h head/sys/fs/ntfs/ntfs_subr.c head/sys/fs/ntfs/ntfs_vfsops.c Modified: head/sys/fs/ntfs/ntfs.h ============================================================================== --- head/sys/fs/ntfs/ntfs.h Mon Dec 7 14:47:45 2009 (r200213) +++ head/sys/fs/ntfs/ntfs.h Mon Dec 7 15:15:08 2009 (r200214) @@ -183,6 +183,7 @@ struct attr_indexentry { }; #define NTFS_FILEMAGIC (u_int32_t)(0x454C4946) +#define NTFS_BLOCK_SIZE 512 #define NTFS_FRFLAG_DIR 0x0002 struct filerec { struct fixuphdr fr_fixup; @@ -257,6 +258,7 @@ struct ntfsmount { char ** ntm_u28; /* Unicode to 8 bit */ void * ntm_ic_l2u; /* Local to Unicode (iconv) */ void * ntm_ic_u2l; /* Unicode to Local (iconv) */ + u_int8_t ntm_multiplier; /* NTFS blockno to DEV_BSIZE sectorno */ }; #define ntm_mftcn ntm_bootfile.bf_mftcn Modified: head/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- head/sys/fs/ntfs/ntfs_subr.c Mon Dec 7 14:47:45 2009 (r200213) +++ head/sys/fs/ntfs/ntfs_subr.c Mon Dec 7 15:15:08 2009 (r200214) @@ -278,6 +278,7 @@ ntfs_loadntnode( bn = ntfs_cntobn(ntmp->ntm_mftcn) + ntmp->ntm_bpmftrec * ip->i_number; + bn *= ntmp->ntm_multiplier; error = bread(ntmp->ntm_devvp, bn, ntfs_bntob(ntmp->ntm_bpmftrec), @@ -581,7 +582,7 @@ ntfs_attrtontvattr( memcpy(vap->va_datap, (caddr_t) rap + rap->a_r.a_dataoff, rap->a_r.a_datalen); } - ddprintf((", len: %d", vap->va_datalen)); + ddprintf((", len: %lld", vap->va_datalen)); if (error) free(vap, M_NTFSNTVATTR); @@ -1491,11 +1492,13 @@ ntfs_writentvattr_plain( (u_int32_t) left)); if ((off == 0) && (tocopy == ntfs_cntob(cl))) { - bp = getblk(ntmp->ntm_devvp, ntfs_cntobn(cn), + bp = getblk(ntmp->ntm_devvp, ntfs_cntobn(cn) + * ntmp->ntm_multiplier, ntfs_cntob(cl), 0, 0, 0); clrbuf(bp); } else { - error = bread(ntmp->ntm_devvp, ntfs_cntobn(cn), + error = bread(ntmp->ntm_devvp, ntfs_cntobn(cn) + * ntmp->ntm_multiplier, ntfs_cntob(cl), NOCRED, &bp); if (error) { brelse(bp); @@ -1602,7 +1605,8 @@ ntfs_readntvattr_plain( (u_int32_t) tocopy, (u_int32_t) left)); error = bread(ntmp->ntm_devvp, - ntfs_cntobn(cn), + ntfs_cntobn(cn) + * ntmp->ntm_multiplier, ntfs_cntob(cl), NOCRED, &bp); if (error) { @@ -1878,7 +1882,7 @@ ntfs_procfixups( fhp->fh_magic, magic); return (EINVAL); } - if ((fhp->fh_fnum - 1) * ntmp->ntm_bps != len) { + if ((fhp->fh_fnum - 1) * NTFS_BLOCK_SIZE != len) { printf("ntfs_procfixups: " \ "bad fixups number: %d for %ld bytes block\n", fhp->fh_fnum, (long)len); /* XXX printf kludge */ @@ -1889,7 +1893,7 @@ ntfs_procfixups( return (EINVAL); } fxp = (u_int16_t *) (buf + fhp->fh_foff); - cfxp = (u_int16_t *) (buf + ntmp->ntm_bps - 2); + cfxp = (u_int16_t *) (buf + NTFS_BLOCK_SIZE - 2); fixup = *fxp++; for (i = 1; i < fhp->fh_fnum; i++, fxp++) { if (*cfxp != fixup) { @@ -1897,7 +1901,7 @@ ntfs_procfixups( return (EINVAL); } *cfxp = *fxp; - cfxp = (u_int16_t *) ((caddr_t) cfxp + ntmp->ntm_bps); + cfxp = (u_int16_t *) ((caddr_t) cfxp + NTFS_BLOCK_SIZE); } return (0); } Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Mon Dec 7 14:47:45 2009 (r200213) +++ head/sys/fs/ntfs/ntfs_vfsops.c Mon Dec 7 15:15:08 2009 (r200214) @@ -316,6 +316,8 @@ ntfs_mountfs(devvp, mp, td) else ntmp->ntm_bpmftrec = (1 << (-cpr)) / ntmp->ntm_bps; } + ntmp->ntm_multiplier = ntmp->ntm_bps / DEV_BSIZE; + dprintf(("ntfs_mountfs(): bps: %d, spc: %d, media: %x, mftrecsz: %d (%d sects)\n", ntmp->ntm_bps,ntmp->ntm_spc,ntmp->ntm_bootfile.bf_media, ntmp->ntm_mftrecsz,ntmp->ntm_bpmftrec)); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 15:29:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BA831065693; Mon, 7 Dec 2009 15:29:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFAA08FC13; Mon, 7 Dec 2009 15:29: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 nB7FT7FR057843; Mon, 7 Dec 2009 15:29:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7FT7h1057842; Mon, 7 Dec 2009 15:29:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912071529.nB7FT7h1057842@svn.freebsd.org> From: Marius Strobl Date: Mon, 7 Dec 2009 15:29: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: r200215 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 15:29:08 -0000 Author: marius Date: Mon Dec 7 15:29:07 2009 New Revision: 200215 URL: http://svn.freebsd.org/changeset/base/200215 Log: Add missed in r199135. Modified: head/sys/sparc64/sparc64/trap.c Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Mon Dec 7 15:15:08 2009 (r200214) +++ head/sys/sparc64/sparc64/trap.c Mon Dec 7 15:29:07 2009 (r200215) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 16:00:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD5D2106566B; Mon, 7 Dec 2009 16:00:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFAA8FC15; Mon, 7 Dec 2009 16:00: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 nB7G0xcf058589; Mon, 7 Dec 2009 16:00:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7G0x4c058586; Mon, 7 Dec 2009 16:00:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912071600.nB7G0x4c058586@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Dec 2009 16:00: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: r200216 - in head/sys/boot/i386: libi386 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 16:01:00 -0000 Author: jhb Date: Mon Dec 7 16:00:59 2009 New Revision: 200216 URL: http://svn.freebsd.org/changeset/base/200216 Log: Various small whitespace and style fixes. Modified: head/sys/boot/i386/libi386/biosmem.c head/sys/boot/i386/libi386/libi386.h head/sys/boot/i386/loader/main.c Modified: head/sys/boot/i386/libi386/biosmem.c ============================================================================== --- head/sys/boot/i386/libi386/biosmem.c Mon Dec 7 15:29:07 2009 (r200215) +++ head/sys/boot/i386/libi386/biosmem.c Mon Dec 7 16:00:59 2009 (r200216) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include "btxv86.h" vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +uint32_t bios_basemem, bios_extmem; static struct bios_smap smap; @@ -98,4 +98,3 @@ bios_getmem(void) memtop = memtop_copyin = 0x100000 + bios_extmem; } - Modified: head/sys/boot/i386/libi386/libi386.h ============================================================================== --- head/sys/boot/i386/libi386/libi386.h Mon Dec 7 15:29:07 2009 (r200215) +++ head/sys/boot/i386/libi386/libi386.h Mon Dec 7 16:00:59 2009 (r200216) @@ -78,9 +78,9 @@ int bc_add(int biosdev); /* Register CD int bc_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */ int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */ -u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ -int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ -int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ +uint32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */ +int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */ +int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */ int bd_getdev(struct i386_devdesc *dev); /* return dev_t for (dev) */ ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -92,12 +92,13 @@ void bios_addsmapdata(struct preloaded_f void bios_getsmap(void); void bios_getmem(void); -extern u_int32_t bios_basemem; /* base memory in bytes */ -extern u_int32_t bios_extmem; /* extended memory in bytes */ +extern uint32_t bios_basemem; /* base memory in bytes */ +extern uint32_t bios_extmem; /* extended memory in bytes */ extern vm_offset_t memtop; /* last address of physical memory + 1 */ extern vm_offset_t memtop_copyin; /* memtop less heap size for the cases */ - /* when heap is at the top of extended memory */ - /* for other cases - just the same as memtop */ + /* when heap is at the top of */ + /* extended memory; for other cases */ + /* just the same as memtop */ int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Mon Dec 7 15:29:07 2009 (r200215) +++ head/sys/boot/i386/loader/main.c Mon Dec 7 16:00:59 2009 (r200216) @@ -102,7 +102,8 @@ main(void) */ bios_getmem(); -#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) +#if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ + defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) heap_top = PTOV(memtop_copyin); memtop_copyin -= 0x300000; heap_bottom = PTOV(memtop_copyin); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 16:10:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51F7E10656A4; Mon, 7 Dec 2009 16:10:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 419F68FC0C; Mon, 7 Dec 2009 16:10: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 nB7GAnEw058798; Mon, 7 Dec 2009 16:10:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7GAnNQ058795; Mon, 7 Dec 2009 16:10:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912071610.nB7GAnNQ058795@svn.freebsd.org> From: Alexander Motin Date: Mon, 7 Dec 2009 16:10: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: r200217 - head/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 16:10:49 -0000 Author: mav Date: Mon Dec 7 16:10:48 2009 New Revision: 200217 URL: http://svn.freebsd.org/changeset/base/200217 Log: SiI3124 has no SNotification register. Handle Asynchronous Notifications there without it as good as possible. Modified: head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Dec 7 16:00:59 2009 (r200216) +++ head/sys/dev/siis/siis.c Mon Dec 7 16:10:48 2009 (r200217) @@ -93,15 +93,17 @@ static struct { uint32_t id; const char *name; int ports; + int quirks; +#define SIIS_Q_SNTF 1 } siis_ids[] = { - {0x31241095, "SiI3124", 4}, - {0x31248086, "SiI3124", 4}, - {0x31321095, "SiI3132", 2}, - {0x02421095, "SiI3132", 2}, - {0x02441095, "SiI3132", 2}, - {0x31311095, "SiI3131", 1}, - {0x35311095, "SiI3531", 1}, - {0, NULL, 0} + {0x31241095, "SiI3124", 4, 0}, + {0x31248086, "SiI3124", 4, 0}, + {0x31321095, "SiI3132", 2, SIIS_Q_SNTF}, + {0x02421095, "SiI3132", 2, SIIS_Q_SNTF}, + {0x02441095, "SiI3132", 2, SIIS_Q_SNTF}, + {0x31311095, "SiI3131", 1, SIIS_Q_SNTF}, + {0x35311095, "SiI3531", 1, SIIS_Q_SNTF}, + {0, NULL, 0, 0} }; static int @@ -113,7 +115,7 @@ siis_probe(device_t dev) for (i = 0; siis_ids[i].id != 0; i++) { if (siis_ids[i].id == devid) { - snprintf(buf, sizeof(buf), "%s SATA2 controller", + snprintf(buf, sizeof(buf), "%s SATA controller", siis_ids[i].name); device_set_desc_copy(dev, buf); return (BUS_PROBE_VENDOR); @@ -130,11 +132,12 @@ siis_attach(device_t dev) device_t child; int error, i, unit; + ctlr->dev = dev; for (i = 0; siis_ids[i].id != 0; i++) { if (siis_ids[i].id == devid) break; } - ctlr->dev = dev; + ctlr->quirks = siis_ids[i].quirks; /* Global memory */ ctlr->r_grid = PCIR_BAR(0); if (!(ctlr->r_gmem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -413,12 +416,14 @@ siis_ch_probe(device_t dev) static int siis_ch_attach(device_t dev) { + struct siis_controller *ctlr = device_get_softc(device_get_parent(dev)); struct siis_channel *ch = device_get_softc(dev); struct cam_devq *devq; int rid, error, i, sata_rev = 0; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); + ch->quirks = ctlr->quirks; resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); resource_int_value(device_get_name(dev), @@ -680,8 +685,16 @@ siis_notify_events(device_t dev) u_int32_t status; int i; - status = ATA_INL(ch->r_mem, SIIS_P_SNTF); - ATA_OUTL(ch->r_mem, SIIS_P_SNTF, status); + if (ch->quirks & SIIS_Q_SNTF) { + status = ATA_INL(ch->r_mem, SIIS_P_SNTF); + ATA_OUTL(ch->r_mem, SIIS_P_SNTF, status); + } else { + /* + * Without SNTF we have no idea which device sent notification. + * If PMP is connected, assume it, else - device. + */ + status = (ch->pm_present) ? 0x8000 : 0x0001; + } if (bootverbose) device_printf(dev, "SNTF 0x%04x\n", status); for (i = 0; i < 16; i++) { Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Mon Dec 7 16:00:59 2009 (r200216) +++ head/sys/dev/siis/siis.h Mon Dec 7 16:10:48 2009 (r200217) @@ -363,6 +363,7 @@ struct siis_channel { struct ata_dma dma; /* DMA data */ struct cam_sim *sim; struct cam_path *path; + int quirks; int pm_level; /* power management level */ struct siis_slot slot[SIIS_MAX_SLOTS]; @@ -400,6 +401,7 @@ struct siis_controller { void *handle; int r_irq_rid; } irq; + int quirks; int channels; struct { void (*function)(void *); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 16:23:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EDBC1065672; Mon, 7 Dec 2009 16:23:27 +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 1E0298FC08; Mon, 7 Dec 2009 16:23: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 nB7GNQrO059154; Mon, 7 Dec 2009 16:23:26 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7GNQbV059153; Mon, 7 Dec 2009 16:23:26 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912071623.nB7GNQbV059153@svn.freebsd.org> From: Alexander Motin Date: Mon, 7 Dec 2009 16:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200218 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 16:23:27 -0000 Author: mav Date: Mon Dec 7 16:23:25 2009 New Revision: 200218 URL: http://svn.freebsd.org/changeset/base/200218 Log: MFp4; - Cleanup kernel messages, mostly PMP. - Took references on devices, while PMP reinitializes them, to not let them go and distort freeze reference counting. Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_pmp.c head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Mon Dec 7 16:10:48 2009 (r200217) +++ head/sys/cam/ata/ata_all.c Mon Dec 7 16:23:25 2009 (r200218) @@ -256,8 +256,10 @@ ata_print_ident(struct ata_params *ident sizeof(product)); cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision), sizeof(revision)); - printf("<%s %s> ATA/ATAPI-%d", - product, revision, ata_version(ident_data->version_major)); + printf("<%s %s> %s-%d", + product, revision, + (ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA", + ata_version(ident_data->version_major)); if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) { if (ident_data->satacapabilities & ATA_SATA_GEN3) printf(" SATA 3.x"); Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Mon Dec 7 16:10:48 2009 (r200217) +++ head/sys/cam/ata/ata_pmp.c Mon Dec 7 16:23:25 2009 (r200218) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -176,8 +177,8 @@ pmpfreeze(struct cam_periph *periph, int if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), i, 0) == CAM_REQ_CMP) { -printf("PMP freeze: %d\n", i); softc->frozen |= (1 << i); + xpt_acquire_device(dpath->device); cam_freeze_devq(dpath); xpt_free_path(dpath); } @@ -198,9 +199,9 @@ pmprelease(struct cam_periph *periph, in if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), i, 0) == CAM_REQ_CMP) { -printf("PMP release: %d\n", i); softc->frozen &= ~(1 << i); cam_release_devq(dpath, 0, 0, 0, FALSE); + xpt_release_device(dpath->device); xpt_free_path(dpath); } } @@ -228,6 +229,7 @@ pmponinvalidate(struct cam_periph *perip xpt_free_path(dpath); } } + pmprelease(periph, -1); xpt_print(periph->path, "lost device\n"); } @@ -459,8 +461,6 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_write_cmd(ataio, 2, softc->pm_step, (softc->found & (1 << softc->pm_step)) ? 0 : 1); -printf("PM RESET %d%s\n", softc->pm_step, - (softc->found & (1 << softc->pm_step)) ? " skipping" : ""); break; case PMP_STATE_CONNECT: cam_fill_ataio(ataio, @@ -584,7 +584,9 @@ pmpdone(struct cam_periph *periph, union if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) softc->pm_ports--; - printf("PM ports: %d\n", softc->pm_ports); + printf("%s%d: %d fan-out ports\n", + periph->periph_name, periph->unit_number, + softc->pm_ports); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -606,7 +608,6 @@ pmpdone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/5, /*getcount_only*/0); - printf("PM reset done\n"); softc->state = PMP_STATE_CONNECT; } xpt_release_ccb(done_ccb); @@ -623,7 +624,6 @@ pmpdone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/10, /*getcount_only*/0); - printf("PM connect done\n"); softc->state = PMP_STATE_CHECK; } xpt_release_ccb(done_ccb); @@ -635,7 +635,11 @@ pmpdone(struct cam_periph *periph, union (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) { - printf("PM status: %d - %08x\n", softc->pm_step, res); + if (bootverbose) { + printf("%s%d: port %d status: %08x\n", + periph->periph_name, periph->unit_number, + softc->pm_step, res); + } /* Report device speed. */ if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), @@ -661,7 +665,11 @@ pmpdone(struct cam_periph *periph, union /*getcount_only*/0); softc->pm_try++; } else { - printf("PM status: %d - %08x\n", softc->pm_step, res); + if (bootverbose) { + printf("%s%d: port %d status: %08x\n", + periph->periph_name, periph->unit_number, + softc->pm_step, res); + } softc->found &= ~(1 << softc->pm_step); if (xpt_create_path(&dpath, periph, done_ccb->ccb_h.path_id, Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon Dec 7 16:10:48 2009 (r200217) +++ head/sys/cam/ata/ata_xpt.c Mon Dec 7 16:23:25 2009 (r200218) @@ -729,7 +729,8 @@ noerror: { int sign = (done_ccb->ataio.res.lba_high << 8) + done_ccb->ataio.res.lba_mid; - xpt_print(path, "SIGNATURE: %04x\n", sign); + if (bootverbose) + xpt_print(path, "SIGNATURE: %04x\n", sign); if (sign == 0x0000 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_ATA; @@ -921,7 +922,6 @@ noerror: (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; ((uint32_t *)ident_buf)[0] = softc->pm_pid; - printf("PM Product ID: %08x\n", softc->pm_pid); snprintf(ident_buf->model, sizeof(ident_buf->model), "Port Multiplier %08x", softc->pm_pid); PROBE_SET_ACTION(softc, PROBE_PM_PRV); @@ -934,7 +934,6 @@ noerror: (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; ((uint32_t *)ident_buf)[1] = softc->pm_prv; - printf("PM Revision: %08x\n", softc->pm_prv); snprintf(ident_buf->revision, sizeof(ident_buf->revision), "%04x", softc->pm_prv); path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 16:29:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D13AC106568F; Mon, 7 Dec 2009 16:29:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0B718FC12; Mon, 7 Dec 2009 16:29: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 nB7GThH0059297; Mon, 7 Dec 2009 16:29:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7GThqX059293; Mon, 7 Dec 2009 16:29:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912071629.nB7GThqX059293@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Dec 2009 16:29: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: r200219 - in head/sys/boot/i386: libi386 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 16:29:43 -0000 Author: jhb Date: Mon Dec 7 16:29:43 2009 New Revision: 200219 URL: http://svn.freebsd.org/changeset/base/200219 Log: Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. Previously the loader would always use the last 3MB in the first memory range above 1MB for the heap. However, this memory range is also where the kernel and any modules are loaded. If this memory range is "small", then using the high 3MB for the heap may not leave enough room for the kernel and modules. Now the loader will use any range below 4GB for the heap, and the logic to choose the "high" heap region has moved into biosmem.c. It sets two variables that the loader can use for a high heap if it desires. When a high heap is enabled (BZIP2, FireWire, GPT, or ZFS), then the following memory ranges are preferred for the heap in order from best to worst: - The largest memory region in the SMAP with a start address greater than 1MB. The memory region must be at least 3MB in length. This leaves the region starting at 1MB purely for use by the kernel and modules. - The last 3MB of the memory region starting at 1MB if it is at least 3MB in size. This matches the current behavior except that the current loader would break horribly if the first region was not at least 3MB in size. - The memory range from the end of the loader up to the 640k window. This is the range the loader uses when none of the high-heap-requesting options are enabled. Tested by: hrs MFC after: 1 week Modified: head/sys/boot/i386/libi386/biosmem.c head/sys/boot/i386/libi386/libi386.h head/sys/boot/i386/loader/main.c Modified: head/sys/boot/i386/libi386/biosmem.c ============================================================================== --- head/sys/boot/i386/libi386/biosmem.c Mon Dec 7 16:23:25 2009 (r200218) +++ head/sys/boot/i386/libi386/biosmem.c Mon Dec 7 16:29:43 2009 (r200219) @@ -35,14 +35,20 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -uint32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; static struct bios_smap smap; +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + void bios_getmem(void) { + uint64_t size; /* Parse system memory map */ v86.ebx = 0; @@ -65,6 +71,26 @@ bios_getmem(void) if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { bios_extmem = smap.length; } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } } while (v86.ebx != 0); /* Fall back to the old compatibility function for base memory */ @@ -97,4 +123,13 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } Modified: head/sys/boot/i386/libi386/libi386.h ============================================================================== --- head/sys/boot/i386/libi386/libi386.h Mon Dec 7 16:23:25 2009 (r200218) +++ head/sys/boot/i386/libi386/libi386.h Mon Dec 7 16:29:43 2009 (r200219) @@ -99,6 +99,8 @@ extern vm_offset_t memtop_copyin; /* mem /* when heap is at the top of */ /* extended memory; for other cases */ /* just the same as memtop */ +extern uint32_t high_heap_size; /* extended memory region available */ +extern vm_offset_t high_heap_base; /* for use as the heap */ int biospci_find_devclass(uint32_t class, int index, uint32_t *locator); int biospci_write_config(uint32_t locator, int offset, int width, uint32_t val); Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Mon Dec 7 16:23:25 2009 (r200218) +++ head/sys/boot/i386/loader/main.c Mon Dec 7 16:29:43 2009 (r200219) @@ -104,13 +104,17 @@ main(void) #if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) || \ defined(LOADER_GPT_SUPPORT) || defined(LOADER_ZFS_SUPPORT) - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 16:37:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFCE8106568B; Mon, 7 Dec 2009 16:37:02 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD5F88FC08; Mon, 7 Dec 2009 16:37: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 nB7Gb2FE059491; Mon, 7 Dec 2009 16:37:02 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7Gb2RX059486; Mon, 7 Dec 2009 16:37:02 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912071637.nB7Gb2RX059486@svn.freebsd.org> From: Robert Noland Date: Mon, 7 Dec 2009 16:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200220 - in stable/8/sys/boot: . i386 i386/loader i386/zfsboot i386/zfsloader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 16:37:03 -0000 Author: rnoland Date: Mon Dec 7 16:37:02 2009 New Revision: 200220 URL: http://svn.freebsd.org/changeset/base/200220 Log: MFC 199714 Create a seperate ZFS enabled loader. This adds zfsloader which will be called by zfsboot/gptzfsboot code rather than the tradional loader. This eliminates the need to set the LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader. Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot) in order for the boot process to use the new loader. New installations will no longer be required to build a ZFS enabled loader for a working ZFS boot system. Installing zfsboot/gptzfsboot is sufficient for acknowledging the use of CDDL code and therefore the ZFS enabled loader. Added: stable/8/sys/boot/i386/zfsloader/ - copied from r199714, head/sys/boot/i386/zfsloader/ Modified: stable/8/sys/boot/Makefile stable/8/sys/boot/i386/Makefile stable/8/sys/boot/i386/loader/Makefile stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/Makefile ============================================================================== --- stable/8/sys/boot/Makefile Mon Dec 7 16:29:43 2009 (r200219) +++ stable/8/sys/boot/Makefile Mon Dec 7 16:37:02 2009 (r200220) @@ -22,7 +22,7 @@ SUBDIR+= ofw SUBDIR+= uboot .endif -.if defined(LOADER_ZFS_SUPPORT) +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" SUBDIR+= zfs .endif Modified: stable/8/sys/boot/i386/Makefile ============================================================================== --- stable/8/sys/boot/i386/Makefile Mon Dec 7 16:29:43 2009 (r200219) +++ stable/8/sys/boot/i386/Makefile Mon Dec 7 16:37:02 2009 (r200220) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \ - gptzfsboot kgzldr libi386 libfirewire loader + gptzfsboot kgzldr libi386 libfirewire loader zfsloader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Modified: stable/8/sys/boot/i386/loader/Makefile ============================================================================== --- stable/8/sys/boot/i386/loader/Makefile Mon Dec 7 16:29:43 2009 (r200219) +++ stable/8/sys/boot/i386/loader/Makefile Mon Dec 7 16:37:02 2009 (r200220) @@ -3,9 +3,10 @@ .include MK_SSP= no -PROG= loader.sym +LOADER?= loader +PROG= ${LOADER}.sym INTERNALPROG= -NEWVERSWHAT= "bootstrap loader" i386 +NEWVERSWHAT?= "bootstrap loader" i386 # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -16,7 +17,7 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a .endif -# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support +# Set by zfsloader Makefile .if defined(LOADER_ZFS_SUPPORT) CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a @@ -61,7 +62,7 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES= vers.c loader loader.bin loader.help +CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -80,30 +81,35 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} -loader: loader.bin ${BTXLDR} ${BTXKERN} +${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ - -b ${BTXKERN} loader.bin + -b ${BTXKERN} ${LOADER}.bin -loader.bin: loader.sym +${LOADER}.bin: ${LOADER}.sym cp ${.ALLSRC} ${.TARGET} strip -R .comment -R .note ${.TARGET} loader.help: help.common help.i386 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} +FILES= ${LOADER} +# XXX INSTALLFLAGS_loader= -b +FILESMODE_${LOADER}= ${BINMODE} -b + +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader loader.help loader.4th support.4th loader.conf +FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th -# XXX INSTALLFLAGS_loader= -b -FILESMODE_loader= ${BINMODE} -b FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) FILES+= loader.rc .endif +.endif # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Mon Dec 7 16:29:43 2009 (r200219) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Mon Dec 7 16:37:02 2009 (r200220) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #define KARGS_FLAGS_ZFS 0x4 #define PATH_CONFIG "/boot.config" -#define PATH_BOOT3 "/boot/loader" +#define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #define ARGS 0x900 From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 17:15:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E27B0106568B; Mon, 7 Dec 2009 17:15:36 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8BC8FC1B; Mon, 7 Dec 2009 17:15: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 nB7HFaTN060300; Mon, 7 Dec 2009 17:15:36 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7HFaHv060295; Mon, 7 Dec 2009 17:15:36 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912071715.nB7HFaHv060295@svn.freebsd.org> From: Robert Noland Date: Mon, 7 Dec 2009 17:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200221 - in stable/7/sys/boot: . i386 i386/loader i386/zfsboot i386/zfsloader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 17:15:37 -0000 Author: rnoland Date: Mon Dec 7 17:15:36 2009 New Revision: 200221 URL: http://svn.freebsd.org/changeset/base/200221 Log: MFC 199714 Create a seperate ZFS enabled loader. This adds zfsloader which will be called by zfsboot/gptzfsboot code rather than the tradional loader. This eliminates the need to set the LOADER_ZFS_SUPPORT variable in order to get a ZFS enabled loader. Note however, that you must reinstall your bootcode (zfsboot/gptzfsboot) in order for the boot process to use the new loader. New installations will no longer be required to build a ZFS enabled loader for a working ZFS boot system. Installing zfsboot/gptzfsboot is sufficient for acknowledging the use of CDDL code and therefore the ZFS enabled loader. Added: stable/7/sys/boot/i386/zfsloader/ - copied from r199714, head/sys/boot/i386/zfsloader/ Modified: stable/7/sys/boot/Makefile stable/7/sys/boot/i386/Makefile stable/7/sys/boot/i386/loader/Makefile stable/7/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/Makefile ============================================================================== --- stable/7/sys/boot/Makefile Mon Dec 7 16:37:02 2009 (r200220) +++ stable/7/sys/boot/Makefile Mon Dec 7 17:15:36 2009 (r200221) @@ -17,7 +17,7 @@ SUBDIR+= efi SUBDIR+= ofw .endif -.if ${MK_ZFS} != "no" +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" SUBDIR+= zfs .endif Modified: stable/7/sys/boot/i386/Makefile ============================================================================== --- stable/7/sys/boot/i386/Makefile Mon Dec 7 16:37:02 2009 (r200220) +++ stable/7/sys/boot/i386/Makefile Mon Dec 7 17:15:36 2009 (r200221) @@ -1,8 +1,8 @@ # $FreeBSD$ .include -SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ - zfsboot gptzfsboot kgzldr libi386 libfirewire loader +SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot zfsboot \ + gptzfsboot kgzldr libi386 libfirewire loader zfsloader # special boot programs, 'self-extracting boot2+loader' SUBDIR+= pxeldr Modified: stable/7/sys/boot/i386/loader/Makefile ============================================================================== --- stable/7/sys/boot/i386/loader/Makefile Mon Dec 7 16:37:02 2009 (r200220) +++ stable/7/sys/boot/i386/loader/Makefile Mon Dec 7 17:15:36 2009 (r200221) @@ -2,9 +2,10 @@ .include -PROG= loader.sym +LOADER?= loader +PROG= ${LOADER}.sym INTERNALPROG= -NEWVERSWHAT= "bootstrap loader" i386 +NEWVERSWHAT?= "bootstrap loader" i386 # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -15,7 +16,7 @@ CFLAGS+= -DLOADER_FIREWIRE_SUPPORT LIBFIREWIRE= ${.OBJDIR}/../libfirewire/libfirewire.a .endif -# Put LOADER_ZFS_SUPPORT=yes in /etc/make.conf for ZFS support +# Set by zfsloader Makefile #.if ${MK_ZFS} != "no" #CFLAGS+= -DLOADER_ZFS_SUPPORT #LIBZFS= ${.OBJDIR}/../../zfs/libzfsboot.a @@ -60,7 +61,7 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES= vers.c loader loader.bin loader.help +CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -79,30 +80,35 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} +vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version + sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ + ${NEWVERSWHAT} -loader: loader.bin ${BTXLDR} ${BTXKERN} +${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ - -b ${BTXKERN} loader.bin + -b ${BTXKERN} ${LOADER}.bin -loader.bin: loader.sym +${LOADER}.bin: ${LOADER}.sym cp ${.ALLSRC} ${.TARGET} strip -R .comment -R .note ${.TARGET} loader.help: help.common help.i386 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} +FILES= ${LOADER} +# XXX INSTALLFLAGS_loader= -b +FILESMODE_${LOADER}= ${BINMODE} -b + +.if !defined(LOADER_ONLY) .PATH: ${.CURDIR}/../../forth -FILES= loader loader.help loader.4th support.4th loader.conf +FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th -# XXX INSTALLFLAGS_loader= -b -FILESMODE_loader= ${BINMODE} -b FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) FILES+= loader.rc .endif +.endif # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsboot.c Mon Dec 7 16:37:02 2009 (r200220) +++ stable/7/sys/boot/i386/zfsboot/zfsboot.c Mon Dec 7 17:15:36 2009 (r200221) @@ -84,7 +84,7 @@ __FBSDID("$FreeBSD$"); #define KARGS_FLAGS_ZFS 0x4 #define PATH_CONFIG "/boot.config" -#define PATH_BOOT3 "/boot/loader" +#define PATH_BOOT3 "/boot/zfsloader" #define PATH_KERNEL "/boot/kernel/kernel" #define ARGS 0x900 From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 17:18:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1807C106568B; Mon, 7 Dec 2009 17:18:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06EFB8FC18; Mon, 7 Dec 2009 17:18: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 nB7HIq6h060388; Mon, 7 Dec 2009 17:18:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7HIqf7060386; Mon, 7 Dec 2009 17:18:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912071718.nB7HIqf7060386@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Dec 2009 17:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200222 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 17:18:53 -0000 Author: jhb Date: Mon Dec 7 17:18:52 2009 New Revision: 200222 URL: http://svn.freebsd.org/changeset/base/200222 Log: MFC 199974: Remove extra parantheses from usb_ethernet.c and usb_serial.c lines. config(8) doesn't parse parantheses and instead treated them as being part of the device driver name (e.g. '(u3g' vs 'u3g'). While here, fix the style of these long lines to match the wrapping used for other long lines in this file. Modified: stable/8/sys/conf/files Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Dec 7 17:15:36 2009 (r200221) +++ stable/8/sys/conf/files Mon Dec 7 17:18:52 2009 (r200222) @@ -1624,8 +1624,8 @@ dev/usb/net/if_cue.c optional cue dev/usb/net/if_kue.c optional kue dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav -dev/usb/net/usb_ethernet.c \ - optional (aue | axe | cdce | cue | kue | rue | udav) +dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | rue | \ + udav # # USB WLAN drivers # @@ -1656,8 +1656,11 @@ dev/usb/serial/uplcom.c optional uplcom dev/usb/serial/uslcom.c optional uslcom dev/usb/serial/uvisor.c optional uvisor dev/usb/serial/uvscom.c optional uvscom -dev/usb/serial/usb_serial.c optional ucom | \ - (u3g | uark | ubsa | ubser | uchcom | ucycom | ufoma | uftdi | ugensa | uipaq | ulpt | umct | umodem | umoscom | uplcom | uslcom | uvisor | uvscom) +dev/usb/serial/usb_serial.c optional ucom | u3g | uark | ubsa | ubser | \ + uchcom | ucycom | ufoma | uftdi | \ + ugensa | uipaq | ulpt | umct | \ + umodem | umoscom | uplcom | uslcom | \ + uvisor | uvscom # # USB misc drivers # From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 17:42:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA755106568D; Mon, 7 Dec 2009 17:42:44 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id CBF368FC1D; Mon, 7 Dec 2009 17:42:43 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 34DD345CBA; Mon, 7 Dec 2009 18:42:42 +0100 (CET) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E746545684; Mon, 7 Dec 2009 18:42:32 +0100 (CET) Date: Mon, 7 Dec 2009 18:42:33 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20091207174233.GG1688@garage.freebsd.pl> References: <200912051340.nB5DepkE089078@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNpeiK4tTqhYOExY" Content-Disposition: inline In-Reply-To: <200912051340.nB5DepkE089078@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 i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200121 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 17:42:44 -0000 --PNpeiK4tTqhYOExY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 05, 2009 at 01:40:51PM +0000, Alexander Motin wrote: > Author: mav > Date: Sat Dec 5 13:40:51 2009 > New Revision: 200121 > URL: http://svn.freebsd.org/changeset/base/200121 >=20 > Log: > Do not ignore device interrupt if bus mastering is still active. It is > normal in case of media read error and some ATAPI cases, when transfer = size > is unknown beforehand. PCI ATA BM specification tells that in case of s= uch > underrun driver should just manually stop DMA engine. DMA engine should > same time guarantie that all bus mastering transfers completed at the m= oment > of driver reads interrupt flag asserted. > This change should fix interrupt storms and command timeouts in many ca= ses. > =20 > PR: kern/103602, sparc64/121539, kern/133122, kern/139654 I've a box where I see interrupt storm on. This is 8-STABLE with this patch applied. whiplash# vmstat -i | grep atapci1 irq20: atapci1 17935084 163046 whiplash# top -SH | grep atapci1 12 root -64 - 0K 224K WAIT 0 1:07 71.19% {irq20: atapc= i1} The box is totally idle. gstat(8) reports no disk activity whatsoever. whiplash# grep ^ata /var/run/dmesg.boot atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177= ,0x376,0xfc00-0xfc0f at device 31.1 on pci0 ata0: on atapci0 ata0: [ITHREAD] atapci1: port 0xbc98-0xbc9f,0xbc90-0xbc93,0= xbc80-0xbc87,0xbc78-0xbc7b,0xbc60-0xbc6f mem 0xfeb00000-0xfeb003ff irq 20 a= t device 31.2 on pci0 atapci1: [ITHREAD] ata2: on atapci1 ata2: [ITHREAD] ata3: on atapci1 ata3: [ITHREAD] whiplash# grep 'irq 20' /var/run/dmesg.boot atapci1: port 0xbc98-0xbc9f,0xbc90-0xbc93,0= xbc80-0xbc87,0xbc78-0xbc7b,0xbc60-0xbc6f mem 0xfeb00000-0xfeb003ff irq 20 a= t device 31.2 on pci0 I'm not sure if this is relevant, but I load entire ATA from modules: whiplash# grep ^ata /boot/loader.conf=20 ata_load=3D"YES" atapci_load=3D"YES" atadisk_load=3D"YES" atapicd_load=3D"YES" ataintel_load=3D"YES" Do you have any ideas? > Modified: > head/sys/dev/ata/ata-pci.c >=20 > Modified: head/sys/dev/ata/ata-pci.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/ata/ata-pci.c Sat Dec 5 13:12:04 2009 (r200120) > +++ head/sys/dev/ata/ata-pci.c Sat Dec 5 13:40:51 2009 (r200121) > @@ -462,8 +462,7 @@ ata_pci_status(device_t dev) > (ch->dma.flags & ATA_DMA_ACTIVE))) { > int bmstat =3D ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; > =20 > - if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) !=3D > - ATA_BMSTAT_INTERRUPT) > + if ((bmstat & ATA_BMSTAT_INTERRUPT) =3D=3D 0) > return 0; > ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR); > DELAY(1); --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --PNpeiK4tTqhYOExY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLHT6IForvXbEpPzQRAnyqAJ9hkkwuyjUdfIvsLWgOnAovWB5h3ACdE4Ei 49G2uWnQ1PQb3v9luaOYqi4= =SL9K -----END PGP SIGNATURE----- --PNpeiK4tTqhYOExY-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 18:03:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF4A1065676 for ; Mon, 7 Dec 2009 18:03:40 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outC.internet-mail-service.net (outc.internet-mail-service.net [216.240.47.226]) by mx1.freebsd.org (Postfix) with ESMTP id E623D8FC19 for ; Mon, 7 Dec 2009 18:03:39 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 84037CB13; Mon, 7 Dec 2009 10:03:39 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id BF7132D601A; Mon, 7 Dec 2009 10:03:38 -0800 (PST) Message-ID: <4B1D437F.4050601@elischer.org> Date: Mon, 07 Dec 2009 10:03:43 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ermal_Lu=E7i?= References: <200912061804.nB6I4R38027652@svn.freebsd.org> <200912070531.17758.max@love2party.net> <9a542da30912070301x4ada4d0ct67ec8553a477aea2@mail.gmail.com> In-Reply-To: <9a542da30912070301x4ada4d0ct67ec8553a477aea2@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Max Laier , Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 18:03:40 -0000 Ermal Luçi wrote: > > > On Mon, Dec 7, 2009 at 5:31 AM, Max Laier > > > Do you have a reference for me? > > > I followed the thread but route-to sets the sin_len see this: > http://fxr.watson.org/fxr/source/contrib/pf/net/pf.c?v=FREEBSD8#L6179 > > So if it really is broken, then there must be something else wrong with it. From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 18:19:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F994106566C for ; Mon, 7 Dec 2009 18:19:12 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outP.internet-mail-service.net (outp.internet-mail-service.net [216.240.47.239]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7838FC18 for ; Mon, 7 Dec 2009 18:19:12 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id DAFCD9E3DF; Mon, 7 Dec 2009 10:19:11 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 56A042D6013; Mon, 7 Dec 2009 10:19:11 -0800 (PST) Message-ID: <4B1D4723.5090908@elischer.org> Date: Mon, 07 Dec 2009 10:19:15 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ermal_Lu=E7i?= References: <200912061804.nB6I4R38027652@svn.freebsd.org> <200912070531.17758.max@love2party.net> <9a542da30912070301x4ada4d0ct67ec8553a477aea2@mail.gmail.com> <4B1D437F.4050601@elischer.org> In-Reply-To: <4B1D437F.4050601@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Max Laier , Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 18:19:12 -0000 Julian Elischer wrote: > Ermal Luçi wrote: >> >> >> On Mon, Dec 7, 2009 at 5:31 AM, Max Laier > [...] > >> > >> > Do you have a reference for me? >> >> >> I followed the thread but route-to sets the sin_len see this: >> http://fxr.watson.org/fxr/source/contrib/pf/net/pf.c?v=FREEBSD8#L6179 >> >> > > So if it really is broken, then there must be something else wrong with it. by which I mean, someone who used pf should check if it really is broken. We only have the word of the guy who reported the problem with ipfw that pf "had the same problem". From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 18:37:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A6D01065670; Mon, 7 Dec 2009 18:37:50 +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 4F5628FC12; Mon, 7 Dec 2009 18:37:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB7IboOx061972; Mon, 7 Dec 2009 18:37:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7IboVE061969; Mon, 7 Dec 2009 18:37:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912071837.nB7IboVE061969@svn.freebsd.org> From: Alexander Motin Date: Mon, 7 Dec 2009 18:37: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: r200223 - head/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 18:37:50 -0000 Author: mav Date: Mon Dec 7 18:37:50 2009 New Revision: 200223 URL: http://svn.freebsd.org/changeset/base/200223 Log: Explicitly acknowledge MSI completion, as required by SiI3124 datasheet. It makes MSI working there. Later (and cheaper) PCIe chips (3132/3531) still randomly crashing system in few seconds of high MSI rates, generating something inaporopriate, like NMI or "Fatal trap 30". Modified: head/sys/dev/siis/siis.c head/sys/dev/siis/siis.h Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Mon Dec 7 17:18:52 2009 (r200222) +++ head/sys/dev/siis/siis.c Mon Dec 7 18:37:50 2009 (r200223) @@ -143,6 +143,7 @@ siis_attach(device_t dev) if (!(ctlr->r_gmem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_grid, RF_ACTIVE))) return (ENXIO); + ctlr->gctl = ATA_INL(ctlr->r_gmem, SIIS_GCTL); /* Channels memory */ ctlr->r_rid = PCIR_BAR(2); if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -221,7 +222,8 @@ siis_suspend(device_t dev) bus_generic_suspend(dev); /* Put controller into reset state. */ - ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, SIIS_GCTL_GRESET); + ctlr->gctl |= SIIS_GCTL_GRESET; + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); return 0; } @@ -231,10 +233,13 @@ siis_resume(device_t dev) struct siis_controller *ctlr = device_get_softc(dev); /* Put controller into reset state. */ - ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, SIIS_GCTL_GRESET); + ctlr->gctl |= SIIS_GCTL_GRESET; + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); DELAY(10000); /* Get controller out of reset state and enable port interrupts. */ - ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, 0x0000000f); + ctlr->gctl &= ~(SIIS_GCTL_GRESET | SIIS_GCTL_I2C_IE); + ctlr->gctl |= 0x0000000f; + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); return (bus_generic_resume(dev)); } @@ -288,6 +293,11 @@ siis_intr(void *data) ctlr->interrupt[unit].function(arg); } } + /* Acknowledge interrupt, if MSI enabled. */ + if (ctlr->irq.r_irq_rid) { + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, + ctlr->gctl | SIIS_GCTL_MSIACK); + } } static struct resource * Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Mon Dec 7 17:18:52 2009 (r200222) +++ head/sys/dev/siis/siis.h Mon Dec 7 18:37:50 2009 (r200223) @@ -403,6 +403,7 @@ struct siis_controller { } irq; int quirks; int channels; + uint32_t gctl; struct { void (*function)(void *); void *argument; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:07:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 817C41065670; Mon, 7 Dec 2009 19:07:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4948FC13; Mon, 7 Dec 2009 19:07: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 nB7J7jfD062829; Mon, 7 Dec 2009 19:07:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7J7j8W062827; Mon, 7 Dec 2009 19:07:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912071907.nB7J7j8W062827@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Dec 2009 19:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200224 - stable/8/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:07:45 -0000 Author: jhb Date: Mon Dec 7 19:07:45 2009 New Revision: 200224 URL: http://svn.freebsd.org/changeset/base/200224 Log: MFC 200061: The fd_mask type is an unsigned long, not an int, so treat the mask as a long instead of an int when examining the results of select() to look for RPC requests. Previously this routine would ignore RPC requests to sockets whose file descriptor mod 64 was greater than 31 on a 64-bit platform. Modified: stable/8/lib/libc/rpc/svc.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/rpc/svc.c ============================================================================== --- stable/8/lib/libc/rpc/svc.c Mon Dec 7 18:37:50 2009 (r200223) +++ stable/8/lib/libc/rpc/svc.c Mon Dec 7 19:07:45 2009 (r200224) @@ -627,8 +627,8 @@ svc_getreqset(readfds) maskp = readfds->fds_bits; for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) { - for (mask = *maskp++; (bit = ffs(mask)) != 0; - mask ^= (1 << (bit - 1))) { + for (mask = *maskp++; (bit = ffsl(mask)) != 0; + mask ^= (1ul << (bit - 1))) { /* sock has input waiting */ fd = sock + bit - 1; svc_getreq_common(fd); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:07:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 179F51065696; Mon, 7 Dec 2009 19:07:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 055228FC14; Mon, 7 Dec 2009 19:07: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 nB7J7w2U062892; Mon, 7 Dec 2009 19:07:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7J7wpY062890; Mon, 7 Dec 2009 19:07:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912071907.nB7J7wpY062890@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Dec 2009 19:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200225 - stable/7/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:07:59 -0000 Author: jhb Date: Mon Dec 7 19:07:58 2009 New Revision: 200225 URL: http://svn.freebsd.org/changeset/base/200225 Log: MFC 200061: The fd_mask type is an unsigned long, not an int, so treat the mask as a long instead of an int when examining the results of select() to look for RPC requests. Previously this routine would ignore RPC requests to sockets whose file descriptor mod 64 was greater than 31 on a 64-bit platform. Modified: stable/7/lib/libc/rpc/svc.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/rpc/svc.c ============================================================================== --- stable/7/lib/libc/rpc/svc.c Mon Dec 7 19:07:45 2009 (r200224) +++ stable/7/lib/libc/rpc/svc.c Mon Dec 7 19:07:58 2009 (r200225) @@ -596,8 +596,8 @@ svc_getreqset(readfds) maskp = readfds->fds_bits; for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) { - for (mask = *maskp++; (bit = ffs(mask)) != 0; - mask ^= (1 << (bit - 1))) { + for (mask = *maskp++; (bit = ffsl(mask)) != 0; + mask ^= (1ul << (bit - 1))) { /* sock has input waiting */ fd = sock + bit - 1; svc_getreq_common(fd); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:08:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95D531065694; Mon, 7 Dec 2009 19:08:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 839B48FC22; Mon, 7 Dec 2009 19:08: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 nB7J8AVR062954; Mon, 7 Dec 2009 19:08:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7J8AOe062952; Mon, 7 Dec 2009 19:08:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912071908.nB7J8AOe062952@svn.freebsd.org> From: John Baldwin Date: Mon, 7 Dec 2009 19:08:10 +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: r200226 - stable/6/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:08:10 -0000 Author: jhb Date: Mon Dec 7 19:08:10 2009 New Revision: 200226 URL: http://svn.freebsd.org/changeset/base/200226 Log: MFC 200061: The fd_mask type is an unsigned long, not an int, so treat the mask as a long instead of an int when examining the results of select() to look for RPC requests. Previously this routine would ignore RPC requests to sockets whose file descriptor mod 64 was greater than 31 on a 64-bit platform. Modified: stable/6/lib/libc/rpc/svc.c Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/rpc/svc.c ============================================================================== --- stable/6/lib/libc/rpc/svc.c Mon Dec 7 19:07:58 2009 (r200225) +++ stable/6/lib/libc/rpc/svc.c Mon Dec 7 19:08:10 2009 (r200226) @@ -598,8 +598,8 @@ svc_getreqset(readfds) maskp = readfds->fds_bits; for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) { - for (mask = *maskp++; (bit = ffs(mask)) != 0; - mask ^= (1 << (bit - 1))) { + for (mask = *maskp++; (bit = ffsl(mask)) != 0; + mask ^= (1ul << (bit - 1))) { /* sock has input waiting */ fd = sock + bit - 1; svc_getreq_common(fd); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:18:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2382106568F; Mon, 7 Dec 2009 19:18: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 B72678FC16; Mon, 7 Dec 2009 19:18: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 nB7JINAJ063265; Mon, 7 Dec 2009 19:18:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7JINn7063263; Mon, 7 Dec 2009 19:18:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912071918.nB7JINn7063263@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Dec 2009 19:18: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: r200227 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:18:24 -0000 Author: yongari Date: Mon Dec 7 19:18:23 2009 New Revision: 200227 URL: http://svn.freebsd.org/changeset/base/200227 Log: Remove PHY isolate/power down code in bge_stop(). The isolation handler in brgphy(4) does not exist and brgphy(4) just resets the PHY and returns EINVAL as it has no isolation handler. I also agree on Marius's opinion that stop handler of every NIC driver seems to be the wrong place for implementing PHY isolate/power down. If we need PHY isolate/power down it should be implemented in brgphy(4) and users should administratively down the PHY. Reviewed by: marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Dec 7 19:08:10 2009 (r200226) +++ head/sys/dev/bge/if_bge.c Mon Dec 7 19:18:23 2009 (r200227) @@ -4588,17 +4588,11 @@ static void bge_stop(struct bge_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; BGE_LOCK_ASSERT(sc); ifp = sc->bge_ifp; - if ((sc->bge_flags & BGE_FLAG_TBI) == 0) - mii = device_get_softc(sc->bge_miibus); - callout_stop(&sc->bge_stat_ch); /* Disable host interrupts. */ @@ -4672,27 +4666,6 @@ bge_stop(struct bge_softc *sc) /* Free TX buffers. */ bge_free_tx_ring(sc); - /* - * Isolate/power down the PHY, but leave the media selection - * unchanged so that things will be put back to normal when - * we bring the interface back up. - */ - if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { - itmp = ifp->if_flags; - ifp->if_flags |= IFF_UP; - /* - * If we are called from bge_detach(), mii is already NULL. - */ - if (mii != NULL) { - ifm = mii->mii_media.ifm_cur; - mtmp = ifm->ifm_media; - ifm->ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm->ifm_media = mtmp; - } - ifp->if_flags = itmp; - } - sc->bge_tx_saved_considx = BGE_TXCONS_UNSET; /* Clear MAC's link state (PHY may still have link UP). */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:26:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD3731065670; Mon, 7 Dec 2009 19:26:54 +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 B20618FC0A; Mon, 7 Dec 2009 19:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB7JQsFg063485; Mon, 7 Dec 2009 19:26:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7JQsWk063483; Mon, 7 Dec 2009 19:26:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912071926.nB7JQsWk063483@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 7 Dec 2009 19:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200228 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:26:55 -0000 Author: yongari Date: Mon Dec 7 19:26:54 2009 New Revision: 200228 URL: http://svn.freebsd.org/changeset/base/200228 Log: Don't access jumbo frame related registers if controller lacks the feature. These registers are reserved on controllers that have no support for jumbo frame. Only BCM5700 has mini ring so do not poke mini ring related registers if controller is not BCM5700. Reviewed by: marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Dec 7 19:18:23 2009 (r200227) +++ head/sys/dev/bge/if_bge.c Mon Dec 7 19:26:54 2009 (r200228) @@ -1618,11 +1618,13 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_NICADDR, rcb->bge_nicaddr); /* Set up dummy disabled mini ring RCB */ - 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); + 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); + } } /* @@ -1642,7 +1644,9 @@ bge_blockinit(struct bge_softc *sc) else val = BGE_STD_RX_RING_CNT / 8; CSR_WRITE_4(sc, BGE_RBDI_STD_REPL_THRESH, val); - CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, BGE_JUMBO_RX_RING_CNT/8); + if (BGE_IS_JUMBO_CAPABLE(sc)) + CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, + BGE_JUMBO_RX_RING_CNT/8); /* * Disable all unused send rings by setting the 'ring disabled' @@ -1684,8 +1688,10 @@ bge_blockinit(struct bge_softc *sc) /* Initialize RX ring indexes */ bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, 0); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); - bge_writembx(sc, BGE_MBX_RX_MINI_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 From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:29:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA61106568B for ; Mon, 7 Dec 2009 19:29:08 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id F2EBB8FC1D for ; Mon, 7 Dec 2009 19:29:07 +0000 (UTC) Received: from vampire.homelinux.org (dslb-088-064-179-227.pools.arcor-ip.net [88.64.179.227]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MErUc-1NKVEe3HXG-00GO8j; Mon, 07 Dec 2009 20:29:06 +0100 Received: (qmail 26035 invoked from network); 7 Dec 2009 19:29:06 -0000 Received: from f8x64.laiers.local (192.168.4.188) by ns1.laiers.local with SMTP; 7 Dec 2009 19:29:06 -0000 From: Max Laier Organization: FreeBSD To: Julian Elischer , Lytochkin Boris Date: Mon, 7 Dec 2009 20:29:05 +0100 User-Agent: KMail/1.12.1 (FreeBSD/8.0-RELEASE; KDE/4.3.1; amd64; ; ) References: <200912061804.nB6I4R38027652@svn.freebsd.org> <4B1D437F.4050601@elischer.org> <4B1D4723.5090908@elischer.org> In-Reply-To: <4B1D4723.5090908@elischer.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200912072029.05907.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18Cn2Ku8RxOIbKznJ7ACPzIG9E190+IsqMUbDD KGLzZJNWqGre5omtHK8eqvcgJaw/pCbXe5WrEIfOWDPiUOmeBl y/ezdOEb4A5+uyVUdtKAg== Cc: Ermal =?iso-8859-1?q?Lu=E7i?= , svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:29:08 -0000 On Monday 07 December 2009 19:19:15 Julian Elischer wrote: > Julian Elischer wrote: > > Ermal Lu=E7i wrote: > >> On Mon, Dec 7, 2009 at 5:31 AM, Max Laier > > > [...] > > > >> > Do you have a reference for me? > >> > >> I followed the thread but route-to sets the sin_len see this: > >> http://fxr.watson.org/fxr/source/contrib/pf/net/pf.c?v=3DFREEBSD8#L6179 > > > > So if it really is broken, then there must be something else wrong with > > it. >=20 > by which I mean, someone who used pf should check if it really is > broken. We only have the word of the guy who reported the problem with > ipfw that pf "had the same problem". I just tested an install of r197983 (9.0-CURRENT) that I had on a test-box = and=20 route-to works as it is supposed to - AFAICT. FWIW, pf sets sin_len for ev= ery=20 use. Might be a problem/mis-understanding in the OPs configuration that is the=20 issue here? I'll follow up to the thread on -net@ is a second. =2D- Max From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 19:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE2F61065672; Mon, 7 Dec 2009 19:59:28 +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 DADDD8FC13; Mon, 7 Dec 2009 19:59: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 nB7JxSBc064205; Mon, 7 Dec 2009 19:59:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7JxS6C064200; Mon, 7 Dec 2009 19:59:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912071959.nB7JxS6C064200@svn.freebsd.org> From: Xin LI Date: Mon, 7 Dec 2009 19:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200229 - in stable/8: lib/libc/sys sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 19:59:29 -0000 Author: delphij Date: Mon Dec 7 19:59:28 2009 New Revision: 200229 URL: http://svn.freebsd.org/changeset/base/200229 Log: MFC revision 197579 and 199617: Add two new fcntls to enable/disable read-ahead: - F_READAHEAD: specify the amount for sequential access. The amount is specified in bytes and is rounded up to nearest block size. - F_RDAHEAD: Darwin compatible version that use 128KB as the sequential access size. A third argument of zero disables the read-ahead behavior. Please note that the read-ahead amount is also constrainted by sysctl variable, vfs.read_max, which may need to be raised in order to better utilize this feature. Thanks Igor Sysoev for proposing the feature and submitting the original version, and kib@ for his valuable comments. Modified: stable/8/lib/libc/sys/fcntl.2 stable/8/sys/kern/kern_descrip.c stable/8/sys/kern/vfs_vnops.c stable/8/sys/sys/fcntl.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/lib/libc/sys/fcntl.2 ============================================================================== --- stable/8/lib/libc/sys/fcntl.2 Mon Dec 7 19:26:54 2009 (r200228) +++ stable/8/lib/libc/sys/fcntl.2 Mon Dec 7 19:59:28 2009 (r200229) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd March 8, 2008 +.Dd September 28, 2009 .Dt FCNTL 2 .Os .Sh NAME @@ -241,6 +241,22 @@ will be interrupted if the signal handle .Dv SA_RESTART (see .Xr sigaction 2 ) . +.It Dv F_READAHEAD +Set or clear the read ahead amount for sequential access to the third +argument, +.Fa arg , +which is rounded up to the nearest block size. +A zero value in +.Fa arg +turns off read ahead. +.It Dv F_RDAHEAD +Equivalent to Darwin counterpart which sets read ahead amount of 128KB +when the third argument, +.Fa arg +is non-zero. +A zero value in +.Fa arg +turns off read ahead. .El .Pp When a shared lock has been set on a segment of a file, Modified: stable/8/sys/kern/kern_descrip.c ============================================================================== --- stable/8/sys/kern/kern_descrip.c Mon Dec 7 19:26:54 2009 (r200228) +++ stable/8/sys/kern/kern_descrip.c Mon Dec 7 19:59:28 2009 (r200229) @@ -421,6 +421,8 @@ kern_fcntl(struct thread *td, int fd, in struct vnode *vp; int error, flg, tmp; int vfslocked; + u_int old, new; + uint64_t bsize; vfslocked = 0; error = 0; @@ -686,6 +688,49 @@ kern_fcntl(struct thread *td, int fd, in vfslocked = 0; fdrop(fp, td); break; + + case F_RDAHEAD: + arg = arg ? 128 * 1024: 0; + /* FALLTHROUGH */ + case F_READAHEAD: + FILEDESC_SLOCK(fdp); + if ((fp = fdtofp(fd, fdp)) == NULL) { + FILEDESC_SUNLOCK(fdp); + error = EBADF; + break; + } + if (fp->f_type != DTYPE_VNODE) { + FILEDESC_SUNLOCK(fdp); + error = EBADF; + break; + } + fhold(fp); + FILEDESC_SUNLOCK(fdp); + if (arg != 0) { + vp = fp->f_vnode; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + error = vn_lock(vp, LK_SHARED); + if (error != 0) + goto readahead_vnlock_fail; + bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize; + VOP_UNLOCK(vp, 0); + fp->f_seqcount = (arg + bsize - 1) / bsize; + do { + new = old = fp->f_flag; + new |= FRDAHEAD; + } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); +readahead_vnlock_fail: + VFS_UNLOCK_GIANT(vfslocked); + vfslocked = 0; + } else { + do { + new = old = fp->f_flag; + new &= ~FRDAHEAD; + } while (!atomic_cmpset_rel_int(&fp->f_flag, old, new)); + } + fdrop(fp, td); + break; + default: error = EINVAL; break; Modified: stable/8/sys/kern/vfs_vnops.c ============================================================================== --- stable/8/sys/kern/vfs_vnops.c Mon Dec 7 19:26:54 2009 (r200228) +++ stable/8/sys/kern/vfs_vnops.c Mon Dec 7 19:59:28 2009 (r200229) @@ -312,6 +312,9 @@ static int sequential_heuristic(struct uio *uio, struct file *fp) { + if (atomic_load_acq_int(&(fp->f_flag)) & FRDAHEAD) + return (fp->f_seqcount << IO_SEQSHIFT); + /* * Offset 0 is handled specially. open() sets f_seqcount to 1 so * that the first I/O is normally considered to be slightly Modified: stable/8/sys/sys/fcntl.h ============================================================================== --- stable/8/sys/sys/fcntl.h Mon Dec 7 19:26:54 2009 (r200228) +++ stable/8/sys/sys/fcntl.h Mon Dec 7 19:59:28 2009 (r200229) @@ -140,7 +140,7 @@ typedef __pid_t pid_t; /* bits to save after open */ #define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT|FEXEC) /* bits settable by fcntl(F_SETFL, ...) */ -#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|O_DIRECT) +#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FRDAHEAD|O_DIRECT) #if defined(COMPAT_FREEBSD7) || defined(COMPAT_FREEBSD6) || \ defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) @@ -151,7 +151,8 @@ typedef __pid_t pid_t; */ #define FPOSIXSHM O_NOFOLLOW #undef FCNTLFLAGS -#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|O_DIRECT) +#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM|FRDAHEAD| \ + O_DIRECT) #endif #endif @@ -176,6 +177,8 @@ typedef __pid_t pid_t; * different meaning for fcntl(2). */ #if __BSD_VISIBLE +/* Read ahead */ +#define FRDAHEAD O_CREAT #endif /* Defined by POSIX Extended API Set Part 2 */ @@ -218,6 +221,8 @@ typedef __pid_t pid_t; #define F_SETLK 12 /* set record locking information */ #define F_SETLKW 13 /* F_SETLK; wait if blocked */ #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ +#define F_READAHEAD 15 /* read ahead */ +#define F_RDAHEAD 16 /* Darwin compatible read ahead */ /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:05:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 891E71065679; Mon, 7 Dec 2009 20:05:02 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE158FC18; Mon, 7 Dec 2009 20:05: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 nB7K52LA064381; Mon, 7 Dec 2009 20:05:02 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7K52E1064378; Mon, 7 Dec 2009 20:05:02 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912072005.nB7K52E1064378@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 7 Dec 2009 20:05: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: r200230 - in head/sys/dev: puc uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:05:02 -0000 Author: marcel Date: Mon Dec 7 20:05:02 2009 New Revision: 200230 URL: http://svn.freebsd.org/changeset/base/200230 Log: Add support for the NetMos NM9865 family of Serial/Parallel ports. Obtained from: NetMos MCS9865 v1.0.0.1 driver MFC after: 3 days Modified: head/sys/dev/puc/pucdata.c head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Mon Dec 7 19:59:28 2009 (r200229) +++ head/sys/dev/puc/pucdata.c Mon Dec 7 20:05:02 2009 (r200230) @@ -168,10 +168,10 @@ const struct puc_cfg puc_pci_devices[] = { 0x10e8, 0x818e, 0xffff, 0, "Applied Micro Circuits 8 Port UART", - DEFAULT_RCLK, - PUC_PORT_8S, 0x14, -1, -1, + DEFAULT_RCLK, + PUC_PORT_8S, 0x14, -1, -1, .config_function = puc_config_amc - }, + }, { 0x11fe, 0x8010, 0xffff, 0, "Comtrol RocketPort 550/8 RJ11 part A", @@ -808,6 +808,42 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S1P, 0x10, 4, 0, }, + { 0x9710, 0x9865, 0xa000, 0x3002, + "NetMos NM9865 Dual UART", + DEFAULT_RCLK, + PUC_PORT_2S, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3003, + "NetMos NM9865 Triple UART", + DEFAULT_RCLK, + PUC_PORT_3S, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3004, + "NetMos NM9865 Quad UART", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0,0 + }, + + { 0x9710, 0x9865, 0xa000, 0x3011, + "NetMos NM9865 Single UART and 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_1S1P, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3012, + "NetMos NM9865 Dual UART and 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_2S1P, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3020, + "NetMos NM9865 Dual 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_2P, 0x10, 4, 0, + }, + { 0xb00c, 0x021c, 0xffff, 0, "IC Book Labs Gunboat x4 Lite", DEFAULT_RCLK, Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Mon Dec 7 19:59:28 2009 (r200229) +++ head/sys/dev/uart/uart_bus_pci.c Mon Dec 7 20:05:02 2009 (r200230) @@ -111,6 +111,7 @@ static struct pci_id pci_ns8250_ids[] = 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, +{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:11:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 308E61065676; Mon, 7 Dec 2009 20:11:53 +0000 (UTC) (envelope-from lytboris@gmail.com) Received: from mail-fx0-f209.google.com (mail-fx0-f209.google.com [209.85.220.209]) by mx1.freebsd.org (Postfix) with ESMTP id 77C9A8FC12; Mon, 7 Dec 2009 20:11:51 +0000 (UTC) Received: by fxm2 with SMTP id 2so2387229fxm.13 for ; Mon, 07 Dec 2009 12:11:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tQbFyu7qaprnsDlmCNTqjOu9MU1yftFtmRn9FL0ifM4=; b=ANGt7Se9zyMm9ZITJCUjrPouniMW2FokoyWjMp8Nxj8k15vVzE0QAgy6t73lpdKcn0 TtapSZFdsL5pDeRZDPSKYp/coKiiNeq7TLrYUf/jvTqHHPZjfG6ebNmKqf0GFiYVOZI+ QXylOHYBixhia3SULNNpewfodWniP7cnjWtRc= 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=sfVYKLnjHvHx7KSi8GE4UnzFcQtWIlnOZo61JcNy2EMabRofApID41uot2VN53ZBrB elDgsAiSSqKpEG717w2N4Tg27mS8HjXjO6FrITobvlbHn0ZqpAPutv2262oJ+NL1aAyj N5FPtqRuwFqgyWE4/bt2XjjDWq9C9Ukpsv/Bw= MIME-Version: 1.0 Received: by 10.239.141.131 with SMTP id c3mr832592hba.44.1260215143294; Mon, 07 Dec 2009 11:45:43 -0800 (PST) In-Reply-To: <200912072029.05907.max@love2party.net> References: <200912061804.nB6I4R38027652@svn.freebsd.org> <4B1D437F.4050601@elischer.org> <4B1D4723.5090908@elischer.org> <200912072029.05907.max@love2party.net> Date: Mon, 7 Dec 2009 22:45:43 +0300 Message-ID: <933fa9790912071145k4d97c177qc6f963ba0ffbb13@mail.gmail.com> From: Lytochkin Boris To: Max Laier Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Julian Elischer , sem@freebsd.org, =?ISO-8859-1?Q?Ermal_Lu=E7i?= Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:11:53 -0000 Hi! On Mon, Dec 7, 2009 at 10:29 PM, Max Laier wrote: [cut] > I just tested an install of r197983 (9.0-CURRENT) that I had on a test-bo= x and > route-to works as it is supposed to - AFAICT. =A0FWIW, pf sets sin_len fo= r every > use. > > Might be a problem/mis-understanding in the OPs configuration that is the > issue here? > > I'll follow up to the thread on -net@ is a second. I posted my pf config in original message to -net@: =3D=3D=3D=3D=3D scrub in all fragment reassemble pass in all flags S/SA keep state pass out quick route-to (em0 10.60.128.254) inet from 10.60.128.0/24 to any flags S/SA keep state =3D=3D=3D=3D=3D Pretty simple. Even when forward is disabled packets that are matched by route-to rule are forwarded to default gateway instead of specified in route-to. And I checked rtalloc_ign_fib() arguments when using pf - seems that pf does not use this function to lookup route-to route. +sem@ --=20 Regards, Boris Lytochkin From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:17:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE09106566B; Mon, 7 Dec 2009 20:17:34 +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 0E9138FC21; Mon, 7 Dec 2009 20:17: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 nB7KHX1G064720; Mon, 7 Dec 2009 20:17:33 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KHXYi064718; Mon, 7 Dec 2009 20:17:33 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912072017.nB7KHXYi064718@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 7 Dec 2009 20:17: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: r200231 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:17:34 -0000 Author: jkim Date: Mon Dec 7 20:17:33 2009 New Revision: 200231 URL: http://svn.freebsd.org/changeset/base/200231 Log: Make mfi(4) little bit less chatty. Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Mon Dec 7 20:05:02 2009 (r200230) +++ head/sys/dev/mfi/mfi.c Mon Dec 7 20:17:33 2009 (r200231) @@ -1081,9 +1081,22 @@ static void mfi_decode_evt(struct mfi_softc *sc, struct mfi_evt_detail *detail) { - device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", detail->seq, - format_timestamp(detail->time), detail->class.members.locale, - format_class(detail->class.members.class), detail->description); + switch (detail->class.members.class) { + case MFI_EVT_CLASS_DEBUG: + case MFI_EVT_CLASS_PROGRESS: + case MFI_EVT_CLASS_INFO: +#ifndef MFI_DEBUG + if (!bootverbose) + return; + /* FALLTHROUGH */ +#endif + default: + device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", + detail->seq, format_timestamp(detail->time), + detail->class.members.locale, + format_class(detail->class.members.class), + detail->description); + } } static int From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:19:01 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B451065694; Mon, 7 Dec 2009 20:19:01 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 25E7D8FC28; Mon, 7 Dec 2009 20:19:00 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id nB7KHjE4077310; Mon, 7 Dec 2009 14:17:45 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id nB7KHjH9077309; Mon, 7 Dec 2009 14:17:45 -0600 (CST) (envelope-from brooks) Date: Mon, 7 Dec 2009 14:17:44 -0600 From: Brooks Davis To: Luigi Rizzo Message-ID: <20091207201744.GA77256@lor.one-eyed-alien.net> References: <200912061901.nB6J1X7L028816@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <200912061901.nB6J1X7L028816@svn.freebsd.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 07 Dec 2009 14:17:45 -0600 (CST) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r200184 - stable/8/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:19:01 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 06, 2009 at 07:01:33PM +0000, Luigi Rizzo wrote: > Author: luigi > Date: Sun Dec 6 19:01:33 2009 > New Revision: 200184 > URL: http://svn.freebsd.org/changeset/base/200184 >=20 > Log: > mfc r200056 > use qsort_r instead of heapsort; This seems like a move in the wrong direction. The use of a recursive algorithm in the kernel seems generally ill-advised and I was rather disturbed when I found we had a quick sort implementation in libkern. Unless you know the number of items is small, quick sort isn't safe and if the number is small, heap sort is plenty efficient. -- Brooks --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLHWLoXY6L6fI4GtQRArluAJ9dOCmyxtl1sioZn6e4akpWFqD1wwCgrnc9 OUdu3HYsdlTRtnocrHF6/y8= =VNea -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:21:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5362B106568B; Mon, 7 Dec 2009 20:21:29 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-yw0-f194.google.com (mail-yw0-f194.google.com [209.85.211.194]) by mx1.freebsd.org (Postfix) with ESMTP id 1E1FB8FC1C; Mon, 7 Dec 2009 20:21:27 +0000 (UTC) Received: by ywh32 with SMTP id 32so5041518ywh.14 for ; Mon, 07 Dec 2009 12:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=0LpZ4wbR++bQ9amEMw0mQ1ZGcdPAE+IVrxk1Y3PImY0=; b=atd3vc82eRQYuRi2gcO35mQTRWX7YBbwc21X8UubI6wcJW+9ZdzakgDUhZZGv90t9k 18txnq+52C6gi/k8c5e/53Phad9reS66lFEAR4ZkpxV2xpQa3tq9CIMctc+BlZtZFGU0 htA5q5Vv+hbXTtWphVwZ8zaqfSnmZ3JYkmI2o= 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=SSo9YNdMewkp7F5DeUoCoSMQihnH4qGdRIozaPmgeFrIcYxoZxdFDdHfctNX0lA02K xwC4f06A4kXhHEoPj9lJ9p5BNzMHSp2WpL/Hso8WQU6pVjpL7kMC/N+6L440qkxJZpjb 8eT7JhrCXBYjOM8e9nRAM7klmjaZC35R/UAqE= MIME-Version: 1.0 Sender: ermal.luci@gmail.com Received: by 10.150.163.2 with SMTP id l2mr12115120ybe.272.1260217287273; Mon, 07 Dec 2009 12:21:27 -0800 (PST) In-Reply-To: <933fa9790912071145k4d97c177qc6f963ba0ffbb13@mail.gmail.com> References: <200912061804.nB6I4R38027652@svn.freebsd.org> <4B1D437F.4050601@elischer.org> <4B1D4723.5090908@elischer.org> <200912072029.05907.max@love2party.net> <933fa9790912071145k4d97c177qc6f963ba0ffbb13@mail.gmail.com> From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Date: Mon, 7 Dec 2009 21:21:07 +0100 X-Google-Sender-Auth: 88543358c04e9550 Message-ID: <9a542da30912071221t289a57a8gdfbb12c8a0b84753@mail.gmail.com> To: Lytochkin Boris Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Julian Elischer , sem@freebsd.org, svn-src-head@freebsd.org, Max Laier Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:21:29 -0000 On Mon, Dec 7, 2009 at 8:45 PM, Lytochkin Boris wrote: > Hi! > > On Mon, Dec 7, 2009 at 10:29 PM, Max Laier wrote: > [cut] > > I just tested an install of r197983 (9.0-CURRENT) that I had on a > test-box and > > route-to works as it is supposed to - AFAICT. FWIW, pf sets sin_len for > every > > use. > > > > Might be a problem/mis-understanding in the OPs configuration that is the > > issue here? > > > > I'll follow up to the thread on -net@ is a second. > > I posted my pf config in original message to -net@: > ===== > scrub in all fragment reassemble > pass in all flags S/SA keep state > pass out quick route-to (em0 10.60.128.254) inet from 10.60.128.0/24 > to any flags S/SA keep state > ===== > > Pretty simple. Even when forward is disabled packets that are matched > by route-to rule are forwarded to default gateway instead of specified > in route-to. And I checked rtalloc_ign_fib() arguments when using pf - > seems that pf does not use this function to lookup route-to route. > > +sem@ > > My crystal ball is broken. Explain your freebsd config, your network topology, some debug output and then it can be considered useful. There are many people using route-to on FreeBSD 8 so it would have come up before. > -- > Regards, > Boris Lytochkin > -- Ermal From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:30:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D8F61065672; Mon, 7 Dec 2009 20:30:10 +0000 (UTC) (envelope-from lytboris@gmail.com) Received: from mail-fx0-f209.google.com (mail-fx0-f209.google.com [209.85.220.209]) by mx1.freebsd.org (Postfix) with ESMTP id 3AFB88FC20; Mon, 7 Dec 2009 20:30:08 +0000 (UTC) Received: by fxm2 with SMTP id 2so2406751fxm.13 for ; Mon, 07 Dec 2009 12:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Jlu1s65EUPHenQtN3u+2106//iQMLkxNi/EwmUuV8HM=; b=EpmHixb5OoSnyP5ZvMZSqUIu6lQ3aMEGhPO95YY00NtI34hfPP3auF4PK+YFfDyk+X O3cLiGVCI/pdiddX+zt4G93RFtDEeHCNOYWiu3T1sgtkL+N6+aljLYD1STqJFXptb1o8 646EmzvAgzNyqD1HzirD/hbQFWImmuTvLb5os= 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=s6EkP2ZCqU9Aq85J66fPS7MOi77QmdupK3iSCMBLcf+KdHHiw+1wQxaPuQuT3aSpsz I35f2hgOcnnLzpputcMGjkjj29oIJAw45JaZ5ardJNURkOgYpYG470fFdc+sU2jo15uC +ZmY6opuJqsr3GorKvVnbnCYP6jj4w9+wzGnk= MIME-Version: 1.0 Received: by 10.239.139.6 with SMTP id r6mr627387hbr.205.1260217807132; Mon, 07 Dec 2009 12:30:07 -0800 (PST) In-Reply-To: <9a542da30912071221t289a57a8gdfbb12c8a0b84753@mail.gmail.com> References: <200912061804.nB6I4R38027652@svn.freebsd.org> <4B1D437F.4050601@elischer.org> <4B1D4723.5090908@elischer.org> <200912072029.05907.max@love2party.net> <933fa9790912071145k4d97c177qc6f963ba0ffbb13@mail.gmail.com> <9a542da30912071221t289a57a8gdfbb12c8a0b84753@mail.gmail.com> Date: Mon, 7 Dec 2009 23:30:07 +0300 Message-ID: <933fa9790912071230n56f27f5bhcdec44d22a1c5126@mail.gmail.com> From: Lytochkin Boris To: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Julian Elischer , sem@freebsd.org, svn-src-head@freebsd.org, Max Laier Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:30:10 -0000 there are multiple addresses on em0 (for example): 95.108.197.225/27 10.60.128.225/24 10.61.128.225/24 ... 10.70.128.225/24 default router is in 95.108.197.225/27 network. 10.X addresses are used for SLB - SLB router does DNAT and forward client's connection to this node, so node should forward all packets from 10.X addresses to .254 - SLB router IPs. ipfw config would be something like =3D=3D=3D=3D ipfw add 60 fwd 10.60.128.254 ip from 10.60.128.0/24 to any out ipfw add 61 fwd 10.61.128.254 ip from 10.61.128.0/24 to any out ... ipfw add 70 fwd 10.70.128.254 ip from 10.70.128.0/24 to any out allow 65534 ip from any to any =3D=3D=3D=3D pf variant will be accordingly =3D=3D=3D=3D scrub in all fragment reassemble pass in all flags S/SA keep state pass out quick route-to (em0 10.60.128.254) inet from 10.60.128.0/24 to any flags S/SA keep state ... pass out quick route-to (em0 10.60.128.254) inet from 10.70.128.0/24 to any flags S/SA keep state =3D=3D=3D=3D My box is a cluster node, not router, just simple policy-based routing requ= ired On Mon, Dec 7, 2009 at 11:21 PM, Ermal Lu=E7i wrote: > > > On Mon, Dec 7, 2009 at 8:45 PM, Lytochkin Boris wrot= e: >> >> Hi! >> >> On Mon, Dec 7, 2009 at 10:29 PM, Max Laier wrote: >> [cut] >> > I just tested an install of r197983 (9.0-CURRENT) that I had on a >> > test-box and >> > route-to works as it is supposed to - AFAICT. =A0FWIW, pf sets sin_len= for >> > every >> > use. >> > >> > Might be a problem/mis-understanding in the OPs configuration that is >> > the >> > issue here? >> > >> > I'll follow up to the thread on -net@ is a second. >> >> I posted my pf config in original message to -net@: >> =3D=3D=3D=3D=3D >> scrub in all fragment reassemble >> pass in all flags S/SA keep state >> pass out quick route-to (em0 10.60.128.254) inet from 10.60.128.0/24 >> to any flags S/SA keep state >> =3D=3D=3D=3D=3D >> >> Pretty simple. Even when forward is disabled packets that are matched >> by route-to rule are forwarded to default gateway instead of specified >> in route-to. And I checked rtalloc_ign_fib() arguments when using pf - >> seems that pf does not use this function to lookup route-to route. >> >> +sem@ >> > > My crystal ball is broken. > Explain your freebsd config, your network topology, some debug output and > then it can be considered useful. > > There are many people using route-to on FreeBSD 8 so it would have come u= p > before. > >> >> -- >> Regards, >> Boris Lytochkin > > > > -- > Ermal > From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:40:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC00D106566B; Mon, 7 Dec 2009 20:40:48 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9DAD8FC14; Mon, 7 Dec 2009 20:40: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 nB7Kem3w065297; Mon, 7 Dec 2009 20:40:48 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KemoR065295; Mon, 7 Dec 2009 20:40:48 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912072040.nB7KemoR065295@svn.freebsd.org> From: Fabien Thomas Date: Mon, 7 Dec 2009 20:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200232 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:40:49 -0000 Author: fabient Date: Mon Dec 7 20:40:48 2009 New Revision: 200232 URL: http://svn.freebsd.org/changeset/base/200232 Log: MFC 198432: Only claim that the PMC_CLASS_IAF PMCs are supported by a CPU if there are PMCs on the CPU that belong to the class. Modified: stable/8/sys/dev/hwpmc/hwpmc_core.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_core.c Mon Dec 7 20:17:33 2009 (r200231) +++ stable/8/sys/dev/hwpmc/hwpmc_core.c Mon Dec 7 20:40:48 2009 (r200232) @@ -1954,11 +1954,21 @@ pmc_core_initialize(struct pmc_mdep *md, core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F; core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF; - iaf_initialize(md, maxcpu, core_iaf_npmc, core_iaf_width); - - core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << - IAF_OFFSET; - + if (core_iaf_npmc > 0) { + iaf_initialize(md, maxcpu, core_iaf_npmc, + core_iaf_width); + core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << + IAF_OFFSET; + } else { + /* + * Adjust the number of classes exported to + * user space. + */ + md->pmd_nclass--; + KASSERT(md->pmd_nclass == 2, + ("[core,%d] unexpected nclass %d", __LINE__, + md->pmd_nclass)); + } } PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask, From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:44:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4954C106566C; Mon, 7 Dec 2009 20:44:44 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3723D8FC14; Mon, 7 Dec 2009 20:44: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 nB7KiiD2065454; Mon, 7 Dec 2009 20:44:44 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KiiS0065452; Mon, 7 Dec 2009 20:44:44 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912072044.nB7KiiS0065452@svn.freebsd.org> From: Fabien Thomas Date: Mon, 7 Dec 2009 20:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200233 - stable/8/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:44:44 -0000 Author: fabient Date: Mon Dec 7 20:44:43 2009 New Revision: 200233 URL: http://svn.freebsd.org/changeset/base/200233 Log: MFC 198433: Not all Intel Core (TM) CPUs implement PMC_CLASS_IAF fixed-function counters. For such CPUs, use an alternate mapping of convenience names to events supported by PMC_CLASS_IAP programmable counters. Modified: stable/8/lib/libpmc/libpmc.c Directory Properties: stable/8/lib/libpmc/ (props changed) Modified: stable/8/lib/libpmc/libpmc.c ============================================================================== --- stable/8/lib/libpmc/libpmc.c Mon Dec 7 20:40:48 2009 (r200232) +++ stable/8/lib/libpmc/libpmc.c Mon Dec 7 20:44:43 2009 (r200233) @@ -442,6 +442,10 @@ static struct pmc_event_alias core_alias /* * Intel Core2 (Family 6, Model F), Core2Extreme (Family 6, Model 17H) * and Atom (Family 6, model 1CH) PMCs. + * + * We map aliases to events on the fixed-function counters if these + * are present. Note that not all CPUs in this family contain fixed-function + * counters. */ static struct pmc_event_alias core2_aliases[] = { @@ -454,8 +458,22 @@ static struct pmc_event_alias core2_alia EV_ALIAS("unhalted-cycles", "iaf-cpu-clk-unhalted.core"), EV_ALIAS(NULL, NULL) }; -#define atom_aliases core2_aliases -#define corei7_aliases core2_aliases + +static struct pmc_event_alias core2_aliases_without_iaf[] = { + EV_ALIAS("branches", "iap-br-inst-retired.any"), + EV_ALIAS("branch-mispredicts", "iap-br-inst-retired.mispred"), + EV_ALIAS("cycles", "tsc-tsc"), + EV_ALIAS("ic-misses", "iap-l1i-misses"), + EV_ALIAS("instructions", "iap-inst-retired.any_p"), + EV_ALIAS("interrupts", "iap-hw-int-rcv"), + EV_ALIAS("unhalted-cycles", "iap-cpu-clk-unhalted.core_p"), + EV_ALIAS(NULL, NULL) +}; + +#define atom_aliases core2_aliases +#define atom_aliases_without_iaf core2_aliases_without_iaf +#define corei7_aliases core2_aliases +#define corei7_aliases_without_iaf core2_aliases_without_iaf #define IAF_KW_OS "os" #define IAF_KW_USR "usr" @@ -2379,6 +2397,10 @@ pmc_init(void) uint32_t abi_version; struct module_stat pmc_modstat; struct pmc_op_getcpuinfo op_cpu_info; +#if defined(__amd64__) || defined(__i386__) + int cpu_has_iaf_counters; + unsigned int t; +#endif if (pmc_syscall != -1) /* already inited */ return (0); @@ -2420,6 +2442,8 @@ pmc_init(void) if (pmc_class_table == NULL) return (-1); + for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++) + pmc_class_table[n] = NULL; /* * Fill in the class table. @@ -2427,6 +2451,14 @@ pmc_init(void) n = 0; #if defined(__amd64__) || defined(__i386__) pmc_class_table[n++] = &tsc_class_table_descr; + + /* + * Check if this CPU has fixed function counters. + */ + cpu_has_iaf_counters = 0; + for (t = 0; t < cpu_info.pm_nclass; t++) + if (cpu_info.pm_classes[t].pm_class == PMC_CLASS_IAF) + cpu_has_iaf_counters = 1; #endif #define PMC_MDEP_INIT(C) do { \ @@ -2436,6 +2468,16 @@ pmc_init(void) PMC_TABLE_SIZE(C##_pmc_classes); \ } while (0) +#define PMC_MDEP_INIT_INTEL_V2(C) do { \ + PMC_MDEP_INIT(C); \ + if (cpu_has_iaf_counters) \ + pmc_class_table[n++] = &iaf_class_table_descr; \ + else \ + pmc_mdep_event_aliases = \ + C##_aliases_without_iaf; \ + pmc_class_table[n] = &C##_class_table_descr; \ + } while (0) + /* Configure the event name parser. */ switch (cpu_info.pm_cputype) { #if defined(__i386__) @@ -2461,24 +2503,17 @@ pmc_init(void) pmc_class_table[n] = &k8_class_table_descr; break; case PMC_CPU_INTEL_ATOM: - PMC_MDEP_INIT(atom); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &atom_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(atom); break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); - pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: - PMC_MDEP_INIT(core2); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &core2_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(core2); break; case PMC_CPU_INTEL_COREI7: - PMC_MDEP_INIT(corei7); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &corei7_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(corei7); break; case PMC_CPU_INTEL_PIV: PMC_MDEP_INIT(p4); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:46:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BA12106566C; Mon, 7 Dec 2009 20:46:22 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7964E8FC13; Mon, 7 Dec 2009 20:46: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 nB7KkMvp065538; Mon, 7 Dec 2009 20:46:22 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KkMNP065536; Mon, 7 Dec 2009 20:46:22 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912072046.nB7KkMNP065536@svn.freebsd.org> From: Fabien Thomas Date: Mon, 7 Dec 2009 20:46:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200234 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:46:22 -0000 Author: fabient Date: Mon Dec 7 20:46:22 2009 New Revision: 200234 URL: http://svn.freebsd.org/changeset/base/200234 Log: MFC 198432: Only claim that the PMC_CLASS_IAF PMCs are supported by a CPU if there are PMCs on the CPU that belong to the class. Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_core.c Mon Dec 7 20:44:43 2009 (r200233) +++ stable/7/sys/dev/hwpmc/hwpmc_core.c Mon Dec 7 20:46:22 2009 (r200234) @@ -1954,11 +1954,21 @@ pmc_core_initialize(struct pmc_mdep *md, core_iaf_npmc = cpuid[CORE_CPUID_EDX] & 0x1F; core_iaf_width = (cpuid[CORE_CPUID_EDX] >> 5) & 0xFF; - iaf_initialize(md, maxcpu, core_iaf_npmc, core_iaf_width); - - core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << - IAF_OFFSET; - + if (core_iaf_npmc > 0) { + iaf_initialize(md, maxcpu, core_iaf_npmc, + core_iaf_width); + core_pmcmask |= ((1ULL << core_iaf_npmc) - 1) << + IAF_OFFSET; + } else { + /* + * Adjust the number of classes exported to + * user space. + */ + md->pmd_nclass--; + KASSERT(md->pmd_nclass == 2, + ("[core,%d] unexpected nclass %d", __LINE__, + md->pmd_nclass)); + } } PMCDBG(MDP,INI,1,"core-init pmcmask=0x%jx iafri=%d", core_pmcmask, From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:47:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83E44106566C; Mon, 7 Dec 2009 20:47:33 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71C6F8FC08; Mon, 7 Dec 2009 20:47: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 nB7KlXxQ065612; Mon, 7 Dec 2009 20:47:33 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KlXVp065610; Mon, 7 Dec 2009 20:47:33 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912072047.nB7KlXVp065610@svn.freebsd.org> From: Fabien Thomas Date: Mon, 7 Dec 2009 20:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200235 - stable/7/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:47:33 -0000 Author: fabient Date: Mon Dec 7 20:47:33 2009 New Revision: 200235 URL: http://svn.freebsd.org/changeset/base/200235 Log: MFC 198433: Not all Intel Core (TM) CPUs implement PMC_CLASS_IAF fixed-function counters. For such CPUs, use an alternate mapping of convenience names to events supported by PMC_CLASS_IAP programmable counters. Modified: stable/7/lib/libpmc/libpmc.c Directory Properties: stable/7/lib/libpmc/ (props changed) Modified: stable/7/lib/libpmc/libpmc.c ============================================================================== --- stable/7/lib/libpmc/libpmc.c Mon Dec 7 20:46:22 2009 (r200234) +++ stable/7/lib/libpmc/libpmc.c Mon Dec 7 20:47:33 2009 (r200235) @@ -442,6 +442,10 @@ static struct pmc_event_alias core_alias /* * Intel Core2 (Family 6, Model F), Core2Extreme (Family 6, Model 17H) * and Atom (Family 6, model 1CH) PMCs. + * + * We map aliases to events on the fixed-function counters if these + * are present. Note that not all CPUs in this family contain fixed-function + * counters. */ static struct pmc_event_alias core2_aliases[] = { @@ -454,8 +458,22 @@ static struct pmc_event_alias core2_alia EV_ALIAS("unhalted-cycles", "iaf-cpu-clk-unhalted.core"), EV_ALIAS(NULL, NULL) }; -#define atom_aliases core2_aliases -#define corei7_aliases core2_aliases + +static struct pmc_event_alias core2_aliases_without_iaf[] = { + EV_ALIAS("branches", "iap-br-inst-retired.any"), + EV_ALIAS("branch-mispredicts", "iap-br-inst-retired.mispred"), + EV_ALIAS("cycles", "tsc-tsc"), + EV_ALIAS("ic-misses", "iap-l1i-misses"), + EV_ALIAS("instructions", "iap-inst-retired.any_p"), + EV_ALIAS("interrupts", "iap-hw-int-rcv"), + EV_ALIAS("unhalted-cycles", "iap-cpu-clk-unhalted.core_p"), + EV_ALIAS(NULL, NULL) +}; + +#define atom_aliases core2_aliases +#define atom_aliases_without_iaf core2_aliases_without_iaf +#define corei7_aliases core2_aliases +#define corei7_aliases_without_iaf core2_aliases_without_iaf #define IAF_KW_OS "os" #define IAF_KW_USR "usr" @@ -2379,6 +2397,10 @@ pmc_init(void) uint32_t abi_version; struct module_stat pmc_modstat; struct pmc_op_getcpuinfo op_cpu_info; +#if defined(__amd64__) || defined(__i386__) + int cpu_has_iaf_counters; + unsigned int t; +#endif if (pmc_syscall != -1) /* already inited */ return (0); @@ -2420,6 +2442,8 @@ pmc_init(void) if (pmc_class_table == NULL) return (-1); + for (n = 0; n < PMC_CLASS_TABLE_SIZE; n++) + pmc_class_table[n] = NULL; /* * Fill in the class table. @@ -2427,6 +2451,14 @@ pmc_init(void) n = 0; #if defined(__amd64__) || defined(__i386__) pmc_class_table[n++] = &tsc_class_table_descr; + + /* + * Check if this CPU has fixed function counters. + */ + cpu_has_iaf_counters = 0; + for (t = 0; t < cpu_info.pm_nclass; t++) + if (cpu_info.pm_classes[t].pm_class == PMC_CLASS_IAF) + cpu_has_iaf_counters = 1; #endif #define PMC_MDEP_INIT(C) do { \ @@ -2436,6 +2468,16 @@ pmc_init(void) PMC_TABLE_SIZE(C##_pmc_classes); \ } while (0) +#define PMC_MDEP_INIT_INTEL_V2(C) do { \ + PMC_MDEP_INIT(C); \ + if (cpu_has_iaf_counters) \ + pmc_class_table[n++] = &iaf_class_table_descr; \ + else \ + pmc_mdep_event_aliases = \ + C##_aliases_without_iaf; \ + pmc_class_table[n] = &C##_class_table_descr; \ + } while (0) + /* Configure the event name parser. */ switch (cpu_info.pm_cputype) { #if defined(__i386__) @@ -2461,24 +2503,17 @@ pmc_init(void) pmc_class_table[n] = &k8_class_table_descr; break; case PMC_CPU_INTEL_ATOM: - PMC_MDEP_INIT(atom); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &atom_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(atom); break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); - pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: - PMC_MDEP_INIT(core2); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &core2_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(core2); break; case PMC_CPU_INTEL_COREI7: - PMC_MDEP_INIT(corei7); - pmc_class_table[n++] = &iaf_class_table_descr; - pmc_class_table[n] = &corei7_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(corei7); break; case PMC_CPU_INTEL_PIV: PMC_MDEP_INIT(p4); From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:49:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F8FE1065697; Mon, 7 Dec 2009 20:49:49 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D6D08FC18; Mon, 7 Dec 2009 20:49: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 nB7KnnIT065702; Mon, 7 Dec 2009 20:49:49 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KnnUY065700; Mon, 7 Dec 2009 20:49:49 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912072049.nB7KnnUY065700@svn.freebsd.org> From: Fabien Thomas Date: Mon, 7 Dec 2009 20:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200236 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:49:49 -0000 Author: fabient Date: Mon Dec 7 20:49:49 2009 New Revision: 200236 URL: http://svn.freebsd.org/changeset/base/200236 Log: MFC 200060: Use a better check for a valid kernel stack address when capturing kernel call chains. Modified: stable/8/sys/dev/hwpmc/hwpmc_x86.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_x86.c Mon Dec 7 20:47:33 2009 (r200235) +++ stable/8/sys/dev/hwpmc/hwpmc_x86.c Mon Dec 7 20:49:49 2009 (r200236) @@ -176,7 +176,8 @@ pmc_save_kernel_callchain(uintptr_t *cc, stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; if (PMC_IN_TRAP_HANDLER(pc) || - !PMC_IN_KERNEL(pc) || !PMC_IN_KERNEL(r) || + !PMC_IN_KERNEL(pc) || + !PMC_IN_KERNEL_STACK(r, stackstart, stackend) || !PMC_IN_KERNEL_STACK(sp, stackstart, stackend) || !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) return (1); @@ -221,7 +222,7 @@ pmc_save_kernel_callchain(uintptr_t *cc, r = fp + sizeof(uintptr_t); if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend) || - !PMC_IN_KERNEL(r)) + !PMC_IN_KERNEL_STACK(r, stackstart, stackend)) break; pc = *(uintptr_t *) r; fp = *(uintptr_t *) fp; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:51:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C5D31065672; Mon, 7 Dec 2009 20:51:19 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6A98FC0C; Mon, 7 Dec 2009 20:51: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 nB7KpJxU065782; Mon, 7 Dec 2009 20:51:19 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7KpJ85065780; Mon, 7 Dec 2009 20:51:19 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912072051.nB7KpJ85065780@svn.freebsd.org> From: Fabien Thomas Date: Mon, 7 Dec 2009 20:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200237 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:51:19 -0000 Author: fabient Date: Mon Dec 7 20:51:19 2009 New Revision: 200237 URL: http://svn.freebsd.org/changeset/base/200237 Log: MFC 200060: Use a better check for a valid kernel stack address when capturing kernel call chains. Modified: stable/7/sys/dev/hwpmc/hwpmc_x86.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_x86.c Mon Dec 7 20:49:49 2009 (r200236) +++ stable/7/sys/dev/hwpmc/hwpmc_x86.c Mon Dec 7 20:51:19 2009 (r200237) @@ -176,7 +176,8 @@ pmc_save_kernel_callchain(uintptr_t *cc, stackend = (uintptr_t) td->td_kstack + td->td_kstack_pages * PAGE_SIZE; if (PMC_IN_TRAP_HANDLER(pc) || - !PMC_IN_KERNEL(pc) || !PMC_IN_KERNEL(r) || + !PMC_IN_KERNEL(pc) || + !PMC_IN_KERNEL_STACK(r, stackstart, stackend) || !PMC_IN_KERNEL_STACK(sp, stackstart, stackend) || !PMC_IN_KERNEL_STACK(fp, stackstart, stackend)) return (1); @@ -221,7 +222,7 @@ pmc_save_kernel_callchain(uintptr_t *cc, r = fp + sizeof(uintptr_t); if (!PMC_IN_KERNEL_STACK(fp, stackstart, stackend) || - !PMC_IN_KERNEL(r)) + !PMC_IN_KERNEL_STACK(r, stackstart, stackend)) break; pc = *(uintptr_t *) r; fp = *(uintptr_t *) fp; From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 20:56:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79235106566C; Mon, 7 Dec 2009 20:56:43 +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 48A288FC17; Mon, 7 Dec 2009 20:56:43 +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 D57F546B1A; Mon, 7 Dec 2009 15:56:42 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 22EC58A01B; Mon, 7 Dec 2009 15:56:42 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Date: Mon, 7 Dec 2009 15:34:00 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912072017.nB7KHXYi064718@svn.freebsd.org> In-Reply-To: <200912072017.nB7KHXYi064718@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912071534.00758.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 07 Dec 2009 15:56:42 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no 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: r200231 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 20:56:43 -0000 On Monday 07 December 2009 3:17:33 pm Jung-uk Kim wrote: > Author: jkim > Date: Mon Dec 7 20:17:33 2009 > New Revision: 200231 > URL: http://svn.freebsd.org/changeset/base/200231 > > Log: > Make mfi(4) little bit less chatty. This is the wrong way to fix this, please revert. If you want to change the default, then change it here instead (from mfi.c): static int mfi_event_class = MFI_EVT_CLASS_INFO; TUNABLE_INT("hw.mfi.event_class", &mfi_event_class); SYSCTL_INT(_hw_mfi, OID_AUTO, event_class, CTLFLAG_RW, &mfi_event_class, 0, "event message class"); Note that you can also just adjust it locally by setting the loader tunable or sysctl. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:00:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35090106566B; Mon, 7 Dec 2009 21:00:37 +0000 (UTC) (envelope-from lytboris@gmail.com) Received: from mail-fx0-f209.google.com (mail-fx0-f209.google.com [209.85.220.209]) by mx1.freebsd.org (Postfix) with ESMTP id E438D8FC16; Mon, 7 Dec 2009 21:00:35 +0000 (UTC) Received: by fxm2 with SMTP id 2so2439758fxm.13 for ; Mon, 07 Dec 2009 13:00:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JZz42uKFBog5SLSBVtRKiWUohhdUeqGpvINmFaPS3e8=; b=KO7XfFxwDw/oGNJtjeFF17wazOwDKIsOSEj/qBU7MDe8Dsg294m3TctYCa7OJPa53M Vm5dt9VFNzLfEFDOOvwYUG6yCwI82ehWawYWYIHRyefdpJFWEtKclMKbXw74xxOhUjqa 5+28XPNpefSITeUolZdGlcbv1Na5hPKRXN0fI= 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=NQnw38n7HeBRSb+PNP4q/CFtT9Peau7T3DNVBOfWprr5A5I6flApQvskESiGJ7orKC tyx8hBis3+Lj3ITC9JkuFx6rdJSdQWoH0MiPuLRgBoDR+bU2L65v6f6/KQc67mh9fqkN ffVzaYQnNoPFCi37jileNuI6qwXM09JXe4N40= MIME-Version: 1.0 Received: by 10.239.138.13 with SMTP id n13mr724547hbn.9.1260219634816; Mon, 07 Dec 2009 13:00:34 -0800 (PST) In-Reply-To: <933fa9790912071230n56f27f5bhcdec44d22a1c5126@mail.gmail.com> References: <200912061804.nB6I4R38027652@svn.freebsd.org> <4B1D437F.4050601@elischer.org> <4B1D4723.5090908@elischer.org> <200912072029.05907.max@love2party.net> <933fa9790912071145k4d97c177qc6f963ba0ffbb13@mail.gmail.com> <9a542da30912071221t289a57a8gdfbb12c8a0b84753@mail.gmail.com> <933fa9790912071230n56f27f5bhcdec44d22a1c5126@mail.gmail.com> Date: Tue, 8 Dec 2009 00:00:34 +0300 Message-ID: <933fa9790912071300u78e22dciec834bb3551311a4@mail.gmail.com> From: Lytochkin Boris To: =?ISO-8859-1?Q?Ermal_Lu=E7i?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Julian Elischer , sem@freebsd.org, svn-src-head@freebsd.org, Max Laier Subject: Re: svn commit: r200183 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:00:37 -0000 Oups, everything is OK with route-to and reply-to in pf, my bad. config for my situation must be like this scrub in all fragment reassemble pass in quick reply-to (em0 10.60.128.254) inet from any to 10.60.128.0/24 flags S/SA keep state pass in quick reply-to (em0 10.70.128.254) inet from any to 10.70.128.0/24 flags S/SA keep state pass in quick reply-to (em0 10.71.128.254) inet from any to 10.71.128.0/24 flags S/SA keep state pass in quick reply-to (em0 10.72.128.254) inet from any to 10.72.128.0/24 flags S/SA keep state pass in quick all flags S/SA keep state or incoming traffic whould create keep-state wit pass in and would not go down to route-to rules. or use per-interface keep states. On Mon, Dec 7, 2009 at 11:30 PM, Lytochkin Boris wrote= : > there are multiple addresses on em0 (for example): > > 95.108.197.225/27 > 10.60.128.225/24 > 10.61.128.225/24 > ... > 10.70.128.225/24 > > default router is in 95.108.197.225/27 network. > > 10.X addresses are used for SLB - SLB router does DNAT and forward > client's connection to this node, so node should forward all packets > from 10.X addresses to .254 - SLB router IPs. > > ipfw config would be something like > =3D=3D=3D=3D > ipfw add 60 fwd 10.60.128.254 ip from 10.60.128.0/24 to any out > ipfw add 61 fwd 10.61.128.254 ip from 10.61.128.0/24 to any out > ... > ipfw add 70 fwd 10.70.128.254 ip from 10.70.128.0/24 to any out > allow 65534 ip from any to any > =3D=3D=3D=3D > > pf variant will be accordingly > =3D=3D=3D=3D > scrub in all fragment reassemble > pass in all flags S/SA keep state > pass out quick route-to (em0 10.60.128.254) inet from 10.60.128.0/24 > to any flags S/SA keep state > ... > pass out quick route-to (em0 10.60.128.254) inet from 10.70.128.0/24 > to any flags S/SA keep state > =3D=3D=3D=3D > > My box is a cluster node, not router, just simple policy-based routing re= quired > > > > On Mon, Dec 7, 2009 at 11:21 PM, Ermal Lu=E7i wrote: >> >> >> On Mon, Dec 7, 2009 at 8:45 PM, Lytochkin Boris wro= te: >>> >>> Hi! >>> >>> On Mon, Dec 7, 2009 at 10:29 PM, Max Laier wrote: >>> [cut] >>> > I just tested an install of r197983 (9.0-CURRENT) that I had on a >>> > test-box and >>> > route-to works as it is supposed to - AFAICT. =A0FWIW, pf sets sin_le= n for >>> > every >>> > use. >>> > >>> > Might be a problem/mis-understanding in the OPs configuration that is >>> > the >>> > issue here? >>> > >>> > I'll follow up to the thread on -net@ is a second. >>> >>> I posted my pf config in original message to -net@: >>> =3D=3D=3D=3D=3D >>> scrub in all fragment reassemble >>> pass in all flags S/SA keep state >>> pass out quick route-to (em0 10.60.128.254) inet from 10.60.128.0/24 >>> to any flags S/SA keep state >>> =3D=3D=3D=3D=3D >>> >>> Pretty simple. Even when forward is disabled packets that are matched >>> by route-to rule are forwarded to default gateway instead of specified >>> in route-to. And I checked rtalloc_ign_fib() arguments when using pf - >>> seems that pf does not use this function to lookup route-to route. >>> >>> +sem@ >>> >> >> My crystal ball is broken. >> Explain your freebsd config, your network topology, some debug output an= d >> then it can be considered useful. >> >> There are many people using route-to on FreeBSD 8 so it would have come = up >> before. >> >>> >>> -- >>> Regards, >>> Boris Lytochkin >> >> >> >> -- >> Ermal >> > From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:06:42 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9636D106568D; Mon, 7 Dec 2009 21:06:42 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 47C6C8FC15; Mon, 7 Dec 2009 21:06:42 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id nB7L5QHP077790; Mon, 7 Dec 2009 15:05:26 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id nB7L5QI8077789; Mon, 7 Dec 2009 15:05:26 -0600 (CST) (envelope-from brooks) Date: Mon, 7 Dec 2009 15:05:26 -0600 From: Brooks Davis To: Luigi Rizzo Message-ID: <20091207210526.GD77256@lor.one-eyed-alien.net> References: <200912061901.nB6J1X7L028816@svn.freebsd.org> <20091207201744.GA77256@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sXc4Kmr5FA7axrvy" Content-Disposition: inline In-Reply-To: <20091207201744.GA77256@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 07 Dec 2009 15:05:26 -0600 (CST) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r200184 - stable/8/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:06:42 -0000 --sXc4Kmr5FA7axrvy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 07, 2009 at 02:17:44PM -0600, Brooks Davis wrote: > On Sun, Dec 06, 2009 at 07:01:33PM +0000, Luigi Rizzo wrote: > > Author: luigi > > Date: Sun Dec 6 19:01:33 2009 > > New Revision: 200184 > > URL: http://svn.freebsd.org/changeset/base/200184 > >=20 > > Log: > > mfc r200056 > > use qsort_r instead of heapsort; >=20 > This seems like a move in the wrong direction. The use of a recursive > algorithm in the kernel seems generally ill-advised and I was rather > disturbed when I found we had a quick sort implementation in libkern. >=20 > Unless you know the number of items is small, quick sort isn't safe and > if the number is small, heap sort is plenty efficient. Woops, it was pointed out to me that this was the userspace part where qsort is just fine. :) -- Brooks --sXc4Kmr5FA7axrvy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLHW4VXY6L6fI4GtQRAvLYAJ9dLBrE1AdVvoR3duv4DWzwUqfexQCbBtYi fZ9IB0YuH41DdOS1D+24u+Q= =ghbb -----END PGP SIGNATURE----- --sXc4Kmr5FA7axrvy-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:15:55 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id C6EFA1065670; Mon, 7 Dec 2009 21:15:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Mon, 7 Dec 2009 16:15:28 -0500 User-Agent: KMail/1.6.2 References: <200912072017.nB7KHXYi064718@svn.freebsd.org> <200912071534.00758.jhb@freebsd.org> In-Reply-To: <200912071534.00758.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912071615.36667.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200231 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:15:55 -0000 On Monday 07 December 2009 03:34 pm, John Baldwin wrote: > On Monday 07 December 2009 3:17:33 pm Jung-uk Kim wrote: > > Author: jkim > > Date: Mon Dec 7 20:17:33 2009 > > New Revision: 200231 > > URL: http://svn.freebsd.org/changeset/base/200231 > > > > Log: > > Make mfi(4) little bit less chatty. > > This is the wrong way to fix this, please revert. If you want to > change the default, then change it here instead (from mfi.c): > > static int mfi_event_class = MFI_EVT_CLASS_INFO; > TUNABLE_INT("hw.mfi.event_class", &mfi_event_class); > SYSCTL_INT(_hw_mfi, OID_AUTO, event_class, CTLFLAG_RW, > &mfi_event_class, 0, "event message class"); > > Note that you can also just adjust it locally by setting the loader > tunable or sysctl. Hmm... I was reading a wrong tree before your change, sorry. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:24:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87CF9106566B; Mon, 7 Dec 2009 21:24:07 +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 769E98FC14; Mon, 7 Dec 2009 21:24: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 nB7LO79R066472; Mon, 7 Dec 2009 21:24:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7LO7Ji066470; Mon, 7 Dec 2009 21:24:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912072124.nB7LO7Ji066470@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 7 Dec 2009 21:24: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: r200238 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:24:07 -0000 Author: jkim Date: Mon Dec 7 21:24:07 2009 New Revision: 200238 URL: http://svn.freebsd.org/changeset/base/200238 Log: Revert r200231. It was already taken cared by jhb long ago. Pointed out by: jhb Pointy hat: jkim Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Mon Dec 7 20:51:19 2009 (r200237) +++ head/sys/dev/mfi/mfi.c Mon Dec 7 21:24:07 2009 (r200238) @@ -1081,22 +1081,9 @@ static void mfi_decode_evt(struct mfi_softc *sc, struct mfi_evt_detail *detail) { - switch (detail->class.members.class) { - case MFI_EVT_CLASS_DEBUG: - case MFI_EVT_CLASS_PROGRESS: - case MFI_EVT_CLASS_INFO: -#ifndef MFI_DEBUG - if (!bootverbose) - return; - /* FALLTHROUGH */ -#endif - default: - device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", - detail->seq, format_timestamp(detail->time), - detail->class.members.locale, - format_class(detail->class.members.class), - detail->description); - } + device_printf(sc->mfi_dev, "%d (%s/0x%04x/%s) - %s\n", detail->seq, + format_timestamp(detail->time), detail->class.members.locale, + format_class(detail->class.members.class), detail->description); } static int From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:30:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C6C8106568D; Mon, 7 Dec 2009 21:30:54 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A7358FC12; Mon, 7 Dec 2009 21:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB7LUs5n066656; Mon, 7 Dec 2009 21:30:54 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB7LUsX1066653; Mon, 7 Dec 2009 21:30:54 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912072130.nB7LUsX1066653@svn.freebsd.org> From: Jack F Vogel Date: Mon, 7 Dec 2009 21:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200239 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:30:54 -0000 Author: jfv Date: Mon Dec 7 21:30:54 2009 New Revision: 200239 URL: http://svn.freebsd.org/changeset/base/200239 Log: Update driver to Intel version 2.0.7: This adds new feature support for the 82599, a hardware assist to LRO, doing this required a large revamp to the RX cleanup code because the descriptor ring may not be processed out of order, this necessitated the elimination of global pointers. Additionally, the RX routine now does not refresh mbufs on every descriptor, rather it will do a range, and then update the hardware pointer at that time. These are performance oriented changes. The TX side now has a cleaner simpler watchdog algorithm as well, in TX cleanup a read of ticks is stored, that can then be compared in local_timer to determine if there is a hang. Various other cleanups along the way, thanks to all who have provided input and testing. Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_phy.h head/sys/dev/ixgbe/ixgbe_type.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Dec 7 21:24:07 2009 (r200238) +++ head/sys/dev/ixgbe/ixgbe.c Mon Dec 7 21:30:54 2009 (r200239) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "1.8.9"; +char ixgbe_driver_version[] = "2.0.7"; /********************************************************************* * PCI Device ID Table @@ -64,16 +64,19 @@ static ixgbe_vendor_info_t ixgbe_vendor_ {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0}, {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, 0, 0, 0}, + {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -102,7 +105,6 @@ static int ixgbe_mq_start_locked(struct static void ixgbe_qflush(struct ifnet *); #endif static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); -static void ixgbe_watchdog(struct adapter *); static void ixgbe_init(void *); static void ixgbe_init_locked(struct adapter *); static void ixgbe_stop(void *); @@ -116,8 +118,8 @@ static int ixgbe_allocate_queues(struct static int ixgbe_setup_msix(struct adapter *); static void ixgbe_free_pci_resources(struct adapter *); static void ixgbe_local_timer(void *); -static int ixgbe_hardware_init(struct adapter *); static void ixgbe_setup_interface(device_t, struct adapter *); +static void ixgbe_config_link(struct adapter *); static int ixgbe_allocate_transmit_buffers(struct tx_ring *); static int ixgbe_setup_transmit_structures(struct adapter *); @@ -132,6 +134,7 @@ static int ixgbe_setup_receive_ring(stru static void ixgbe_initialize_receive_units(struct adapter *); static void ixgbe_free_receive_structures(struct adapter *); static void ixgbe_free_receive_buffers(struct rx_ring *); +static void ixgbe_setup_hw_rsc(struct rx_ring *); static void ixgbe_init_moderation(struct adapter *); static void ixgbe_enable_intr(struct adapter *); @@ -146,7 +149,7 @@ static void ixgbe_set_multi(struct a static void ixgbe_print_hw_stats(struct adapter *); static void ixgbe_print_debug_info(struct adapter *); static void ixgbe_update_link_status(struct adapter *); -static int ixgbe_get_buf(struct rx_ring *, int, u8); +static int ixgbe_get_buf(struct rx_ring *, int, int); static int ixgbe_xmit(struct tx_ring *, struct mbuf **); static int ixgbe_sysctl_stats(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_debug(SYSCTL_HANDLER_ARGS); @@ -186,6 +189,10 @@ static void ixgbe_handle_link(void *, in static void ixgbe_handle_msf(void *, int); static void ixgbe_handle_mod(void *, int); +#ifdef IXGBE_FDIR +static void ixgbe_atr(struct tx_ring *, struct mbuf *); +static void ixgbe_reinit_fdir(void *, int); +#endif /********************************************************************* * FreeBSD Device Interface Entry Points @@ -239,6 +246,15 @@ static int ixgbe_flow_control = ixgbe_fc TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control); /* +** Smart speed setting, default to on +** this only works as a compile option +** right now as its during attach, set +** this to 'ixgbe_smart_speed_off' to +** disable. +*/ +static int ixgbe_smart_speed = ixgbe_smart_speed_on; + +/* * MSIX should be the default for best performance, * but this allows it to be forced off for testing. */ @@ -271,7 +287,7 @@ TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); static int ixgbe_rxd = DEFAULT_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); -/* Total number of Interfaces - need for config sanity check */ +/* Keep running tab on them for sanity check */ static int ixgbe_total_ports; /* @@ -288,6 +304,27 @@ static u32 ixgbe_shadow_vfta[IXGBE_VFTA_ */ static int ixgbe_num_segs = IXGBE_82598_SCATTER; +#ifdef IXGBE_FDIR +/* +** For Flow Director: this is the +** number of TX packets we sample +** for the filter pool, this means +** every 20th packet will be probed. +** +** This feature can be disabled by +** setting this to 0. +*/ +static int atr_sample_rate = 20; +/* +** Flow Director actually 'steals' +** part of the packet buffer as its +** filter pool, this variable controls +** how much it uses: +** 0 = 64K, 1 = 128K, 2 = 256K +*/ +static int fdir_pballoc = 1; +#endif + /********************************************************************* * Device identification routine * @@ -356,7 +393,7 @@ ixgbe_attach(device_t dev) struct adapter *adapter; struct ixgbe_hw *hw; int error = 0; - u16 pci_device_id; + u16 pci_device_id, csum; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -376,10 +413,14 @@ ixgbe_attach(device_t dev) case IXGBE_DEV_ID_82598EB_CX4 : adapter->optics = IFM_10G_CX4; break; + case IXGBE_DEV_ID_82598 : case IXGBE_DEV_ID_82598AF_DUAL_PORT : case IXGBE_DEV_ID_82598_DA_DUAL_PORT : case IXGBE_DEV_ID_82598AF_SINGLE_PORT : + case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM : + case IXGBE_DEV_ID_82598EB_SFP_LOM : case IXGBE_DEV_ID_82598AT : + case IXGBE_DEV_ID_82598AT2 : adapter->optics = IFM_10G_SR; break; case IXGBE_DEV_ID_82598EB_XF_LR : @@ -390,10 +431,13 @@ ixgbe_attach(device_t dev) ixgbe_num_segs = IXGBE_82599_SCATTER; break; case IXGBE_DEV_ID_82599_KX4 : + case IXGBE_DEV_ID_82599_KX4_MEZZ: + case IXGBE_DEV_ID_82599_CX4 : adapter->optics = IFM_10G_CX4; ixgbe_num_segs = IXGBE_82599_SCATTER; break; case IXGBE_DEV_ID_82599_XAUI_LOM : + case IXGBE_DEV_ID_82599_COMBO_BACKPLANE : ixgbe_num_segs = IXGBE_82599_SCATTER; default: break; @@ -504,13 +548,40 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Initialize the hardware */ - if (ixgbe_hardware_init(adapter)) { - device_printf(dev,"Unable to initialize the hardware\n"); + /* Make sure we have a good EEPROM before we read from it */ + if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { + device_printf(dev,"The EEPROM Checksum Is Not Valid\n"); error = EIO; goto err_late; } + /* Pick up the smart speed setting */ + if (hw->mac.type == ixgbe_mac_82599EB) + hw->phy.smart_speed = ixgbe_smart_speed; + + /* Get Hardware Flow Control setting */ + hw->fc.requested_mode = ixgbe_fc_full; + hw->fc.pause_time = IXGBE_FC_PAUSE; + hw->fc.low_water = IXGBE_FC_LO; + hw->fc.high_water = IXGBE_FC_HI; + hw->fc.send_xon = TRUE; + + error = ixgbe_init_hw(hw); + if (error == IXGBE_ERR_EEPROM_VERSION) { + device_printf(dev, "This device is a pre-production adapter/" + "LOM. Please be aware there may be issues associated " + "with your hardware.\n If you are experiencing problems " + "please contact your Intel or hardware representative " + "who provided you with this hardware.\n"); + } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) + device_printf(dev,"Unsupported SFP+ Module\n"); + + if (error) { + error = EIO; + device_printf(dev,"Hardware Initialization Failure\n"); + goto err_late; + } + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -529,10 +600,10 @@ ixgbe_attach(device_t dev) adapter->cycles.mask = (u64)-1; adapter->cycles.mult = 1; adapter->cycles.shift = IXGBE_TSYNC_SHIFT; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_TIMINCA, (1<<24) | + IXGBE_WRITE_REG(hw, IXGBE_TIMINCA, (1<<24) | IXGBE_TSYNC_CYCLE_TIME * IXGBE_TSYNC_SHIFT); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_SYSTIML, 0x00000000); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_SYSTIMH, 0xFF800000); + IXGBE_WRITE_REG(hw, IXGBE_SYSTIML, 0x00000000); + IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0xFF800000); // JFV - this is not complete yet #endif @@ -551,6 +622,24 @@ ixgbe_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); + /* Print PCIE bus type/speed/width info */ + ixgbe_get_bus_info(hw); + device_printf(dev,"PCI Express Bus: Speed %s %s\n", + ((hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0Gb/s": + (hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5Gb/s":"Unknown"), + (hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" : + (hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" : + (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" : + ("Unknown")); + + if (hw->bus.width <= ixgbe_bus_width_pcie_x4) { + device_printf(dev, "PCI-Express bandwidth available" + " for this card\n is not sufficient for" + " optimal performance.\n"); + device_printf(dev, "For optimal performance a x8 " + "PCI-Express slot is required.\n"); + } + /* let hardware know driver is loaded */ ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD; @@ -616,6 +705,9 @@ ixgbe_detach(device_t dev) taskqueue_drain(adapter->tq, &adapter->link_task); taskqueue_drain(adapter->tq, &adapter->mod_task); taskqueue_drain(adapter->tq, &adapter->msf_task); +#ifdef IXGBE_FDIR + taskqueue_drain(adapter->tq, &adapter->fdir_task); +#endif taskqueue_free(adapter->tq); } @@ -700,8 +792,8 @@ ixgbe_start_locked(struct tx_ring *txr, /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, m_head); - /* Set timeout in case hardware has problems transmitting */ - txr->watchdog_timer = IXGBE_TX_TIMEOUT; + /* Set watchdog on */ + txr->watchdog_check = TRUE; } return; @@ -770,16 +862,17 @@ ixgbe_mq_start_locked(struct ifnet *ifp, /* If nothing queued go right to xmit */ if (drbr_empty(ifp, txr->br)) { - if (ixgbe_xmit(txr, &m)) { - if (m && (err = drbr_enqueue(ifp, txr->br, m)) != 0) - return (err); + if ((err = ixgbe_xmit(txr, &m)) != 0) { + if (m != NULL) + err = drbr_enqueue(ifp, txr->br, m); + return (err); } else { /* Success, update stats */ drbr_stats_update(ifp, m->m_pkthdr.len, m->m_flags); /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, m); /* Set the watchdog */ - txr->watchdog_timer = IXGBE_TX_TIMEOUT; + txr->watchdog_check = TRUE; } } else if ((err = drbr_enqueue(ifp, txr->br, m)) != 0) @@ -796,11 +889,15 @@ process: next = drbr_dequeue(ifp, txr->br); if (next == NULL) break; - if (ixgbe_xmit(txr, &next)) + if ((err = ixgbe_xmit(txr, &next)) != 0) { + if (next != NULL) + err = drbr_enqueue(ifp, txr->br, next); break; + } + drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); ETHER_BPF_MTAP(ifp, next); /* Set the watchdog */ - txr->watchdog_timer = IXGBE_TX_TIMEOUT; + txr->watchdog_check = TRUE; } if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) @@ -843,27 +940,10 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c { struct adapter *adapter = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; -#ifdef INET - struct ifaddr *ifa = (struct ifaddr *) data; -#endif int error = 0; switch (command) { - case SIOCSIFADDR: -#ifdef INET - IOCTL_DEBUGOUT("ioctl: SIOCxIFADDR (Get/Set Interface Addr)"); - if (ifa->ifa_addr->sa_family == AF_INET) { - ifp->if_flags |= IFF_UP; - if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - IXGBE_CORE_LOCK(adapter); - ixgbe_init_locked(adapter); - IXGBE_CORE_UNLOCK(adapter); - } - arp_ifinit(ifp, ifa); - } else -#endif - ether_ioctl(ifp, command, data); - break; + case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) { @@ -919,7 +999,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c ifp->if_capenable ^= IFCAP_HWCSUM; if (mask & IFCAP_TSO4) ifp->if_capenable ^= IFCAP_TSO4; - if (mask & IFCAP_LRO) + /* Only allow changing when using header split */ + if ((mask & IFCAP_LRO) && (ixgbe_header_split)) ifp->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; @@ -948,84 +1029,6 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c } /********************************************************************* - * Watchdog entry point - * - * This routine is called by the local timer - * to detect hardware hangs . - * - **********************************************************************/ - -static void -ixgbe_watchdog(struct adapter *adapter) -{ - device_t dev = adapter->dev; - struct tx_ring *txr = adapter->tx_rings; - struct ixgbe_hw *hw = &adapter->hw; - bool tx_hang = FALSE; - - IXGBE_CORE_LOCK_ASSERT(adapter); - - /* - * The timer is set to 5 every time ixgbe_start() queues a packet. - * Then ixgbe_txeof() keeps resetting to 5 as long as it cleans at - * least one descriptor. - * Finally, anytime all descriptors are clean the timer is - * set to 0. - */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { - u32 head, tail; - - IXGBE_TX_LOCK(txr); - if (txr->watchdog_timer == 0 || --txr->watchdog_timer) { - IXGBE_TX_UNLOCK(txr); - continue; - } else { - head = IXGBE_READ_REG(hw, IXGBE_TDH(i)); - tail = IXGBE_READ_REG(hw, IXGBE_TDT(i)); - if (head == tail) { /* last minute check */ - IXGBE_TX_UNLOCK(txr); - continue; - } - /* Well, seems something is really hung */ - tx_hang = TRUE; - IXGBE_TX_UNLOCK(txr); - break; - } - } - if (tx_hang == FALSE) - return; - - /* - * If we are in this routine because of pause frames, then don't - * reset the hardware. - */ - if (IXGBE_READ_REG(hw, IXGBE_TFCS) & IXGBE_TFCS_TXOFF) { - txr = adapter->tx_rings; /* reset pointer */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { - IXGBE_TX_LOCK(txr); - txr->watchdog_timer = IXGBE_TX_TIMEOUT; - IXGBE_TX_UNLOCK(txr); - } - return; - } - - - device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); - for (int i = 0; i < adapter->num_queues; i++, txr++) { - device_printf(dev,"Queue(%d) tdh = %d, hw tdt = %d\n", i, - IXGBE_READ_REG(hw, IXGBE_TDH(i)), - IXGBE_READ_REG(hw, IXGBE_TDT(i))); - device_printf(dev,"TX(%d) desc avail = %d," - "Next TX to Clean = %d\n", - i, txr->tx_avail, txr->next_tx_to_clean); - } - adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - adapter->watchdog_events++; - - ixgbe_init_locked(adapter); -} - -/********************************************************************* * Init entry point * * This routine is used in two ways. It is used by the stack as @@ -1052,19 +1055,14 @@ ixgbe_init_locked(struct adapter *adapte hw = &adapter->hw; mtx_assert(&adapter->core_mtx, MA_OWNED); - ixgbe_stop(adapter); - /* Get the latest mac address, User can use a LAA */ - bcopy(IF_LLADDR(adapter->ifp), adapter->hw.mac.addr, + bcopy(IF_LLADDR(adapter->ifp), hw->mac.addr, IXGBE_ETH_LENGTH_OF_ADDRESS); - ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, 1); - adapter->hw.addr_ctrl.rar_used_count = 1; + ixgbe_set_rar(hw, 0, hw->mac.addr, 0, 1); + hw->addr_ctrl.rar_used_count = 1; - /* Initialize the hardware */ - if (ixgbe_hardware_init(adapter)) { - device_printf(dev, "Unable to initialize the hardware\n"); - return; - } + /* Do a warm reset */ + ixgbe_reset_hw(hw); /* Prepare transmit descriptors and buffers */ if (ixgbe_setup_transmit_structures(adapter)) { @@ -1102,7 +1100,7 @@ ixgbe_init_locked(struct adapter *adapte gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); - if (adapter->hw.mac.type == ixgbe_mac_82599EB) { + if (hw->mac.type == ixgbe_mac_82599EB) { gpie |= IXGBE_SDP1_GPIEN; gpie |= IXGBE_SDP2_GPIEN; } @@ -1117,7 +1115,7 @@ ixgbe_init_locked(struct adapter *adapte gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT | IXGBE_GPIE_OCD; } - IXGBE_WRITE_REG(&adapter->hw, IXGBE_GPIE, gpie); + IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie); /* Set the various hardware offload abilities */ ifp->if_hwassist = 0; @@ -1128,28 +1126,35 @@ ixgbe_init_locked(struct adapter *adapte /* Set MTU size */ if (ifp->if_mtu > ETHERMTU) { - mhadd = IXGBE_READ_REG(&adapter->hw, IXGBE_MHADD); + mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); mhadd &= ~IXGBE_MHADD_MFS_MASK; mhadd |= adapter->max_frame_size << IXGBE_MHADD_MFS_SHIFT; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_MHADD, mhadd); + IXGBE_WRITE_REG(hw, IXGBE_MHADD, mhadd); } /* Now enable all the queues */ for (int i = 0; i < adapter->num_queues; i++) { - txdctl = IXGBE_READ_REG(&adapter->hw, IXGBE_TXDCTL(i)); + txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i)); txdctl |= IXGBE_TXDCTL_ENABLE; /* Set WTHRESH to 8, burst writeback */ txdctl |= (8 << 16); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(i), txdctl); } for (int i = 0; i < adapter->num_queues; i++) { - rxdctl = IXGBE_READ_REG(&adapter->hw, IXGBE_RXDCTL(i)); - /* PTHRESH set to 32 */ - rxdctl |= 0x0020; + rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); + if (hw->mac.type == ixgbe_mac_82598EB) { + /* + ** PTHRESH = 21 + ** HTHRESH = 4 + ** WTHRESH = 8 + */ + rxdctl &= ~0x3FFFFF; + rxdctl |= 0x080420; + } rxdctl |= IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXDCTL(i), rxdctl); + IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(i), rxdctl); for (k = 0; k < 10; k++) { if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)) & IXGBE_RXDCTL_ENABLE) @@ -1166,7 +1171,7 @@ ixgbe_init_locked(struct adapter *adapte /* Enable Receive engine */ rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); - if (adapter->hw.mac.type == ixgbe_mac_82598EB) + if (hw->mac.type == ixgbe_mac_82598EB) rxctrl |= IXGBE_RXCTRL_DMBYPS; rxctrl |= IXGBE_RXCTRL_RXEN; IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); @@ -1181,7 +1186,11 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_set_ivar(adapter, 0, 0, 1); } - ixgbe_enable_intr(adapter); +#ifdef IXGBE_FDIR + /* Init Flow director */ + if (adapter->hw.mac.type == ixgbe_mac_82599EB) + ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); +#endif /* ** Check on any SFP devices that @@ -1194,14 +1203,12 @@ ixgbe_init_locked(struct adapter *adapte ixgbe_detach(dev); return; } - if (ixgbe_is_sfp(hw)) { - if (hw->phy.multispeed_fiber) { - hw->mac.ops.setup_sfp(hw); - taskqueue_enqueue(adapter->tq, &adapter->msf_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->mod_task); - } else - taskqueue_enqueue(adapter->tq, &adapter->link_task); + + /* Config/Enable Link */ + ixgbe_config_link(adapter); + + /* And now turn on interrupts */ + ixgbe_enable_intr(adapter); /* Now inform the stack we're ready */ ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1269,7 +1276,7 @@ ixgbe_disable_queue(struct adapter *adap } static inline void -ixgbe_rearm_rx_queues(struct adapter *adapter, u64 queues) +ixgbe_rearm_queues(struct adapter *adapter, u64 queues) { u32 mask; @@ -1464,11 +1471,25 @@ ixgbe_msix_link(void *arg) taskqueue_enqueue(adapter->tq, &adapter->link_task); if (adapter->hw.mac.type == ixgbe_mac_82599EB) { +#ifdef IXGBE_FDIR + if (reg_eicr & IXGBE_EICR_FLOW_DIR) { + /* This is probably overkill :) */ + if (!atomic_cmpset_int(&adapter->fdir_reinit, 0, 1)) + return; + /* Clear the interrupt */ + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_FLOW_DIR); + /* Turn off the interface */ + adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + taskqueue_enqueue(adapter->tq, &adapter->fdir_task); + } else +#endif if (reg_eicr & IXGBE_EICR_ECC) { device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! " "Please Reboot!!\n"); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC); - } else if (reg_eicr & IXGBE_EICR_GPI_SDP1) { + } else + + if (reg_eicr & IXGBE_EICR_GPI_SDP1) { /* Clear the interrupt */ IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1); taskqueue_enqueue(adapter->tq, &adapter->msf_task); @@ -1553,11 +1574,9 @@ ixgbe_init_moderation(struct adapter *ad } /* TX irq moderation rate is fixed */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { + for (int i = 0; i < adapter->num_queues; i++, txr++) IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(txr->msix), ixgbe_ave_latency); - txr->watchdog_timer = FALSE; - } /* RX moderation will be adapted over time, set default */ for (int i = 0; i < adapter->num_queues; i++, rxr++) { @@ -1633,7 +1652,6 @@ ixgbe_media_change(struct ifnet * ifp) switch (IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: - adapter->hw.mac.autoneg = TRUE; adapter->hw.phy.autoneg_advertised = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_10GB_FULL; break; @@ -1690,7 +1708,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m * used because it will contain the index of * the one we tell the hardware to report back */ - first = txr->next_avail_tx_desc; + first = txr->next_avail_desc; txbuf = &txr->tx_buffers[first]; txbuf_mapped = txbuf; map = txbuf->map; @@ -1767,12 +1785,22 @@ ixgbe_xmit(struct tx_ring *txr, struct m cmd_type_len |= IXGBE_ADVTXD_MAC_TSTAMP; #endif +#ifdef IXGBE_FDIR + /* Do the flow director magic */ + if ((txr->atr_sample) && (!adapter->fdir_reinit)) { + ++txr->atr_count; + if (txr->atr_count >= atr_sample_rate) { + ixgbe_atr(txr, m_head); + txr->atr_count = 0; + } + } +#endif /* Record payload length */ if (paylen == 0) olinfo_status |= m_head->m_pkthdr.len << IXGBE_ADVTXD_PAYLEN_SHIFT; - i = txr->next_avail_tx_desc; + i = txr->next_avail_desc; for (j = 0; j < nsegs; j++) { bus_size_t seglen; bus_addr_t segaddr; @@ -1798,7 +1826,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m txd->read.cmd_type_len |= htole32(IXGBE_TXD_CMD_EOP | IXGBE_TXD_CMD_RS); txr->tx_avail -= nsegs; - txr->next_avail_tx_desc = i; + txr->next_avail_desc = i; txbuf->m_head = m_head; txbuf->map = map; @@ -1939,7 +1967,7 @@ ixgbe_mc_array_itr(struct ixgbe_hw *hw, * Timer routine * * This routine checks for link status,updates statistics, - * and runs the watchdog timer. + * and runs the watchdog check. * **********************************************************************/ @@ -1948,6 +1976,9 @@ ixgbe_local_timer(void *arg) { struct adapter *adapter = arg; struct ifnet *ifp = adapter->ifp; + device_t dev = adapter->dev; + struct tx_ring *txr = adapter->tx_rings; + bool tx_hung = FALSE; mtx_assert(&adapter->core_mtx, MA_OWNED); @@ -1962,16 +1993,31 @@ ixgbe_local_timer(void *arg) ixgbe_print_hw_stats(adapter); } /* - * Each tick we check the watchdog - * to protect against hardware hangs. - */ - ixgbe_watchdog(adapter); - + ** Check for time since any descriptor was cleaned + */ + for (int i = 0; i < adapter->num_queues; i++, txr++) { + if (txr->watchdog_check == FALSE) + continue; + if ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG) { + tx_hung = TRUE; + goto hung; + } + } out: - /* Trigger an RX interrupt on all queues */ - ixgbe_rearm_rx_queues(adapter, adapter->rx_mask); - callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); + return; + +hung: + device_printf(adapter->dev, "Watchdog timeout -- resetting\n"); + device_printf(dev,"Queue(%d) tdh = %d, hw tdt = %d\n", txr->me, + IXGBE_READ_REG(&adapter->hw, IXGBE_TDH(txr->me)), + IXGBE_READ_REG(&adapter->hw, IXGBE_TDT(txr->me))); + device_printf(dev,"TX(%d) desc avail = %d," + "Next TX to Clean = %d\n", + txr->me, txr->tx_avail, txr->next_to_clean); + adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + adapter->watchdog_events++; + ixgbe_init_locked(adapter); } /* @@ -2004,7 +2050,7 @@ ixgbe_update_link_status(struct adapter adapter->link_active = FALSE; for (int i = 0; i < adapter->num_queues; i++, txr++) - txr->watchdog_timer = FALSE; + txr->watchdog_check = FALSE; } } @@ -2113,6 +2159,9 @@ ixgbe_allocate_legacy(struct adapter *ad TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); +#ifdef IXGBE_FDIR + TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); +#endif adapter->tq = taskqueue_create_fast("ixgbe_link", M_NOWAIT, taskqueue_thread_enqueue, &adapter->tq); taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq", @@ -2242,6 +2291,9 @@ ixgbe_allocate_msix(struct adapter *adap TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter); TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter); TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter); +#ifdef IXGBE_FDIR + TASK_INIT(&adapter->fdir_task, 0, ixgbe_reinit_fdir, adapter); +#endif adapter->tq = taskqueue_create_fast("ixgbe_link", M_NOWAIT, taskqueue_thread_enqueue, &adapter->tq); taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq", @@ -2432,65 +2484,15 @@ mem: /********************************************************************* * - * Initialize the hardware to a configuration as specified by the - * adapter structure. The controller is reset, the EEPROM is - * verified, the MAC address is set, then the shared initialization - * routines are called. - * - **********************************************************************/ -static int -ixgbe_hardware_init(struct adapter *adapter) -{ - device_t dev = adapter->dev; - u32 ret; - u16 csum; - - csum = 0; - /* Issue a global reset */ - adapter->hw.adapter_stopped = FALSE; - ixgbe_stop_adapter(&adapter->hw); - - /* Make sure we have a good EEPROM before we read from it */ - if (ixgbe_validate_eeprom_checksum(&adapter->hw, &csum) < 0) { - device_printf(dev,"The EEPROM Checksum Is Not Valid\n"); - return (EIO); - } - - /* Get Hardware Flow Control setting */ - adapter->hw.fc.requested_mode = ixgbe_fc_full; - adapter->hw.fc.pause_time = IXGBE_FC_PAUSE; - adapter->hw.fc.low_water = IXGBE_FC_LO; - adapter->hw.fc.high_water = IXGBE_FC_HI; - adapter->hw.fc.send_xon = TRUE; - - ret = ixgbe_init_hw(&adapter->hw); - if (ret == IXGBE_ERR_EEPROM_VERSION) { - device_printf(dev, "This device is a pre-production adapter/" - "LOM. Please be aware there may be issues associated " - "with your hardware.\n If you are experiencing problems " - "please contact your Intel or hardware representative " - "who provided you with this hardware.\n"); - } else if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { - device_printf(dev,"Unsupported SFP+ Module\n"); - return (EIO); - } else if (ret != 0 ) { - device_printf(dev,"Hardware Initialization Failure\n"); - return (EIO); - } - - return (0); -} - -/********************************************************************* - * * Setup networking device structure and register an interface. * **********************************************************************/ static void ixgbe_setup_interface(device_t dev, struct adapter *adapter) { - struct ifnet *ifp; struct ixgbe_hw *hw = &adapter->hw; + struct ifnet *ifp; + INIT_DEBUGOUT("ixgbe_setup_interface: begin"); ifp = adapter->ifp = if_alloc(IFT_ETHER); @@ -2522,17 +2524,12 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; - ifp->if_capabilities |= IFCAP_JUMBO_MTU | IFCAP_LRO; + ifp->if_capabilities |= IFCAP_JUMBO_MTU; + if (ixgbe_header_split) + ifp->if_capabilities |= IFCAP_LRO; ifp->if_capenable = ifp->if_capabilities; - if (hw->device_id == IXGBE_DEV_ID_82598AT) - ixgbe_setup_link_speed(hw, (IXGBE_LINK_SPEED_10GB_FULL | - IXGBE_LINK_SPEED_1GB_FULL), TRUE, TRUE); - else - ixgbe_setup_link_speed(hw, IXGBE_LINK_SPEED_10GB_FULL, - TRUE, FALSE); - /* * Specify the media types supported by this adapter and register * callbacks to update media and link information @@ -2549,7 +2546,51 @@ ixgbe_setup_interface(device_t dev, stru } ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); + return; +} + +static void +ixgbe_config_link(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + u32 autoneg, err = 0; + bool sfp, negotiate; + + switch (hw->phy.type) { + case ixgbe_phy_sfp_avago: + case ixgbe_phy_sfp_ftl: + case ixgbe_phy_sfp_intel: + case ixgbe_phy_sfp_unknown: + case ixgbe_phy_tw_tyco: + case ixgbe_phy_tw_unknown: + sfp = TRUE; + default: + sfp = FALSE; + } + if (sfp) { + if (hw->phy.multispeed_fiber) { + hw->mac.ops.setup_sfp(hw); + taskqueue_enqueue(adapter->tq, &adapter->msf_task); + } else + taskqueue_enqueue(adapter->tq, &adapter->mod_task); + } else { + if (hw->mac.ops.check_link) + err = ixgbe_check_link(hw, &autoneg, + &adapter->link_up, FALSE); + if (err) + goto out; + autoneg = hw->phy.autoneg_advertised; + if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) + err = hw->mac.ops.get_link_capabilities(hw, + &autoneg, &negotiate); + if (err) + goto out; + if (hw->mac.ops.setup_link) + err = hw->mac.ops.setup_link(hw, autoneg, + negotiate, adapter->link_up); + } +out: return; } @@ -2833,8 +2874,8 @@ ixgbe_setup_transmit_ring(struct tx_ring bzero((void *)txr->tx_base, (sizeof(union ixgbe_adv_tx_desc)) * adapter->num_tx_desc); /* Reset indices */ - txr->next_avail_tx_desc = 0; - txr->next_tx_to_clean = 0; + txr->next_avail_desc = 0; + txr->next_to_clean = 0; /* Free any existing tx buffers. */ txbuf = txr->tx_buffers; @@ -2850,6 +2891,12 @@ ixgbe_setup_transmit_ring(struct tx_ring txbuf->eop_index = -1; } +#ifdef IXGBE_FDIR + /* Set the rate at which we sample packets */ + if (adapter->hw.mac.type == ixgbe_mac_82599EB) + txr->atr_sample = atr_sample_rate; +#endif + /* Set number of descriptors available */ txr->tx_avail = adapter->num_tx_desc; @@ -2888,6 +2935,7 @@ ixgbe_initialize_transmit_units(struct a for (int i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; + u32 txctrl; IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba & 0x00000000ffffffffULL)); @@ -2901,15 +2949,43 @@ ixgbe_initialize_transmit_units(struct a /* Setup Transmit Descriptor Cmd Settings */ txr->txd_cmd = IXGBE_TXD_CMD_IFCS; + txr->watchdog_check = FALSE; + + /* Disable Head Writeback */ + switch (hw->mac.type) { + case ixgbe_mac_82598EB: + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL(i)); + break; + case ixgbe_mac_82599EB: + default: + txctrl = IXGBE_READ_REG(hw, IXGBE_DCA_TXCTRL_82599(i)); + break; + } + txctrl &= ~IXGBE_DCA_TXCTRL_TX_WB_RO_EN; + switch (hw->mac.type) { + case ixgbe_mac_82598EB: + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL(i), txctrl); + break; + case ixgbe_mac_82599EB: + default: + IXGBE_WRITE_REG(hw, IXGBE_DCA_TXCTRL_82599(i), txctrl); + break; + } - txr->watchdog_timer = 0; } if (hw->mac.type == ixgbe_mac_82599EB) { - u32 dmatxctl; + u32 dmatxctl, rttdcs; dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); dmatxctl |= IXGBE_DMATXCTL_TE; IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, dmatxctl); + /* Disable arbiter to set MTQC */ + rttdcs = IXGBE_READ_REG(hw, IXGBE_RTTDCS); + rttdcs |= IXGBE_RTTDCS_ARBDIS; + IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); + IXGBE_WRITE_REG(hw, IXGBE_MTQC, IXGBE_MTQC_64Q_1PB); + rttdcs &= ~IXGBE_RTTDCS_ARBDIS; + IXGBE_WRITE_REG(hw, IXGBE_RTTDCS, rttdcs); } return; @@ -3009,7 +3085,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, u16 etype; u8 ipproto = 0; bool offload = TRUE; - int ctxd = txr->next_avail_tx_desc; + int ctxd = txr->next_avail_desc; u16 vtag = 0; @@ -3099,7 +3175,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, /* We've consumed the first desc, adjust counters */ if (++ctxd == adapter->num_tx_desc) ctxd = 0; - txr->next_avail_tx_desc = ctxd; + txr->next_avail_desc = ctxd; --txr->tx_avail; return (offload); @@ -3140,7 +3216,7 @@ ixgbe_tso_setup(struct tx_ring *txr, str if (mp->m_len < ehdrlen + sizeof(struct ip) + sizeof(struct tcphdr)) return FALSE; - ctxd = txr->next_avail_tx_desc; + ctxd = txr->next_avail_desc; tx_buffer = &txr->tx_buffers[ctxd]; TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:42:33 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id B55FE106566B; Mon, 7 Dec 2009 21:42:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 7 Dec 2009 16:42:14 -0500 User-Agent: KMail/1.6.2 References: <200912072124.nB7LO7Ji066470@svn.freebsd.org> In-Reply-To: <200912072124.nB7LO7Ji066470@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912071642.17980.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r200238 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:42:33 -0000 On Monday 07 December 2009 04:24 pm, Jung-uk Kim wrote: > Author: jkim > Date: Mon Dec 7 21:24:07 2009 > New Revision: 200238 > URL: http://svn.freebsd.org/changeset/base/200238 > > Log: > Revert r200231. It was already taken cared by jhb long ago. ^ and ambrisko. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Mon Dec 7 21:45:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E059C106568D; Mon, 7 Dec 2009 21:45:32 +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 B1D928FC1A; Mon, 7 Dec 2009 21:45:32 +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 651FD46B03; Mon, 7 Dec 2009 16:45:32 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id C95078A01D; Mon, 7 Dec 2009 16:45:31 -0500 (EST) From: John Baldwin To: "Jung-uk Kim" Date: Mon, 7 Dec 2009 16:45:20 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912072124.nB7LO7Ji066470@svn.freebsd.org> In-Reply-To: <200912072124.nB7LO7Ji066470@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912071645.20402.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 07 Dec 2009 16:45:31 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no 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: r200238 - head/sys/dev/mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 21:45:33 -0000 On Monday 07 December 2009 4:24:07 pm Jung-uk Kim wrote: > Author: jkim > Date: Mon Dec 7 21:24:07 2009 > New Revision: 200238 > URL: http://svn.freebsd.org/changeset/base/200238 > > Log: > Revert r200231. It was already taken cared by jhb long ago. > > Pointed out by: jhb > Pointy hat: jkim Thanks. No pointy hat needed though. :) -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 00:44:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0299C106566C; Tue, 8 Dec 2009 00:44:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E627F8FC15; Tue, 8 Dec 2009 00:44: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 nB80iNIQ070644; Tue, 8 Dec 2009 00:44:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB80iNmv070642; Tue, 8 Dec 2009 00:44:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912080044.nB80iNmv070642@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 8 Dec 2009 00:44: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: r200240 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 00:44:24 -0000 Author: marcel Date: Tue Dec 8 00:44:23 2009 New Revision: 200240 URL: http://svn.freebsd.org/changeset/base/200240 Log: In exception_save, write-back ar.rnat after switching the backing- store. Writing to ar.bspstore is defined to leave ar.rnat undefined. PR: ia64/120315 MFC after: 3 days Modified: head/sys/ia64/ia64/exception.S Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Mon Dec 7 21:30:54 2009 (r200239) +++ head/sys/ia64/ia64/exception.S Tue Dec 8 00:44:23 2009 (r200240) @@ -228,43 +228,42 @@ exception_save_restart: (p13) dep r20=r20,r21,0,9 // align dirty registers ;; } - // r20=bspstore, r22=iip, r23=ipsr + // r19=rnat, r20=bspstore, r22=iip, r23=ipsr { .mmi st8 [r31]=r23,16 // psr (p13) mov ar.bspstore=r20 nop 0 ;; } -{ .mmi +{ .mmb +(p13) mov ar.rnat=r19 mov r18=ar.bsp - ;; - mov r19=cr.ifs - sub r18=r18,r20 + nop 0 ;; } { .mmi + mov r19=cr.ifs st8.spill [r30]=gp,16 // gp - st8 [r31]=r18,16 // ndirty - nop 0 + sub r18=r18,r20 ;; } // r19=ifs, r22=iip -{ .mmi +{ .mmb + st8 [r31]=r18,16 // ndirty st8 [r30]=r19,16 // cfm - st8 [r31]=r22,16 // iip nop 0 ;; } { .mmi - st8 [r30]=r17 // ifa mov r18=cr.isr + st8 [r31]=r22,16 // iip add r29=16,r30 ;; } -{ .mmi - st8 [r31]=r18 // isr - add r30=8,r29 - add r31=16,r29 +{ .mmb + st8 [r30]=r17,24 // ifa + st8 [r31]=r18,24 // isr + nop 0 ;; } { .mmi From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 00:52:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C054F1065670; Tue, 8 Dec 2009 00:52:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF05D8FC15; Tue, 8 Dec 2009 00:52: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 nB80qxdv070870; Tue, 8 Dec 2009 00:52:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB80qxXA070868; Tue, 8 Dec 2009 00:52:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912080052.nB80qxXA070868@svn.freebsd.org> From: Rui Paulo Date: Tue, 8 Dec 2009 00:52: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: r200241 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 00:52:59 -0000 Author: rpaulo Date: Tue Dec 8 00:52:59 2009 New Revision: 200241 URL: http://svn.freebsd.org/changeset/base/200241 Log: Improve response to multi-touch taps. Submitted by: Rohit Grover Modified: head/sys/dev/usb/input/atp.c Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Tue Dec 8 00:44:23 2009 (r200240) +++ head/sys/dev/usb/input/atp.c Tue Dec 8 00:52:59 2009 (r200241) @@ -437,7 +437,7 @@ static void atp_detect_pspans(i /* movement detection */ static boolean_t atp_match_stroke_component(atp_stroke_component *, - const atp_pspan *); + const atp_pspan *, atp_stroke_type); static void atp_match_strokes_against_pspans(struct atp_softc *, atp_axis, atp_pspan *, u_int, u_int); static boolean_t atp_update_strokes(struct atp_softc *, @@ -458,6 +458,7 @@ static boolean_t atp_compute_stroke_ /* tap detection */ static __inline void atp_setup_reap_time(struct atp_softc *, struct timeval *); static void atp_reap_zombies(struct atp_softc *, u_int *, u_int *); +static void atp_convert_to_slide(struct atp_softc *, atp_stroke *); /* updating fifo */ static void atp_reset_buf(struct atp_softc *sc); @@ -725,7 +726,7 @@ atp_interpret_sensor_data(const int8_t * for (i = 0, di = (axis == Y) ? 1 : 2; i < 8; di += 5, i++) { arr[i] = sensor_data[di]; arr[i+8] = sensor_data[di+2]; - if (axis == X && num > 16) + if (axis == X && num > 16) arr[i+16] = sensor_data[di+40]; } @@ -879,23 +880,43 @@ atp_detect_pspans(int *p, u_int num_sens */ static boolean_t atp_match_stroke_component(atp_stroke_component *component, - const atp_pspan *pspan) + const atp_pspan *pspan, atp_stroke_type stroke_type) { - int delta_mickeys = pspan->loc - component->loc; + int delta_mickeys; + u_int min_pressure; + + delta_mickeys = pspan->loc - component->loc; if (abs(delta_mickeys) > atp_max_delta_mickeys) return (FALSE); /* the finger span is too far out; no match */ component->loc = pspan->loc; + + /* + * A sudden and significant increase in a pspan's cumulative + * pressure indicates the incidence of a new finger + * contact. This usually revises the pspan's + * centre-of-gravity, and hence the location of any/all + * matching stroke component(s). But such a change should + * *not* be interpreted as a movement. + */ + if (pspan->cum > ((3 * component->cum_pressure) >> 1)) + delta_mickeys = 0; + component->cum_pressure = pspan->cum; if (pspan->cum > component->max_cum_pressure) component->max_cum_pressure = pspan->cum; /* - * If the cumulative pressure drops below a quarter of the max, - * then disregard the component's movement. + * Disregard the component's movement if its cumulative + * pressure drops below a fraction of the maximum; this + * fraction is determined based on the stroke's type. */ - if (component->cum_pressure < (component->max_cum_pressure >> 2)) + if (stroke_type == ATP_STROKE_TOUCH) + min_pressure = (3 * component->max_cum_pressure) >> 2; + else + min_pressure = component->max_cum_pressure >> 2; + if (component->cum_pressure < min_pressure) delta_mickeys = 0; component->delta_mickeys = delta_mickeys; @@ -930,7 +951,8 @@ atp_match_strokes_against_pspans(struct continue; /* skip matched pspans */ if (atp_match_stroke_component( - &stroke->components[axis], &pspans[j])) { + &stroke->components[axis], &pspans[j], + stroke->type)) { /* There is a match. */ stroke->components[axis].matched = TRUE; @@ -1065,19 +1087,23 @@ atp_update_strokes(struct atp_softc *sc, for (i = 0; i < sc->sc_n_strokes; i++) { atp_stroke *stroke = &sc->sc_strokes[i]; - printf(" %s%clc:%u,dm:%d,pnd:%d,mv:%d%c" - ",%clc:%u,dm:%d,pnd:%d,mv:%d%c", + printf(" %s%clc:%u,dm:%d,pnd:%d,cum:%d,max:%d,mv:%d%c" + ",%clc:%u,dm:%d,pnd:%d,cum:%d,max:%d,mv:%d%c", (stroke->flags & ATSF_ZOMBIE) ? "zomb:" : "", (stroke->type == ATP_STROKE_TOUCH) ? '[' : '<', stroke->components[X].loc, stroke->components[X].delta_mickeys, stroke->components[X].pending, + stroke->components[X].cum_pressure, + stroke->components[X].max_cum_pressure, stroke->components[X].movement, (stroke->type == ATP_STROKE_TOUCH) ? ']' : '>', (stroke->type == ATP_STROKE_TOUCH) ? '[' : '<', stroke->components[Y].loc, stroke->components[Y].delta_mickeys, stroke->components[Y].pending, + stroke->components[Y].cum_pressure, + stroke->components[Y].max_cum_pressure, stroke->components[Y].movement, (stroke->type == ATP_STROKE_TOUCH) ? ']' : '>'); } @@ -1218,51 +1244,94 @@ atp_advance_stroke_state(struct atp_soft if (atp_compute_stroke_movement(stroke)) *movement = TRUE; + if (stroke->type != ATP_STROKE_TOUCH) + return; + /* Convert touch strokes to slides upon detecting movement or age. */ - if (stroke->type == ATP_STROKE_TOUCH) { - struct timeval tdiff; + if (stroke->cum_movement >= atp_slide_min_movement) { + atp_convert_to_slide(sc, stroke); + } else { + /* If a touch stroke is found to be older than the + * touch-timeout threshold, it should be converted to + * a slide; except if there is a co-incident sibling + * with a later creation time. + * + * When multiple fingers make contact with the + * touchpad, they are likely to be separated in their + * times of incidence. During a multi-finger tap, + * therefore, the last finger to make + * contact--i.e. the one with the latest + * 'ctime'--should be used to determine how the + * touch-siblings get treated; otherwise older + * siblings may lapse the touch-timeout and get + * converted into slides prematurely. The following + * loop determines if there exists another touch + * stroke with a larger 'ctime' than the current + * stroke (NOTE: zombies with a larger 'ctime' are + * also considered) . + */ - /* Compute the stroke's age. */ - getmicrotime(&tdiff); - if (timevalcmp(&tdiff, &stroke->ctime, >)) - timevalsub(&tdiff, &stroke->ctime); - else { - /* - * If we are here, it is because getmicrotime - * reported the current time as being behind - * the stroke's start time; getmicrotime can - * be imprecise. - */ - tdiff.tv_sec = 0; - tdiff.tv_usec = 0; - } + u_int i; + for (i = 0; i < sc->sc_n_strokes; i++) { + if ((&sc->sc_strokes[i] == stroke) || + (sc->sc_strokes[i].type != ATP_STROKE_TOUCH)) + continue; - if ((tdiff.tv_sec > (atp_touch_timeout / 1000000)) || - ((tdiff.tv_sec == (atp_touch_timeout / 1000000)) && - (tdiff.tv_usec > atp_touch_timeout)) || - (stroke->cum_movement >= atp_slide_min_movement)) { - /* Switch this stroke to being a slide. */ - stroke->type = ATP_STROKE_SLIDE; - - /* Are we at the beginning of a double-click-n-drag? */ - if ((sc->sc_n_strokes == 1) && - ((sc->sc_state & ATP_ZOMBIES_EXIST) == 0) && - timevalcmp(&stroke->ctime, &sc->sc_reap_time, >)) { - struct timeval delta; - struct timeval window = { - atp_double_tap_threshold / 1000000, - atp_double_tap_threshold % 1000000 - }; - - delta = stroke->ctime; - timevalsub(&delta, &sc->sc_reap_time); - if (timevalcmp(&delta, &window, <=)) - sc->sc_state |= ATP_DOUBLE_TAP_DRAG; + if (timevalcmp(&sc->sc_strokes[i].ctime, + &stroke->ctime, >)) + break; + } + if (i == sc->sc_n_strokes) { + /* Found no other touch stroke with a larger 'ctime'. */ + struct timeval tdiff; + + /* Compute the stroke's age. */ + getmicrotime(&tdiff); + if (timevalcmp(&tdiff, &stroke->ctime, >)) + timevalsub(&tdiff, &stroke->ctime); + else { + /* + * If we are here, it is because getmicrotime + * reported the current time as being behind + * the stroke's start time; getmicrotime can + * be imprecise. + */ + tdiff.tv_sec = 0; + tdiff.tv_usec = 0; } + + if ((tdiff.tv_sec > (atp_touch_timeout / 1000000)) || + ((tdiff.tv_sec == (atp_touch_timeout / 1000000)) && + (tdiff.tv_usec >= + (atp_touch_timeout % 1000000)))) + atp_convert_to_slide(sc, stroke); } } } +/* Switch a given touch stroke to being a slide. */ +void +atp_convert_to_slide(struct atp_softc *sc, atp_stroke *stroke) +{ + stroke->type = ATP_STROKE_SLIDE; + + /* Are we at the beginning of a double-click-n-drag? */ + if ((sc->sc_n_strokes == 1) && + ((sc->sc_state & ATP_ZOMBIES_EXIST) == 0) && + timevalcmp(&stroke->ctime, &sc->sc_reap_time, >)) { + struct timeval delta; + struct timeval window = { + atp_double_tap_threshold / 1000000, + atp_double_tap_threshold % 1000000 + }; + + delta = stroke->ctime; + timevalsub(&delta, &sc->sc_reap_time); + if (timevalcmp(&delta, &window, <=)) + sc->sc_state |= ATP_DOUBLE_TAP_DRAG; + } +} + /* * Terminate a stroke. While SLIDE strokes are dropped, TOUCH strokes * are retained as zombies so as to reap all their siblings together; @@ -1723,7 +1792,7 @@ atp_intr(struct usb_xfer *xfer, usb_erro */ status_bits = sc->sensor_data[sc->sc_params->data_len - 1]; if ((sc->sc_params->prot == ATP_PROT_GEYSER3 && - (status_bits & ATP_STATUS_BASE_UPDATE)) || + (status_bits & ATP_STATUS_BASE_UPDATE)) || !(sc->sc_state & ATP_VALID)) { memcpy(sc->base_x, sc->cur_x, sc->sc_params->n_xsensors * sizeof(*(sc->base_x))); From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 00:54:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7C13106566B; Tue, 8 Dec 2009 00:54:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D75BD8FC1C; Tue, 8 Dec 2009 00:54: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 nB80s8pN070932; Tue, 8 Dec 2009 00:54:08 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB80s874070930; Tue, 8 Dec 2009 00:54:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912080054.nB80s874070930@svn.freebsd.org> From: Rui Paulo Date: Tue, 8 Dec 2009 00:54: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: r200242 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 00:54:09 -0000 Author: rpaulo Date: Tue Dec 8 00:54:08 2009 New Revision: 200242 URL: http://svn.freebsd.org/changeset/base/200242 Log: Fix typo in comment Submitted by: Paul B Mahol Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Tue Dec 8 00:52:59 2009 (r200241) +++ head/sys/net80211/ieee80211_hostap.c Tue Dec 8 00:54:08 2009 (r200242) @@ -1252,7 +1252,7 @@ ieee80211_parse_wpa(struct ieee80211vap return IEEE80211_REASON_IE_INVALID; } frm += 6, len -= 4; /* NB: len is payload only */ - /* NB: iswapoui already validated the OUI and type */ + /* NB: iswpaoui already validated the OUI and type */ w = LE_READ_2(frm); if (w != WPA_VERSION) { IEEE80211_DISCARD_IE(vap, From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 01:07:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F8C51065670; Tue, 8 Dec 2009 01:07:45 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DA748FC15; Tue, 8 Dec 2009 01:07: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 nB817jV2071274; Tue, 8 Dec 2009 01:07:45 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB817jb0071266; Tue, 8 Dec 2009 01:07:45 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912080107.nB817jb0071266@svn.freebsd.org> From: Jack F Vogel Date: Tue, 8 Dec 2009 01:07: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: r200243 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 01:07:45 -0000 Author: jfv Date: Tue Dec 8 01:07:44 2009 New Revision: 200243 URL: http://svn.freebsd.org/changeset/base/200243 Log: Resync with Intel versions of both the em and igb drivers. These add new hardware support, most importantly the pch (i5 chipset) in the em driver. Also, both drivers now have the simplified (and I hope improved) watchdog code. The igb driver uses the new RX cleanup that I first implemented in ixgbe. em - version 6.9.24 igb - version 1.8.4 Modified: head/sys/dev/e1000/LICENSE head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_80003es2lan.h head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_manage.c head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_igb.h Modified: head/sys/dev/e1000/LICENSE ============================================================================== --- head/sys/dev/e1000/LICENSE Tue Dec 8 00:54:08 2009 (r200242) +++ head/sys/dev/e1000/LICENSE Tue Dec 8 01:07:44 2009 (r200243) @@ -1,6 +1,6 @@ $FreeBSD$ - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Tue Dec 8 00:54:08 2009 (r200242) +++ head/sys/dev/e1000/e1000_80003es2lan.c Tue Dec 8 01:07:44 2009 (r200243) @@ -171,7 +171,7 @@ static s32 e1000_init_nvm_params_80003es break; } - nvm->type = e1000_nvm_eeprom_spi; + nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> E1000_EECD_SIZE_EX_SHIFT); @@ -206,17 +206,22 @@ static s32 e1000_init_nvm_params_80003es static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_init_mac_params_80003es2lan"); - /* Set media type */ + /* Set media type and media-dependent function pointers */ switch (hw->device_id) { case E1000_DEV_ID_80003ES2LAN_SERDES_DPT: hw->phy.media_type = e1000_media_type_internal_serdes; + mac->ops.check_for_link = e1000_check_for_serdes_link_generic; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_generic; break; default: hw->phy.media_type = e1000_media_type_copper; + mac->ops.check_for_link = e1000_check_for_copper_link_generic; + mac->ops.setup_physical_interface = + e1000_setup_copper_link_80003es2lan; break; } @@ -230,6 +235,8 @@ static s32 e1000_init_mac_params_80003es mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) ? TRUE : FALSE; + /* Adaptive IFS not supported */ + mac->adaptive_ifs = FALSE; /* Function pointers */ @@ -241,27 +248,6 @@ static s32 e1000_init_mac_params_80003es mac->ops.init_hw = e1000_init_hw_80003es2lan; /* link setup */ mac->ops.setup_link = e1000_setup_link_generic; - /* physical interface link setup */ - mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_80003es2lan - : e1000_setup_fiber_serdes_link_generic; - /* check for link */ - switch (hw->phy.media_type) { - case e1000_media_type_copper: - mac->ops.check_for_link = e1000_check_for_copper_link_generic; - break; - case e1000_media_type_fiber: - mac->ops.check_for_link = e1000_check_for_fiber_link_generic; - break; - case e1000_media_type_internal_serdes: - mac->ops.check_for_link = e1000_check_for_serdes_link_generic; - break; - default: - ret_val = -E1000_ERR_CONFIG; - goto out; - break; - } /* check management mode */ mac->ops.check_mng_mode = e1000_check_mng_mode_generic; /* multicast address update */ @@ -290,8 +276,10 @@ static s32 e1000_init_mac_params_80003es /* link info */ mac->ops.get_link_up_info = e1000_get_link_up_info_80003es2lan; -out: - return ret_val; + /* set lan id for port to determine which phy lock to use */ + hw->mac.ops.set_lan_id(hw); + + return E1000_SUCCESS; } /** @@ -307,7 +295,6 @@ void e1000_init_function_pointers_80003e hw->mac.ops.init_params = e1000_init_mac_params_80003es2lan; hw->nvm.ops.init_params = e1000_init_nvm_params_80003es2lan; hw->phy.ops.init_params = e1000_init_phy_params_80003es2lan; - e1000_get_bus_info_pcie_generic(hw); } /** @@ -342,7 +329,6 @@ static void e1000_release_phy_80003es2la e1000_release_swfw_sync_80003es2lan(hw, mask); } - /** * e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register * @hw: pointer to the HW structure @@ -532,28 +518,36 @@ static s32 e1000_read_phy_reg_gg82563_80 goto out; } - /* - * The "ready" bit in the MDIC register may be incorrectly set - * before the device has completed the "Page Select" MDI - * transaction. So we wait 200us after each MDI command... - */ - usec_delay(200); + if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { + /* + * The "ready" bit in the MDIC register may be incorrectly set + * before the device has completed the "Page Select" MDI + * transaction. So we wait 200us after each MDI command... + */ + usec_delay(200); - /* ...and verify the command was successful. */ - ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); + /* ...and verify the command was successful. */ + ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); - if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; - e1000_release_phy_80003es2lan(hw); - goto out; - } + if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { + ret_val = -E1000_ERR_PHY; + e1000_release_phy_80003es2lan(hw); + goto out; + } + + usec_delay(200); - usec_delay(200); + ret_val = e1000_read_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); - ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, - data); + usec_delay(200); + } else { + ret_val = e1000_read_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); + } - usec_delay(200); e1000_release_phy_80003es2lan(hw); out: @@ -599,29 +593,36 @@ static s32 e1000_write_phy_reg_gg82563_8 goto out; } + if (hw->dev_spec._80003es2lan.mdic_wa_enable == TRUE) { + /* + * The "ready" bit in the MDIC register may be incorrectly set + * before the device has completed the "Page Select" MDI + * transaction. So we wait 200us after each MDI command... + */ + usec_delay(200); - /* - * The "ready" bit in the MDIC register may be incorrectly set - * before the device has completed the "Page Select" MDI - * transaction. So we wait 200us after each MDI command... - */ - usec_delay(200); + /* ...and verify the command was successful. */ + ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); - /* ...and verify the command was successful. */ - ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp); + if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { + ret_val = -E1000_ERR_PHY; + e1000_release_phy_80003es2lan(hw); + goto out; + } - if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) { - ret_val = -E1000_ERR_PHY; - e1000_release_phy_80003es2lan(hw); - goto out; - } + usec_delay(200); - usec_delay(200); + ret_val = e1000_write_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); - ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset, - data); + usec_delay(200); + } else { + ret_val = e1000_write_phy_reg_mdic(hw, + MAX_PHY_REG_ADDRESS & offset, + data); + } - usec_delay(200); e1000_release_phy_80003es2lan(hw); out: @@ -802,13 +803,13 @@ static s32 e1000_get_cable_length_80003e index = phy_data & GG82563_DSPD_CABLE_LENGTH; - if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE + 5) { - ret_val = E1000_ERR_PHY; + if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) { + ret_val = -E1000_ERR_PHY; goto out; } phy->min_cable_length = e1000_gg82563_cable_length_table[index]; - phy->max_cable_length = e1000_gg82563_cable_length_table[index+5]; + phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5]; phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; @@ -916,10 +917,9 @@ static s32 e1000_init_hw_80003es2lan(str /* Initialize identification LED */ ret_val = mac->ops.id_led_init(hw); - if (ret_val) { + if (ret_val) DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ - } /* Disabling VLAN filtering */ DEBUGOUT("Initializing the IEEE VLAN\n"); @@ -969,6 +969,19 @@ static s32 e1000_init_hw_80003es2lan(str reg_data &= ~0x00100000; E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data); + /* default to TRUE to enable the MDIC W/A */ + hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE; + + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, + E1000_KMRNCTRLSTA_OFFSET >> + E1000_KMRNCTRLSTA_OFFSET_SHIFT, + &i); + if (!ret_val) { + if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) == + E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO) + hw->dev_spec._80003es2lan.mdic_wa_enable = FALSE; + } + /* * Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link @@ -1303,7 +1316,6 @@ static s32 e1000_cfg_kmrn_10_100_80003es tipg |= DEFAULT_TIPG_IPGT_10_100_80003ES2LAN; E1000_WRITE_REG(hw, E1000_TIPG, tipg); - do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); @@ -1357,7 +1369,6 @@ static s32 e1000_cfg_kmrn_1000_80003es2l tipg |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN; E1000_WRITE_REG(hw, E1000_TIPG, tipg); - do { ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, ®_data); Modified: head/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.h Tue Dec 8 00:54:08 2009 (r200242) +++ head/sys/dev/e1000/e1000_80003es2lan.h Tue Dec 8 01:07:44 2009 (r200243) @@ -1,6 +1,6 @@ -/******************************************************************************* +/****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2009, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -29,9 +29,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*******************************************************************************/ -/* $FreeBSD$ */ - +******************************************************************************/ +/*$FreeBSD$*/ #ifndef _E1000_80003ES2LAN_H_ #define _E1000_80003ES2LAN_H_ @@ -49,6 +48,9 @@ #define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000 #define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000 +#define E1000_KMRNCTRLSTA_OPMODE_MASK 0x000C +#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO 0x0004 + #define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */ #define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000 Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Tue Dec 8 00:54:08 2009 (r200242) +++ head/sys/dev/e1000/e1000_82541.c Tue Dec 8 01:07:44 2009 (r200243) @@ -59,6 +59,7 @@ static s32 e1000_set_d3_lplu_state_8254 static s32 e1000_setup_led_82541(struct e1000_hw *hw); static s32 e1000_cleanup_led_82541(struct e1000_hw *hw); static void e1000_clear_hw_cntrs_82541(struct e1000_hw *hw); +static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw); static s32 e1000_config_dsp_after_link_change_82541(struct e1000_hw *hw, bool link_up); static s32 e1000_phy_init_script_82541(struct e1000_hw *hw); @@ -261,6 +262,8 @@ static s32 e1000_init_mac_params_82541(s mac->ops.clear_vfta = e1000_clear_vfta_generic; /* setting MTA */ mac->ops.mta_set = e1000_mta_set_generic; + /* read mac address */ + mac->ops.read_mac_addr = e1000_read_mac_addr_82541; /* ID LED init */ mac->ops.id_led_init = e1000_id_led_init_generic; /* setup LED */ @@ -1292,3 +1295,35 @@ static void e1000_clear_hw_cntrs_82541(s E1000_READ_REG(hw, E1000_MGTPDC); E1000_READ_REG(hw, E1000_MGTPTC); } + +/** + * e1000_read_mac_addr_82541 - Read device MAC address + * @hw: pointer to the HW structure + * + * Reads the device MAC address from the EEPROM and stores the value. + **/ +static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u16 offset, nvm_data, i; + + DEBUGFUNC("e1000_read_mac_addr"); + + for (i = 0; i < ETH_ADDR_LEN; i += 2) { + offset = i >> 1; + ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + goto out; + } + hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); + hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); + } + + for (i = 0; i < ETH_ADDR_LEN; i++) + hw->mac.addr[i] = hw->mac.perm_addr[i]; + +out: + return ret_val; +} + Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Tue Dec 8 00:54:08 2009 (r200242) +++ head/sys/dev/e1000/e1000_82571.c Tue Dec 8 01:07:44 2009 (r200243) @@ -46,7 +46,6 @@ * 82573E Gigabit Ethernet Controller (Copper) * 82573L Gigabit Ethernet Controller * 82574L Gigabit Network Connection - * 82574L Gigabit Network Connection * 82583V Gigabit Network Connection */ @@ -106,7 +105,6 @@ static s32 e1000_init_phy_params_82571(s phy->reset_delay_us = 100; phy->ops.acquire = e1000_get_hw_semaphore_82571; - phy->ops.check_polarity = e1000_check_polarity_igp; phy->ops.check_reset_block = e1000_check_reset_block_generic; phy->ops.release = e1000_put_hw_semaphore_82571; phy->ops.reset = e1000_phy_hw_reset_generic; @@ -121,6 +119,7 @@ static s32 e1000_init_phy_params_82571(s phy->type = e1000_phy_igp_2; phy->ops.get_cfg_done = e1000_get_cfg_done_82571; phy->ops.get_info = e1000_get_phy_info_igp; + phy->ops.check_polarity = e1000_check_polarity_igp; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; phy->ops.get_cable_length = e1000_get_cable_length_igp_2; phy->ops.read_reg = e1000_read_phy_reg_igp; @@ -132,6 +131,7 @@ static s32 e1000_init_phy_params_82571(s /* Verify PHY ID */ if (phy->id != IGP01E1000_I_PHY_ID) { ret_val = -E1000_ERR_PHY; + DEBUGOUT1("PHY ID unknown: type = 0x%08x\n", phy->id); goto out; } break; @@ -139,6 +139,7 @@ static s32 e1000_init_phy_params_82571(s phy->type = e1000_phy_m88; phy->ops.get_cfg_done = e1000_get_cfg_done_generic; phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; phy->ops.get_cable_length = e1000_get_cable_length_m88; @@ -155,11 +156,12 @@ static s32 e1000_init_phy_params_82571(s goto out; } break; - case e1000_82583: case e1000_82574: + case e1000_82583: phy->type = e1000_phy_bm; phy->ops.get_cfg_done = e1000_get_cfg_done_generic; phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; phy->ops.get_cable_length = e1000_get_cable_length_m88; @@ -266,28 +268,42 @@ static s32 e1000_init_nvm_params_82571(s static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; - s32 ret_val = E1000_SUCCESS; u32 swsm = 0; u32 swsm2 = 0; bool force_clear_smbi = FALSE; DEBUGFUNC("e1000_init_mac_params_82571"); - /* Set media type */ + /* Set media type and media-dependent function pointers */ switch (hw->device_id) { case E1000_DEV_ID_82571EB_FIBER: case E1000_DEV_ID_82572EI_FIBER: case E1000_DEV_ID_82571EB_QUAD_FIBER: hw->phy.media_type = e1000_media_type_fiber; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_82571; + mac->ops.check_for_link = e1000_check_for_fiber_link_generic; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_fiber_serdes_generic; break; case E1000_DEV_ID_82571EB_SERDES: case E1000_DEV_ID_82571EB_SERDES_DUAL: case E1000_DEV_ID_82571EB_SERDES_QUAD: case E1000_DEV_ID_82572EI_SERDES: hw->phy.media_type = e1000_media_type_internal_serdes; + mac->ops.setup_physical_interface = + e1000_setup_fiber_serdes_link_82571; + mac->ops.check_for_link = e1000_check_for_serdes_link_82571; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_fiber_serdes_generic; break; default: hw->phy.media_type = e1000_media_type_copper; + mac->ops.setup_physical_interface = + e1000_setup_copper_link_82571; + mac->ops.check_for_link = e1000_check_for_copper_link_generic; + mac->ops.get_link_up_info = + e1000_get_speed_and_duplex_copper_generic; break; } @@ -301,58 +317,19 @@ static s32 e1000_init_mac_params_82571(s mac->arc_subsystem_valid = (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK) ? TRUE : FALSE; + /* Adaptive IFS supported */ + mac->adaptive_ifs = TRUE; /* Function pointers */ /* bus type/speed/width */ mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic; - /* function id */ - switch (hw->mac.type) { - case e1000_82573: - case e1000_82574: - case e1000_82583: - mac->ops.set_lan_id = e1000_set_lan_id_single_port; - break; - default: - break; - } /* reset */ mac->ops.reset_hw = e1000_reset_hw_82571; /* hw initialization */ mac->ops.init_hw = e1000_init_hw_82571; /* link setup */ mac->ops.setup_link = e1000_setup_link_82571; - /* physical interface link setup */ - mac->ops.setup_physical_interface = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_setup_copper_link_82571 - : e1000_setup_fiber_serdes_link_82571; - /* check for link */ - switch (hw->phy.media_type) { - case e1000_media_type_copper: - mac->ops.check_for_link = e1000_check_for_copper_link_generic; - break; - case e1000_media_type_fiber: - mac->ops.check_for_link = e1000_check_for_fiber_link_generic; - break; - case e1000_media_type_internal_serdes: - mac->ops.check_for_link = e1000_check_for_serdes_link_82571; - break; - default: - ret_val = -E1000_ERR_CONFIG; - goto out; - break; - } - /* check management mode */ - switch (hw->mac.type) { - case e1000_82574: - case e1000_82583: - mac->ops.check_mng_mode = e1000_check_mng_mode_82574; - break; - default: - mac->ops.check_mng_mode = e1000_check_mng_mode_generic; - break; - } /* multicast address update */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; /* writing VFTA */ @@ -371,24 +348,29 @@ static s32 e1000_init_mac_params_82571(s mac->ops.setup_led = e1000_setup_led_generic; /* cleanup LED */ mac->ops.cleanup_led = e1000_cleanup_led_generic; - /* turn on/off LED */ + /* turn off LED */ + mac->ops.led_off = e1000_led_off_generic; + /* clear hardware counters */ + mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82571; + + /* MAC-specific function pointers */ switch (hw->mac.type) { + case e1000_82573: + mac->ops.set_lan_id = e1000_set_lan_id_single_port; + mac->ops.check_mng_mode = e1000_check_mng_mode_generic; + mac->ops.led_on = e1000_led_on_generic; + break; case e1000_82574: case e1000_82583: + mac->ops.set_lan_id = e1000_set_lan_id_single_port; + mac->ops.check_mng_mode = e1000_check_mng_mode_82574; mac->ops.led_on = e1000_led_on_82574; break; default: + mac->ops.check_mng_mode = e1000_check_mng_mode_generic; mac->ops.led_on = e1000_led_on_generic; break; } - mac->ops.led_off = e1000_led_off_generic; - /* clear hardware counters */ - mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82571; - /* link info */ - mac->ops.get_link_up_info = - (hw->phy.media_type == e1000_media_type_copper) - ? e1000_get_speed_and_duplex_copper_generic - : e1000_get_speed_and_duplex_fiber_serdes_generic; /* * Ensure that the inter-port SWSM.SMBI lock bit is clear before @@ -434,8 +416,7 @@ static s32 e1000_init_mac_params_82571(s */ hw->dev_spec._82571.smb_counter = 0; -out: - return ret_val; + return E1000_SUCCESS; } /** @@ -501,7 +482,6 @@ static s32 e1000_get_phy_id_82571(struct ret_val = -E1000_ERR_PHY; break; } - out: return ret_val; } @@ -512,7 +492,7 @@ out: * * Acquire the HW semaphore to access the PHY or NVM **/ -s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) +static s32 e1000_get_hw_semaphore_82571(struct e1000_hw *hw) { u32 swsm; s32 ret_val = E1000_SUCCESS; @@ -577,7 +557,7 @@ out: * * Release hardware semaphore used to access the PHY or NVM **/ -void e1000_put_hw_semaphore_82571(struct e1000_hw *hw) +static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw) { u32 swsm; @@ -610,9 +590,9 @@ static s32 e1000_acquire_nvm_82571(struc goto out; switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: break; default: ret_val = e1000_acquire_nvm_generic(hw); @@ -831,7 +811,8 @@ static s32 e1000_get_cfg_done_82571(stru DEBUGFUNC("e1000_get_cfg_done_82571"); while (timeout) { - if (E1000_READ_REG(hw, E1000_EEMNGCTL) & E1000_NVM_CFG_DONE_PORT_0) + if (E1000_READ_REG(hw, E1000_EEMNGCTL) & + E1000_NVM_CFG_DONE_PORT_0) break; msec_delay(1); timeout--; @@ -966,9 +947,9 @@ static s32 e1000_reset_hw_82571(struct e * Ownership defaults to firmware after a reset. */ switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; @@ -1014,9 +995,9 @@ static s32 e1000_reset_hw_82571(struct e */ switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: msec_delay(25); break; default: @@ -1061,10 +1042,9 @@ static s32 e1000_init_hw_82571(struct e1 /* Initialize identification LED */ ret_val = mac->ops.id_led_init(hw); - if (ret_val) { + if (ret_val) DEBUGOUT("Error initializing identification LED\n"); /* This is not fatal and we should not stop init due to this */ - } /* Disabling VLAN filtering */ DEBUGOUT("Initializing the IEEE VLAN\n"); @@ -1097,9 +1077,9 @@ static s32 e1000_init_hw_82571(struct e1 /* ...for both queues. */ switch (mac->type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: e1000_enable_tx_pkt_filtering_generic(hw); reg_data = E1000_READ_REG(hw, E1000_GCR); reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX; @@ -1108,8 +1088,8 @@ static s32 e1000_init_hw_82571(struct e1 default: reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1)); reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | - E1000_TXDCTL_FULL_TX_DESC_WB | - E1000_TXDCTL_COUNT_DESC; + E1000_TXDCTL_FULL_TX_DESC_WB | + E1000_TXDCTL_COUNT_DESC; E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data); break; } @@ -1178,11 +1158,10 @@ static void e1000_initialize_hw_bits_825 } /* Device Control */ - switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: reg = E1000_READ_REG(hw, E1000_CTRL); reg &= ~(1 << 29); E1000_WRITE_REG(hw, E1000_CTRL, reg); @@ -1193,9 +1172,9 @@ static void e1000_initialize_hw_bits_825 /* Extended Device Control */ switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: reg = E1000_READ_REG(hw, E1000_CTRL_EXT); reg &= ~(1 << 23); reg |= (1 << 22); @@ -1205,7 +1184,6 @@ static void e1000_initialize_hw_bits_825 break; } - if (hw->mac.type == e1000_82571) { reg = E1000_READ_REG(hw, E1000_PBA_ECC); reg |= E1000_PBA_ECC_CORR_EN; @@ -1216,7 +1194,6 @@ static void e1000_initialize_hw_bits_825 * Workaround for hardware errata. * Ensure that DMA Dynamic Clock gating is disabled on 82571 and 82572 */ - if ((hw->mac.type == e1000_82571) || (hw->mac.type == e1000_82572)) { reg = E1000_READ_REG(hw, E1000_CTRL_EXT); @@ -1225,13 +1202,13 @@ static void e1000_initialize_hw_bits_825 } /* PCI-Ex Control Registers */ - switch (hw->mac.type) { case e1000_82574: case e1000_82583: reg = E1000_READ_REG(hw, E1000_GCR); reg |= (1 << 22); E1000_WRITE_REG(hw, E1000_GCR, reg); + /* * Workaround for hardware errata. * apply workaround for hardware errata documented in errata @@ -1267,39 +1244,36 @@ static void e1000_clear_vfta_82571(struc DEBUGFUNC("e1000_clear_vfta_82571"); switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: if (hw->mng_cookie.vlan_id != 0) { /* - *The VFTA is a 4096b bit-field, each identifying - *a single VLAN ID. The following operations - *determine which 32b entry (i.e. offset) into the - *array we want to set the VLAN ID (i.e. bit) of - *the manageability unit. - */ + * The VFTA is a 4096b bit-field, each identifying + * a single VLAN ID. The following operations + * determine which 32b entry (i.e. offset) into the + * array we want to set the VLAN ID (i.e. bit) of + * the manageability unit. + */ vfta_offset = (hw->mng_cookie.vlan_id >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK; vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & E1000_VFTA_ENTRY_BIT_SHIFT_MASK); } - - for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { - /* - *If the offset we want to clear is the same offset of - *the manageability VLAN ID, then clear all bits except - *that of the manageability unit - */ - vfta_value = (offset == vfta_offset) ? - vfta_bit_in_reg : 0; - E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, - vfta_value); - E1000_WRITE_FLUSH(hw); - } break; default: break; } + for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { + /* + * If the offset we want to clear is the same offset of the + * manageability VLAN ID, then clear all bits except that of + * the manageability unit. + */ + vfta_value = (offset == vfta_offset) ? vfta_bit_in_reg : 0; + E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, offset, vfta_value); + E1000_WRITE_FLUSH(hw); + } } /** @@ -1369,9 +1343,9 @@ static s32 e1000_setup_link_82571(struct * set it to full. */ switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: if (hw->fc.requested_mode == e1000_fc_default) hw->fc.requested_mode = e1000_fc_full; break; @@ -1460,7 +1434,7 @@ static s32 e1000_setup_fiber_serdes_link * Reports the link state as up or down. * * If autonegotiation is supported by the link partner, the link state is - * determined by the result of autongotiation. This is the most likely case. + * determined by the result of autonegotiation. This is the most likely case. * If autonegotiation is not supported by the link partner, and the link * has a valid signal, force the link up. * @@ -1472,7 +1446,7 @@ static s32 e1000_setup_fiber_serdes_link * 4) forced_up (the link has been forced up, it did not autonegotiate) * **/ -s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) +static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; u32 rxcw; @@ -1524,9 +1498,10 @@ s32 e1000_check_for_serdes_link_82571(st case e1000_serdes_link_autoneg_progress: if (rxcw & E1000_RXCW_C) { - /* We received /C/ ordered sets, meaning the + /* + * We received /C/ ordered sets, meaning the * link partner has autonegotiated, and we can - * trust the Link Up (LU) status bit + * trust the Link Up (LU) status bit. */ if (status & E1000_STATUS_LU) { mac->serdes_link_state = @@ -1534,13 +1509,14 @@ s32 e1000_check_for_serdes_link_82571(st DEBUGOUT("AN_PROG -> AN_UP\n"); mac->serdes_has_link = TRUE; } else { - /* Autoneg completed, but failed */ + /* Autoneg completed, but failed. */ mac->serdes_link_state = e1000_serdes_link_down; DEBUGOUT("AN_PROG -> DOWN\n"); } } else { - /* The link partner did not autoneg. + /* + * The link partner did not autoneg. * Force link up and full duplex, and change * state to forced. */ @@ -1565,9 +1541,11 @@ s32 e1000_check_for_serdes_link_82571(st case e1000_serdes_link_down: default: - /* The link was down but the receiver has now gained + /* + * The link was down but the receiver has now gained * valid sync, so lets see if we can bring the link - * up. */ + * up. + */ E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); E1000_WRITE_REG(hw, E1000_CTRL, (ctrl & ~E1000_CTRL_SLU)); @@ -1583,9 +1561,9 @@ s32 e1000_check_for_serdes_link_82571(st DEBUGOUT("ANYSTATE -> DOWN\n"); } else { /* - * We have sync, and can tolerate one - * invalid (IV) codeword before declaring - * link down, so reread to look again + * We have sync, and can tolerate one invalid (IV) + * codeword before declaring link down, so reread + * to look again. */ usec_delay(10); rxcw = E1000_READ_REG(hw, E1000_RXCW); @@ -1621,15 +1599,15 @@ static s32 e1000_valid_led_default_82571 } switch (hw->mac.type) { + case e1000_82573: case e1000_82574: case e1000_82583: - case e1000_82573: - if(*data == ID_LED_RESERVED_F746) + if (*data == ID_LED_RESERVED_F746) *data = ID_LED_DEFAULT_82573; break; default: if (*data == ID_LED_RESERVED_0000 || - *data == ID_LED_RESERVED_FFFF) + *data == ID_LED_RESERVED_FFFF) *data = ID_LED_DEFAULT; break; } Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Tue Dec 8 00:54:08 2009 (r200242) +++ head/sys/dev/e1000/e1000_82575.c Tue Dec 8 01:07:44 2009 (r200243) @@ -59,16 +59,20 @@ static s32 e1000_phy_hw_reset_sgmii_825 static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, u16 *data); static s32 e1000_reset_hw_82575(struct e1000_hw *hw); +static s32 e1000_reset_hw_82580(struct e1000_hw *hw); +static s32 e1000_read_phy_reg_82580(struct e1000_hw *hw, + u32 offset, u16 *data); +static s32 e1000_write_phy_reg_82580(struct e1000_hw *hw, + u32 offset, u16 data); static s32 e1000_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active); static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw); -static s32 e1000_setup_fiber_serdes_link_82575(struct e1000_hw *hw); +static s32 e1000_setup_serdes_link_82575(struct e1000_hw *hw); static s32 e1000_valid_led_default_82575(struct e1000_hw *hw, u16 *data); static s32 e1000_write_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, u16 data); static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw); static s32 e1000_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask); -static s32 e1000_configure_pcs_link_82575(struct e1000_hw *hw); static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, u16 *duplex); static s32 e1000_get_phy_id_82575(struct e1000_hw *hw); @@ -77,9 +81,15 @@ static bool e1000_sgmii_active_82575(str static s32 e1000_reset_init_script_82575(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw); static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw); -void e1000_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw); +static void e1000_shutdown_serdes_link_82575(struct e1000_hw *hw); static s32 e1000_set_pcie_completion_timeout(struct e1000_hw *hw); +static const u16 e1000_82580_rxpbs_table[] = + { 36, 72, 144, 1, 2, 4, 8, 16, + 35, 70, 140 }; +#define E1000_82580_RXPBS_TABLE_SIZE \ + (sizeof(e1000_82580_rxpbs_table)/sizeof(u16)) + /** * e1000_init_phy_params_82575 - Init PHY func ptrs. * @hw: pointer to the HW structure @@ -94,11 +104,11 @@ static s32 e1000_init_phy_params_82575(s if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; goto out; - } else { - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82575; } + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_82575; + phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; phy->reset_delay_us = 100; @@ -112,6 +122,11 @@ static s32 e1000_init_phy_params_82575(s phy->ops.reset = e1000_phy_hw_reset_sgmii_82575; phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575; phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575; + } else if ((hw->mac.type == e1000_82580) || + (hw->mac.type == e1000_82580er)) { + phy->ops.reset = e1000_phy_hw_reset_generic; + phy->ops.read_reg = e1000_read_phy_reg_82580; + phy->ops.write_reg = e1000_write_phy_reg_82580; } else { phy->ops.reset = e1000_phy_hw_reset_generic; phy->ops.read_reg = e1000_read_phy_reg_igp; @@ -140,6 +155,13 @@ static s32 e1000_init_phy_params_82575(s phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82575; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; break; + case I82580_I_PHY_ID: + phy->type = e1000_phy_82580; + phy->ops.check_polarity = e1000_check_polarity_82577; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_82577; + phy->ops.get_cable_length = e1000_get_cable_length_82577; + phy->ops.get_info = e1000_get_phy_info_82577; + break; default: ret_val = -E1000_ERR_PHY; goto out; @@ -192,7 +214,7 @@ static s32 e1000_init_nvm_params_82575(s /* EEPROM access above 16k is unsupported */ if (size > 14) size = 14; - nvm->word_size = 1 << size; + nvm->word_size = 1 << size; /* Function Pointers */ nvm->ops.acquire = e1000_acquire_nvm_82575; @@ -230,24 +252,41 @@ static s32 e1000_init_mac_params_82575(s dev_spec->sgmii_active = FALSE; ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 03:24:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA04E1065676; Tue, 8 Dec 2009 03:24:29 +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 A7E388FC15; Tue, 8 Dec 2009 03:24:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB83OTSO074558; Tue, 8 Dec 2009 03:24:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB83OTNc074556; Tue, 8 Dec 2009 03:24:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912080324.nB83OTNc074556@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Dec 2009 03:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200246 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 03:24:29 -0000 Author: yongari Date: Tue Dec 8 03:24:29 2009 New Revision: 200246 URL: http://svn.freebsd.org/changeset/base/200246 Log: Partially revert r200228. For mini RCB case, bge(4) still have to disable mini ring withtout regard to mini ring support. Reported by: marcel Tested by: marcel Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Dec 8 01:56:59 2009 (r200245) +++ head/sys/dev/bge/if_bge.c Tue Dec 8 03:24:29 2009 (r200246) @@ -1618,13 +1618,11 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_RX_JUMBO_RCB_NICADDR, rcb->bge_nicaddr); /* Set up dummy disabled mini 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); - } + 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); } /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 05:18:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 848941065670; Tue, 8 Dec 2009 05:18:59 +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 6F9BB8FC14; Tue, 8 Dec 2009 05:18: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 nB85IxPj076844; Tue, 8 Dec 2009 05:18:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB85IxeJ076837; Tue, 8 Dec 2009 05:18:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912080518.nB85IxeJ076837@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Dec 2009 05:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200247 - stable/8/share/man/man4/man4.powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 05:18:59 -0000 Author: nwhitehorn Date: Tue Dec 8 05:18:59 2009 New Revision: 200247 URL: http://svn.freebsd.org/changeset/base/200247 Log: MFC r200070: Add manpages for ams(4), akbd(4), adb(4), and cuda(4), which describe various drivers for Apple Desktop Bus controllers and peripherals. Added: stable/8/share/man/man4/man4.powerpc/adb.4 - copied unchanged from r200070, head/share/man/man4/man4.powerpc/adb.4 stable/8/share/man/man4/man4.powerpc/akbd.4 - copied unchanged from r200070, head/share/man/man4/man4.powerpc/akbd.4 stable/8/share/man/man4/man4.powerpc/ams.4 - copied unchanged from r200070, head/share/man/man4/man4.powerpc/ams.4 stable/8/share/man/man4/man4.powerpc/cuda.4 - copied unchanged from r200070, head/share/man/man4/man4.powerpc/cuda.4 Modified: stable/8/share/man/man4/man4.powerpc/Makefile stable/8/share/man/man4/man4.powerpc/pmu.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/man4.powerpc/Makefile ============================================================================== --- stable/8/share/man/man4/man4.powerpc/Makefile Tue Dec 8 03:24:29 2009 (r200246) +++ stable/8/share/man/man4/man4.powerpc/Makefile Tue Dec 8 05:18:59 2009 (r200247) @@ -1,6 +1,10 @@ # $FreeBSD$ -MAN= bm.4 \ +MAN= adb.4 \ + akbd.4 \ + ams.4 \ + bm.4 \ + cuda.4 \ pmu.4 \ powermac_nvram.4 \ snd_ai2s.4 \ Copied: stable/8/share/man/man4/man4.powerpc/adb.4 (from r200070, head/share/man/man4/man4.powerpc/adb.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/man4.powerpc/adb.4 Tue Dec 8 05:18:59 2009 (r200247, copy of r200070, head/share/man/man4/man4.powerpc/adb.4) @@ -0,0 +1,70 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt ADB 4 +.Os +.Sh NAME +.Nm adb +.Nd Apple Desktop Bus +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the Apple Desktop Bus, which is a simple +multi-drop bus used in general for input peripherals in older Apple +Macintosh hardware. +.Pp +The Apple Desktop Bus provides attachment for up to 16 devices, +including multiple devices of a single type, but not does support +hot-plugging. +.Sh SEE ALSO +Apple Tech Note HW01: ADB - The Untold Story: Space Aliens Ate My Mouse: +.Pa http://developer.apple.com/legacy/mac/library/technotes/hw/hw_01.html +.Pp +.Xr akbd 4 , +.Xr ams 4 , +.Xr cuda 4 , +.Xr pmu 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Copied: stable/8/share/man/man4/man4.powerpc/akbd.4 (from r200070, head/share/man/man4/man4.powerpc/akbd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/man4.powerpc/akbd.4 Tue Dec 8 05:18:59 2009 (r200247, copy of r200070, head/share/man/man4/man4.powerpc/akbd.4) @@ -0,0 +1,76 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt AKBD 4 +.Os +.Sh NAME +.Nm akbd +.Nd ADB Keyboard Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for all keyboards attached to the Apple Desktop +Bus (ADB). +.Sh HARDWARE +Devices supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple Extended Keyboard +.It +Apple Keyboard II +.It +Apple iBook Keyboard +.It +Apple PowerBook Keyboard +.El +.Sh SEE ALSO +.Xr adb 4 , +.Xr cuda 4 , +.Xr pmu 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Copied: stable/8/share/man/man4/man4.powerpc/ams.4 (from r200070, head/share/man/man4/man4.powerpc/ams.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/man4.powerpc/ams.4 Tue Dec 8 05:18:59 2009 (r200247, copy of r200070, head/share/man/man4/man4.powerpc/ams.4) @@ -0,0 +1,87 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt AMS 4 +.Os +.Sh NAME +.Nm ams +.Nd ADB Mouse Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for mice and trackpads attached to the Apple Desktop +Bus (ADB) implementing both the base and extended ADB mouse protocols. +.Sh HARDWARE +Devices supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple Mouse +.It +ADB Extended Mouse +.It +MacAlly 2-Button Mouse +.It +Apple iBook Trackpad +.It +Apple PowerBook Trackpad +.El +.Sh SYSCTL VARIABLES +.Bl -tag -width indent +.It Va dev.ams.%d.tapping +On ADB trackpads, setting this sysctl to 1 causes taps on the trackpad to +be interpreted as button clicks. +.El +.Sh SEE ALSO +Apple Tech Note HW01: ADB - The Untold Story: Space Aliens Ate My Mouse: +.Pa http://developer.apple.com/legacy/mac/library/technotes/hw/hw_01.html +.Pp +.Xr adb 4 , +.Xr cuda 4 , +.Xr pmu 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Copied: stable/8/share/man/man4/man4.powerpc/cuda.4 (from r200070, head/share/man/man4/man4.powerpc/cuda.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/man4.powerpc/cuda.4 Tue Dec 8 05:18:59 2009 (r200247, copy of r200070, head/share/man/man4/man4.powerpc/cuda.4) @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2009 Nathan Whitehorn +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 3, 2009 +.Dt CUDA 4 +.Os +.Sh NAME +.Nm cuda +.Nd Apple CUDA I/O Controller Driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device adb" +.Cd "device cuda" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the CUDA VIA (Versatile Interface Attachment) +chip found in pre-Core99 Apple hardware, such as the Power Macintosh G3. +.Pp +The Apple CUDA controller is a multi-purpose ASIC that provides power +control and an +.Xr adb 4 +interface. +.Sh HARDWARE +Chips supported by the +.Nm +driver include: +.Pp +.Bl -bullet -compact +.It +Apple CUDA I/O Controller +.El +.Sh SEE ALSO +.Xr adb 4 +.Sh HISTORY +The +.Nm +device driver appeared in +.Nx 4.0 , +and then in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Michael Lorenz +.Aq macallan@NetBSD.org +and ported to FreeBSD by +.An Nathan Whitehorn +.Aq nwhitehorn@FreeBSD.org . Modified: stable/8/share/man/man4/man4.powerpc/pmu.4 ============================================================================== --- stable/8/share/man/man4/man4.powerpc/pmu.4 Tue Dec 8 03:24:29 2009 (r200246) +++ stable/8/share/man/man4/man4.powerpc/pmu.4 Tue Dec 8 05:18:59 2009 (r200247) @@ -95,7 +95,8 @@ Current fraction of the battery's maximu .El .Sh SEE ALSO .Xr acpi 4 , -.Xr adb 4 +.Xr adb 4 , +.Xr led 4 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 05:23:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 548F31065672; Tue, 8 Dec 2009 05:23: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 427028FC0C; Tue, 8 Dec 2009 05:23: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 nB85N8uq077005; Tue, 8 Dec 2009 05:23:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB85N8gV077003; Tue, 8 Dec 2009 05:23:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912080523.nB85N8gV077003@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Dec 2009 05:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200248 - stable/8/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 05:23:08 -0000 Author: nwhitehorn Date: Tue Dec 8 05:23:07 2009 New Revision: 200248 URL: http://svn.freebsd.org/changeset/base/200248 Log: MFC r198444: Allow Heathrow-based machines to boot a kernel containing option SMP without panicing. Modified: stable/8/sys/powerpc/powermac/hrowpic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/powermac/hrowpic.c ============================================================================== --- stable/8/sys/powerpc/powermac/hrowpic.c Tue Dec 8 05:18:59 2009 (r200247) +++ stable/8/sys/powerpc/powermac/hrowpic.c Tue Dec 8 05:23:07 2009 (r200248) @@ -182,7 +182,13 @@ hrowpic_toggle_irq(struct hrowpic_softc u_int roffset; u_int rbit; - KASSERT((irq > 0) && (irq < HROWPIC_IRQMAX), ("en irq out of range")); + KASSERT((irq > 0) && (irq <= HROWPIC_IRQMAX), ("en irq out of range")); + + /* + * Humor the SMP layer if it wants to set up an IPI handler. + */ + if (irq == HROWPIC_IRQMAX) + return; /* * Calculate prim/sec register bank for the IRQ, update soft copy, From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 05:27:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20EA8106566B; Tue, 8 Dec 2009 05:27:07 +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 0D9738FC0A; Tue, 8 Dec 2009 05:27: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 nB85R6TU077180; Tue, 8 Dec 2009 05:27:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB85R6Ht077177; Tue, 8 Dec 2009 05:27:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912080527.nB85R6Ht077177@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Dec 2009 05:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200249 - in stable/8/sys/powerpc: include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 05:27:07 -0000 Author: nwhitehorn Date: Tue Dec 8 05:27:06 2009 New Revision: 200249 URL: http://svn.freebsd.org/changeset/base/200249 Log: MFC r198445: Turn on NAP mode on G5 systems, and refactor the HID0 setup code a little. This makes my G5 Xserve sound slightly less like it is filled with howling banshees. MFC r198968: Unbreak E500 builds. The inline assembly for the 970 CPUs is invalid when compiling for BookE. MFC r199533: Fix cpuid output on E500 core. Modified: stable/8/sys/powerpc/include/hid.h stable/8/sys/powerpc/powerpc/cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/include/hid.h ============================================================================== --- stable/8/sys/powerpc/include/hid.h Tue Dec 8 05:23:07 2009 (r200248) +++ stable/8/sys/powerpc/include/hid.h Tue Dec 8 05:27:06 2009 (r200249) @@ -41,6 +41,7 @@ #define HID0_ECLK 0x02000000 /* CLK_OUT clock type selection */ #define HID0_PAR 0x01000000 /* Disable precharge of ARTRY */ #define HID0_STEN 0x01000000 /* Software table search enable (7450) */ +#define HID0_DEEPNAP 0x01000000 /* Enable deep nap mode (970) */ #define HID0_HBATEN 0x00800000 /* High BAT enable (74[45][578]) */ #define HID0_DOZE 0x00800000 /* Enable doze mode */ #define HID0_NAP 0x00400000 /* Enable nap mode */ @@ -98,6 +99,12 @@ "\020b16\017TBEN\016SEL_TBCLK\015b19\014b20\013b21\012b22\011b23" \ "\010EN_MAS7_UPDATE\007DCFA\006b26\005b27\004b28\003b29\002b30\001NOPTI" +#define HID0_970_BITMASK \ + "\20" \ + "\040ONEPPC\037SINGLE\036ISYNCSC\035SERGP\031DEEPNAP\030DOZE" \ + "\027NAP\025DPM\023TG\022HANGDETECT\021NHR\020INORDER" \ + "\016TBCTRL\015TBEN\012CIABREN\011HDICEEN\001ENATTN" + /* * HID0 bit definitions per cpu model * Modified: stable/8/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/8/sys/powerpc/powerpc/cpu.c Tue Dec 8 05:23:07 2009 (r200248) +++ stable/8/sys/powerpc/powerpc/cpu.c Tue Dec 8 05:27:06 2009 (r200249) @@ -114,16 +114,21 @@ static char model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); static void cpu_print_speed(void); -static void cpu_print_cacheinfo(u_int, uint16_t); + +static void cpu_6xx_setup(int cpuid, uint16_t vers); +static void cpu_6xx_print_cacheinfo(u_int, uint16_t); +static void cpu_e500_setup(int cpuid, uint16_t vers); +#ifndef E500 +static void cpu_970_setup(int cpuid, uint16_t vers); +#endif void cpu_setup(u_int cpuid) { - u_int pvr, maj, min, hid0; + u_int pvr, maj, min; uint16_t vers, rev, revfmt; const struct cputab *cp; const char *name; - char *bitmask; pvr = mfpvr(); vers = pvr >> 16; @@ -170,10 +175,8 @@ cpu_setup(u_int cpuid) break; } - hid0 = mfspr(SPR_HID0); - /* - * Configure power-saving mode. + * Configure CPU */ switch (vers) { case MPC603: @@ -184,102 +187,36 @@ cpu_setup(u_int cpuid) case IBM750FX: case MPC7400: case MPC7410: - case MPC8240: - case MPC8245: - /* Select DOZE mode. */ - hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); - hid0 |= HID0_DOZE | HID0_DPM; - powerpc_pow_enabled = 1; - break; - - case MPC7448: - case MPC7447A: - case MPC7457: - case MPC7455: - case MPC7450: - /* Enable the 7450 branch caches */ - hid0 |= HID0_SGE | HID0_BTIC; - hid0 |= HID0_LRSTK | HID0_FOLD | HID0_BHT; - /* Disable BTIC on 7450 Rev 2.0 or earlier and on 7457 */ - if (((pvr >> 16) == MPC7450 && (pvr & 0xFFFF) <= 0x0200) - || (pvr >> 16) == MPC7457) - hid0 &= ~HID0_BTIC; - /* Select NAP mode. */ - hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); - hid0 |= HID0_NAP | HID0_DPM; - powerpc_pow_enabled = 1; - break; - - default: - /* No power-saving mode is available. */ ; - } - - switch (vers) { - case IBM750FX: - case MPC750: - hid0 &= ~HID0_DBP; /* XXX correct? */ - hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT; - break; - - case MPC7400: - case MPC7410: - hid0 &= ~HID0_SPD; - hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT; - hid0 |= HID0_EIEC; - break; - - case FSL_E500v1: - case FSL_E500v2: - break; - } - - mtspr(SPR_HID0, hid0); - - switch (vers) { case MPC7447A: case MPC7448: case MPC7450: case MPC7455: case MPC7457: - bitmask = HID0_7450_BITMASK; - break; - case FSL_E500v1: - case FSL_E500v2: - bitmask = HID0_E500_BITMASK; - break; - default: - bitmask = HID0_BITMASK; + case MPC8240: + case MPC8245: + cpu_6xx_setup(cpuid, vers); break; - } - switch (vers) { - case MPC7450: - case MPC7455: - case MPC7457: - case MPC750: - case IBM750FX: - case MPC7400: - case MPC7410: - case MPC7447A: - case MPC7448: - cpu_print_speed(); - printf("\n"); - - if (bootverbose) - cpu_print_cacheinfo(cpuid, vers); - break; +#ifndef E500 case IBM970: case IBM970FX: + case IBM970GX: case IBM970MP: - cpu_print_speed(); - printf("\n"); + cpu_970_setup(cpuid, vers); + break; +#endif + + case FSL_E500v1: + case FSL_E500v2: + cpu_e500_setup(cpuid, vers); break; + default: - printf("\n"); + /* HID setup is unknown */ break; } - printf("cpu%d: HID0 %b\n", cpuid, hid0, bitmask); + printf("\n"); } void @@ -346,10 +283,101 @@ cpu_est_clockrate(int cpu_id, uint64_t * } void -cpu_print_cacheinfo(u_int cpuid, uint16_t vers) +cpu_6xx_setup(int cpuid, uint16_t vers) { - uint32_t hid; + register_t hid0, pvr; + const char *bitmask; + hid0 = mfspr(SPR_HID0); + pvr = mfpvr(); + + /* + * Configure power-saving mode. + */ + switch (vers) { + case MPC603: + case MPC603e: + case MPC603ev: + case MPC604ev: + case MPC750: + case IBM750FX: + case MPC7400: + case MPC7410: + case MPC8240: + case MPC8245: + /* Select DOZE mode. */ + hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); + hid0 |= HID0_DOZE | HID0_DPM; + powerpc_pow_enabled = 1; + break; + + case MPC7448: + case MPC7447A: + case MPC7457: + case MPC7455: + case MPC7450: + /* Enable the 7450 branch caches */ + hid0 |= HID0_SGE | HID0_BTIC; + hid0 |= HID0_LRSTK | HID0_FOLD | HID0_BHT; + /* Disable BTIC on 7450 Rev 2.0 or earlier and on 7457 */ + if (((pvr >> 16) == MPC7450 && (pvr & 0xFFFF) <= 0x0200) + || (pvr >> 16) == MPC7457) + hid0 &= ~HID0_BTIC; + /* Select NAP mode. */ + hid0 &= ~(HID0_DOZE | HID0_NAP | HID0_SLEEP); + hid0 |= HID0_NAP | HID0_DPM; + powerpc_pow_enabled = 1; + break; + + default: + /* No power-saving mode is available. */ ; + } + + switch (vers) { + case IBM750FX: + case MPC750: + hid0 &= ~HID0_DBP; /* XXX correct? */ + hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT; + break; + + case MPC7400: + case MPC7410: + hid0 &= ~HID0_SPD; + hid0 |= HID0_EMCP | HID0_BTIC | HID0_SGE | HID0_BHT; + hid0 |= HID0_EIEC; + break; + + } + + mtspr(SPR_HID0, hid0); + + cpu_print_speed(); + printf("\n"); + + if (bootverbose) + cpu_6xx_print_cacheinfo(cpuid, vers); + + switch (vers) { + case MPC7447A: + case MPC7448: + case MPC7450: + case MPC7455: + case MPC7457: + bitmask = HID0_7450_BITMASK; + break; + default: + bitmask = HID0_BITMASK; + break; + } + + printf("cpu%d: HID0 %b", cpuid, (int)hid0, bitmask); +} + + +static void +cpu_6xx_print_cacheinfo(u_int cpuid, uint16_t vers) +{ + register_t hid; hid = mfspr(SPR_HID0); printf("cpu%u: ", cpuid); @@ -395,3 +423,46 @@ cpu_print_cacheinfo(u_int cpuid, uint16_ } else printf("L2 cache disabled\n"); } + +static void +cpu_e500_setup(int cpuid, uint16_t vers) +{ + register_t hid0; + + printf("\n"); + + hid0 = mfspr(SPR_HID0); + printf("cpu%d: HID0 %b", cpuid, (int)hid0, HID0_E500_BITMASK); +} + +#ifndef E500 +static void +cpu_970_setup(int cpuid, uint16_t vers) +{ + uint32_t hid0_hi, hid0_lo; + + __asm __volatile ("mfspr %0,%2; clrldi %1,%0,32; srdi %0,%0,32;" + : "=r" (hid0_hi), "=r" (hid0_lo) : "K" (SPR_HID0)); + + /* Configure power-saving mode */ + hid0_hi |= (HID0_NAP | HID0_DPM); + hid0_hi &= ~(HID0_DOZE | HID0_DEEPNAP); + powerpc_pow_enabled = 1; + + __asm __volatile (" \ + sync; isync; \ + sldi %0,%0,32; or %0,%0,%1; \ + mtspr %2, %0; \ + mfspr %0, %2; mfspr %0, %2; mfspr %0, %2; \ + mfspr %0, %2; mfspr %0, %2; mfspr %0, %2; \ + sync; isync" + :: "r" (hid0_hi), "r"(hid0_lo), "K" (SPR_HID0)); + + cpu_print_speed(); + printf("\n"); + + __asm __volatile ("mfspr %0,%1; srdi %0,%0,32;" + : "=r" (hid0_hi) : "K" (SPR_HID0)); + printf("cpu%d: HID0 %b", cpuid, (int)(hid0_hi), HID0_970_BITMASK); +} +#endif From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 05:32:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F07BC1065670; Tue, 8 Dec 2009 05:32: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 DE7798FC0A; Tue, 8 Dec 2009 05:32: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 nB85Wit9077515; Tue, 8 Dec 2009 05:32:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB85Wi2p077513; Tue, 8 Dec 2009 05:32:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912080532.nB85Wi2p077513@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Dec 2009 05:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200250 - stable/8/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 05:32:45 -0000 Author: nwhitehorn Date: Tue Dec 8 05:32:44 2009 New Revision: 200250 URL: http://svn.freebsd.org/changeset/base/200250 Log: MFC r198678: ake procstat -k work on PowerPC by avoiding mistakenly using signed compares with a low address (0x1000) and a high address (the KVA kernel stack). Modified: stable/8/sys/powerpc/powerpc/stack_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/powerpc/stack_machdep.c ============================================================================== --- stable/8/sys/powerpc/powerpc/stack_machdep.c Tue Dec 8 05:27:06 2009 (r200249) +++ stable/8/sys/powerpc/powerpc/stack_machdep.c Tue Dec 8 05:32:44 2009 (r200250) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include static void -stack_capture(struct stack *st, register_t frame) +stack_capture(struct stack *st, vm_offset_t frame) { vm_offset_t callpc; @@ -76,7 +76,7 @@ stack_capture(struct stack *st, register void stack_save_td(struct stack *st, struct thread *td) { - register_t frame; + vm_offset_t frame; if (TD_IS_SWAPPED(td)) panic("stack_save_td: swapped"); From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 05:35:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 628C5106566C; Tue, 8 Dec 2009 05:35: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 381248FC28; Tue, 8 Dec 2009 05:35: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 nB85Zq3Z077636; Tue, 8 Dec 2009 05:35:52 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB85ZqUt077632; Tue, 8 Dec 2009 05:35:52 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912080535.nB85ZqUt077632@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 8 Dec 2009 05:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200251 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 05:35:52 -0000 Author: jkim Date: Tue Dec 8 05:35:51 2009 New Revision: 200251 URL: http://svn.freebsd.org/changeset/base/200251 Log: - Try pre-allocating all FIBs upfront. Previously we tried pre-allocating 128 FIBs first and allocated more later if necessary. Remove now unused definitions from the header file[1]. - Force sequential bus scanning. It seems parallel scanning is in fact slower and causes more harm than good[1]. Adjust a comment to reflect that. PR: kern/141269 Submitted by: Alexander Sack (asack at niksun dot com)[1] Reviewed by: scottl Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Tue Dec 8 05:32:44 2009 (r200250) +++ head/sys/dev/aac/aac.c Tue Dec 8 05:35:51 2009 (r200251) @@ -604,7 +604,7 @@ aac_alloc(struct aac_softc *sc) TAILQ_INIT(&sc->aac_fibmap_tqh); sc->aac_commands = malloc(sc->aac_max_fibs * sizeof(struct aac_command), M_AACBUF, M_WAITOK|M_ZERO); - while (sc->total_fibs < AAC_PREALLOCATE_FIBS) { + while (sc->total_fibs < sc->aac_max_fibs) { if (aac_alloc_commands(sc) != 0) break; } Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Tue Dec 8 05:32:44 2009 (r200250) +++ head/sys/dev/aac/aac_cam.c Tue Dec 8 05:35:51 2009 (r200251) @@ -260,8 +260,11 @@ aac_cam_action(struct cam_sim *sim, unio cpi->hba_inquiry = PI_WIDE_16; cpi->target_sprt = 0; - /* Resetting via the passthrough causes problems. */ - cpi->hba_misc = PIM_NOBUSRESET; + /* + * Resetting via the passthrough or parallel bus scan + * causes problems. + */ + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; cpi->hba_eng_cnt = 0; cpi->max_target = camsc->inf->TargetsPerBus; cpi->max_lun = 8; /* Per the controller spec */ Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Tue Dec 8 05:32:44 2009 (r200250) +++ head/sys/dev/aac/aacvar.h Tue Dec 8 05:35:51 2009 (r200251) @@ -57,13 +57,6 @@ #define AAC_ADAPTER_FIBS 8 /* - * FIBs are allocated in page-size chunks and can grow up to the 512 - * limit imposed by the hardware. - */ -#define AAC_PREALLOCATE_FIBS 128 -#define AAC_NUM_MGT_FIB 8 - -/* * The controller reports status events in AIFs. We hang on to a number of * these in order to pass them out to user-space management tools. */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 05:37:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0029D1065670; Tue, 8 Dec 2009 05:37: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 E0C1B8FC13; Tue, 8 Dec 2009 05:37: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 nB85b8eL077710; Tue, 8 Dec 2009 05:37:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB85b8B7077703; Tue, 8 Dec 2009 05:37:08 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912080537.nB85b8B7077703@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 8 Dec 2009 05:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200252 - in stable/8/sys/powerpc: aim booke include powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 05:37:09 -0000 Author: nwhitehorn Date: Tue Dec 8 05:37:08 2009 New Revision: 200252 URL: http://svn.freebsd.org/changeset/base/200252 Log: MFC r199886: Add a CPU features framework on PowerPC and simplify CPU setup a little more. This provides three new sysctls to user space: hw.cpu_features - A bitmask of available CPU features hw.floatingpoint - Whether or not there is hardware FP support hw.altivec - Whether or not Altivec is available PR: powerpc/139154 Modified: stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/aim/ofw_machdep.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/powerpc/include/cpu.h stable/8/sys/powerpc/include/md_var.h stable/8/sys/powerpc/powerpc/cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Tue Dec 8 05:35:51 2009 (r200251) +++ stable/8/sys/powerpc/aim/machdep.c Tue Dec 8 05:37:08 2009 (r200252) @@ -130,7 +130,6 @@ extern vm_offset_t ksym_start, ksym_end; int cold = 1; int cacheline_size = 32; -int ppc64 = 0; int hw_direct_map = 1; struct pcpu __pcpu[MAXCPU]; @@ -256,6 +255,7 @@ powerpc_init(u_int startkernel, u_int en char *env; uint32_t msr, scratch; uint8_t *cache_check; + int ppc64; end = 0; kmdp = NULL; @@ -405,12 +405,15 @@ powerpc_init(u_int startkernel, u_int en mfsprg2 %1;" : "=r"(scratch), "=r"(ppc64)); + if (ppc64) + cpu_features |= PPC_FEATURE_64; + /* * Now copy restorebridge into all the handlers, if necessary, * and set up the trap tables. */ - if (ppc64) { + if (cpu_features & PPC_FEATURE_64) { /* Patch the two instances of rfi -> rfid */ bcopy(&rfid_patch,&rfi_patch1,4); #ifdef KDB @@ -489,7 +492,7 @@ powerpc_init(u_int startkernel, u_int en * in case the platform module had a better idea of what we * should do. */ - if (ppc64) + if (cpu_features & PPC_FEATURE_64) pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); else pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); Modified: stable/8/sys/powerpc/aim/ofw_machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/ofw_machdep.c Tue Dec 8 05:35:51 2009 (r200251) +++ stable/8/sys/powerpc/aim/ofw_machdep.c Tue Dec 8 05:37:08 2009 (r200252) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -336,7 +337,7 @@ openfirmware(void *args) /* * Clear battable[] translations */ - if (!ppc64) { + if (!(cpu_features & PPC_FEATURE_64)) { __asm __volatile("mtdbatu 2, %0\n" "mtdbatu 3, %0" : : "r" (0)); } Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Tue Dec 8 05:35:51 2009 (r200251) +++ stable/8/sys/powerpc/booke/machdep.c Tue Dec 8 05:37:08 2009 (r200252) @@ -179,7 +179,6 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cach CTLFLAG_RD, &cacheline_size, 0, ""); int hw_direct_map = 0; -int ppc64 = 0; static void cpu_e500_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_e500_startup, NULL); Modified: stable/8/sys/powerpc/include/cpu.h ============================================================================== --- stable/8/sys/powerpc/include/cpu.h Tue Dec 8 05:35:51 2009 (r200251) +++ stable/8/sys/powerpc/include/cpu.h Tue Dec 8 05:37:08 2009 (r200252) @@ -39,6 +39,27 @@ #include #include +/* + * CPU Feature Attributes + * + * These are defined in the PowerPC ELF ABI for the AT_HWCAP vector, + * and are exported to userland via the machdep.cpu_features + * sysctl. + */ + +extern int cpu_features; + +#define PPC_FEATURE_32 0x80000000 /* Always true */ +#define PPC_FEATURE_64 0x40000000 /* Defined on a 64-bit CPU */ +#define PPC_FEATURE_HAS_ALTIVEC 0x10000000 +#define PPC_FEATURE_HAS_FPU 0x08000000 +#define PPC_FEATURE_HAS_MMU 0x04000000 +#define PPC_FEATURE_UNIFIED_CACHE 0x01000000 + +#define PPC_FEATURE_BITMASK \ + "\20" \ + "\040PPC32\037PPC64\035ALTIVEC\034FPU\033MMU\031UNIFIEDCACHE" + #define TRAPF_USERMODE(frame) (((frame)->srr1 & PSL_PR) != 0) #define TRAPF_PC(frame) ((frame)->srr0) Modified: stable/8/sys/powerpc/include/md_var.h ============================================================================== --- stable/8/sys/powerpc/include/md_var.h Tue Dec 8 05:35:51 2009 (r200251) +++ stable/8/sys/powerpc/include/md_var.h Tue Dec 8 05:37:08 2009 (r200252) @@ -46,7 +46,6 @@ extern u_long ns_per_tick; extern int powerpc_pow_enabled; extern int cacheline_size; -extern int ppc64; extern int hw_direct_map; void __syncicache(void *, int); Modified: stable/8/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/8/sys/powerpc/powerpc/cpu.c Tue Dec 8 05:35:51 2009 (r200251) +++ stable/8/sys/powerpc/powerpc/cpu.c Tue Dec 8 05:37:08 2009 (r200252) @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -74,59 +75,102 @@ int powerpc_pow_enabled; +static void cpu_6xx_setup(int cpuid, uint16_t vers); +static void cpu_e500_setup(int cpuid, uint16_t vers); +static void cpu_970_setup(int cpuid, uint16_t vers); + struct cputab { const char *name; uint16_t version; uint16_t revfmt; + int features; /* Do not include PPC_FEATURE_32 or + * PPC_FEATURE_HAS_MMU */ + void (*cpu_setup)(int cpuid, uint16_t vers); }; #define REVFMT_MAJMIN 1 /* %u.%u */ #define REVFMT_HEX 2 /* 0x%04x */ #define REVFMT_DEC 3 /* %u */ static const struct cputab models[] = { - { "Motorola PowerPC 601", MPC601, REVFMT_DEC }, - { "Motorola PowerPC 602", MPC602, REVFMT_DEC }, - { "Motorola PowerPC 603", MPC603, REVFMT_MAJMIN }, - { "Motorola PowerPC 603e", MPC603e, REVFMT_MAJMIN }, - { "Motorola PowerPC 603ev", MPC603ev, REVFMT_MAJMIN }, - { "Motorola PowerPC 604", MPC604, REVFMT_MAJMIN }, - { "Motorola PowerPC 604ev", MPC604ev, REVFMT_MAJMIN }, - { "Motorola PowerPC 620", MPC620, REVFMT_HEX }, - { "Motorola PowerPC 750", MPC750, REVFMT_MAJMIN }, - { "IBM PowerPC 750FX", IBM750FX, REVFMT_MAJMIN }, - { "IBM PowerPC 970", IBM970, REVFMT_MAJMIN }, - { "IBM PowerPC 970FX", IBM970FX, REVFMT_MAJMIN }, - { "IBM PowerPC 970GX", IBM970GX, REVFMT_MAJMIN }, - { "IBM PowerPC 970MP", IBM970MP, REVFMT_MAJMIN }, - { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN }, - { "Motorola PowerPC 7410", MPC7410, REVFMT_MAJMIN }, - { "Motorola PowerPC 7450", MPC7450, REVFMT_MAJMIN }, - { "Motorola PowerPC 7455", MPC7455, REVFMT_MAJMIN }, - { "Motorola PowerPC 7457", MPC7457, REVFMT_MAJMIN }, - { "Motorola PowerPC 7447A", MPC7447A, REVFMT_MAJMIN }, - { "Motorola PowerPC 7448", MPC7448, REVFMT_MAJMIN }, - { "Motorola PowerPC 8240", MPC8240, REVFMT_MAJMIN }, - { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN }, - { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN }, - { "Unknown PowerPC CPU", 0, REVFMT_HEX } + { "Motorola PowerPC 601", MPC601, REVFMT_DEC, + PPC_FEATURE_HAS_FPU | PPC_FEATURE_UNIFIED_CACHE, cpu_6xx_setup }, + { "Motorola PowerPC 602", MPC602, REVFMT_DEC, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 603", MPC603, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 603e", MPC603e, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 603ev", MPC603ev, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 604", MPC604, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 604ev", MPC604ev, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 620", MPC620, REVFMT_HEX, + PPC_FEATURE_64 | PPC_FEATURE_HAS_FPU, NULL }, + { "Motorola PowerPC 750", MPC750, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "IBM PowerPC 750FX", IBM750FX, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "IBM PowerPC 970", IBM970, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "IBM PowerPC 970FX", IBM970FX, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "IBM PowerPC 970GX", IBM970GX, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "IBM PowerPC 970MP", IBM970MP, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, + cpu_970_setup }, + { "Motorola PowerPC 7400", MPC7400, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7410", MPC7410, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7450", MPC7450, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7455", MPC7455, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7457", MPC7457, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7447A", MPC7447A, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 7448", MPC7448, REVFMT_MAJMIN, + PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 8240", MPC8240, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Motorola PowerPC 8245", MPC8245, REVFMT_MAJMIN, + PPC_FEATURE_HAS_FPU, cpu_6xx_setup }, + { "Freescale e500v1 core", FSL_E500v1, REVFMT_MAJMIN, + 0, cpu_e500_setup }, + { "Freescale e500v2 core", FSL_E500v2, REVFMT_MAJMIN, + 0, cpu_e500_setup }, + { "Unknown PowerPC CPU", 0, REVFMT_HEX, 0, NULL }, }; +static void cpu_6xx_print_cacheinfo(u_int, uint16_t); +static int cpu_feature_bit(SYSCTL_HANDLER_ARGS); + static char model[64]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, model, 0, ""); -static void cpu_print_speed(void); - -static void cpu_6xx_setup(int cpuid, uint16_t vers); -static void cpu_6xx_print_cacheinfo(u_int, uint16_t); -static void cpu_e500_setup(int cpuid, uint16_t vers); -#ifndef E500 -static void cpu_970_setup(int cpuid, uint16_t vers); -#endif +int cpu_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU; +SYSCTL_OPAQUE(_hw, OID_AUTO, cpu_features, CTLTYPE_INT | CTLFLAG_RD, + &cpu_features, sizeof(cpu_features), "IX", "PowerPC CPU features"); + +/* Provide some user-friendly aliases for bits in cpu_features */ +SYSCTL_PROC(_hw, OID_AUTO, floatingpoint, CTLTYPE_INT | CTLFLAG_RD, + 0, PPC_FEATURE_HAS_FPU, cpu_feature_bit, "I", + "Floating point instructions executed in hardware"); +SYSCTL_PROC(_hw, OID_AUTO, altivec, CTLTYPE_INT | CTLFLAG_RD, + 0, PPC_FEATURE_HAS_ALTIVEC, cpu_feature_bit, "I", "CPU supports Altivec"); void cpu_setup(u_int cpuid) { u_int pvr, maj, min; uint16_t vers, rev, revfmt; + uint64_t cps; const struct cputab *cp; const char *name; @@ -175,57 +219,19 @@ cpu_setup(u_int cpuid) break; } + if (cpu_est_clockrate(0, &cps) == 0) + printf(", %lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100); + printf("\n"); + + cpu_features |= cp->features; + printf("cpu%d: Features %b\n", cpuid, cpu_features, + PPC_FEATURE_BITMASK); + /* * Configure CPU */ - switch (vers) { - case MPC603: - case MPC603e: - case MPC603ev: - case MPC604ev: - case MPC750: - case IBM750FX: - case MPC7400: - case MPC7410: - case MPC7447A: - case MPC7448: - case MPC7450: - case MPC7455: - case MPC7457: - case MPC8240: - case MPC8245: - cpu_6xx_setup(cpuid, vers); - break; - -#ifndef E500 - case IBM970: - case IBM970FX: - case IBM970GX: - case IBM970MP: - cpu_970_setup(cpuid, vers); - break; -#endif - - case FSL_E500v1: - case FSL_E500v2: - cpu_e500_setup(cpuid, vers); - break; - - default: - /* HID setup is unknown */ - break; - } - - printf("\n"); -} - -void -cpu_print_speed(void) -{ - uint64_t cps; - - if (cpu_est_clockrate(0, &cps) == 0) - printf(", %lld.%02lld MHz", cps / 1000000, (cps / 10000) % 100); + if (cp->cpu_setup != NULL) + cp->cpu_setup(cpuid, vers); } /* Get current clock frequency for the given cpu id. */ @@ -351,9 +357,6 @@ cpu_6xx_setup(int cpuid, uint16_t vers) mtspr(SPR_HID0, hid0); - cpu_print_speed(); - printf("\n"); - if (bootverbose) cpu_6xx_print_cacheinfo(cpuid, vers); @@ -370,7 +373,7 @@ cpu_6xx_setup(int cpuid, uint16_t vers) break; } - printf("cpu%d: HID0 %b", cpuid, (int)hid0, bitmask); + printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, bitmask); } @@ -429,16 +432,14 @@ cpu_e500_setup(int cpuid, uint16_t vers) { register_t hid0; - printf("\n"); - hid0 = mfspr(SPR_HID0); - printf("cpu%d: HID0 %b", cpuid, (int)hid0, HID0_E500_BITMASK); + printf("cpu%d: HID0 %b\n", cpuid, (int)hid0, HID0_E500_BITMASK); } -#ifndef E500 static void cpu_970_setup(int cpuid, uint16_t vers) { +#ifdef AIM uint32_t hid0_hi, hid0_lo; __asm __volatile ("mfspr %0,%2; clrldi %1,%0,32; srdi %0,%0,32;" @@ -458,11 +459,19 @@ cpu_970_setup(int cpuid, uint16_t vers) sync; isync" :: "r" (hid0_hi), "r"(hid0_lo), "K" (SPR_HID0)); - cpu_print_speed(); - printf("\n"); - __asm __volatile ("mfspr %0,%1; srdi %0,%0,32;" : "=r" (hid0_hi) : "K" (SPR_HID0)); - printf("cpu%d: HID0 %b", cpuid, (int)(hid0_hi), HID0_970_BITMASK); -} + printf("cpu%d: HID0 %b\n", cpuid, (int)(hid0_hi), HID0_970_BITMASK); #endif +} + +static int +cpu_feature_bit(SYSCTL_HANDLER_ARGS) +{ + int result; + + result = (cpu_features & arg2) ? 1 : 0; + + return (sysctl_handle_int(oidp, &result, 0, req)); +} + From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 12:10:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC31F106568B; Tue, 8 Dec 2009 12:10:06 +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 BAECC8FC21; Tue, 8 Dec 2009 12:10: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 nB8CA665087361; Tue, 8 Dec 2009 12:10:06 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8CA6ZS087359; Tue, 8 Dec 2009 12:10:06 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912081210.nB8CA6ZS087359@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 8 Dec 2009 12:10: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: r200253 - in head/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 12:10:06 -0000 Author: nyan Date: Tue Dec 8 12:10:06 2009 New Revision: 200253 URL: http://svn.freebsd.org/changeset/base/200253 Log: MFi386: revision 200216 Various small whitespace and style fixes. Modified: head/sys/boot/pc98/libpc98/biosmem.c head/sys/boot/pc98/loader/main.c Modified: head/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosmem.c Tue Dec 8 05:37:08 2009 (r200252) +++ head/sys/boot/pc98/libpc98/biosmem.c Tue Dec 8 12:10:06 2009 (r200253) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); #include "btxv86.h" vm_offset_t memtop, memtop_copyin; -u_int32_t bios_basemem, bios_extmem; +uint32_t bios_basemem, bios_extmem; void bios_getmem(void) @@ -49,4 +49,3 @@ bios_getmem(void) memtop = memtop_copyin = 0x100000 + bios_extmem; } - Modified: head/sys/boot/pc98/loader/main.c ============================================================================== --- head/sys/boot/pc98/loader/main.c Tue Dec 8 05:37:08 2009 (r200252) +++ head/sys/boot/pc98/loader/main.c Tue Dec 8 12:10:06 2009 (r200253) @@ -96,7 +96,7 @@ main(void) */ bios_getmem(); -#ifdef LOADER_BZIP2_SUPPORT +#if defined(LOADER_BZIP2_SUPPORT) heap_top = PTOV(memtop_copyin); memtop_copyin -= 0x300000; heap_bottom = PTOV(memtop_copyin); From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 13:04:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D82106566C; Tue, 8 Dec 2009 13:04:27 +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 2D27F8FC0C; Tue, 8 Dec 2009 13:04: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 nB8D4Rve088600; Tue, 8 Dec 2009 13:04:27 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8D4RbR088598; Tue, 8 Dec 2009 13:04:27 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912081304.nB8D4RbR088598@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 8 Dec 2009 13:04: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: r200254 - head/sys/boot/pc98/btx/btx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 13:04:27 -0000 Author: nyan Date: Tue Dec 8 13:04:26 2009 New Revision: 200254 URL: http://svn.freebsd.org/changeset/base/200254 Log: MFi386: Use real mode instead of v86 mode. MFC after: 1 week Modified: head/sys/boot/pc98/btx/btx/btx.S Modified: head/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- head/sys/boot/pc98/btx/btx/btx.S Tue Dec 8 12:10:06 2009 (r200253) +++ head/sys/boot/pc98/btx/btx/btx.S Tue Dec 8 13:04:26 2009 (r200254) @@ -21,11 +21,11 @@ .set MEM_BTX,0x1000 # Start of BTX memory .set MEM_ESP0,0x1800 # Supervisor stack .set MEM_BUF,0x1800 # Scratch buffer - .set MEM_ESP1,0x1e00 # Link stack - .set MEM_IDT,0x1e00 # IDT - .set MEM_TSS,0x1f98 # TSS - .set MEM_MAP,0x2000 # I/O bit map - .set MEM_TSS_END,0x3fff # Page directory + .set MEM_ESPR,0x5e00 # Real mode stack + .set MEM_IDT,0x5e00 # IDT + .set MEM_TSS,0x5f98 # TSS + .set MEM_MAP,0x6000 # I/O bit map + .set MEM_TSS_END,0x7fff # End of TSS .set MEM_ORG,0x9000 # BTX code .set MEM_USR,0xa000 # Start of user memory /* @@ -34,6 +34,14 @@ .set PAG_SIZ,0x1000 # Page size .set PAG_CNT,0x1000 # Pages to map /* + * Fields in %eflags. + */ + .set PSL_RESERVED_DEFAULT,0x00000002 + .set PSL_T,0x00000100 # Trap flag + .set PSL_I,0x00000200 # Interrupt enable flag + .set PSL_VM,0x00020000 # Virtual 8086 mode flag + .set PSL_AC,0x00040000 # Alignment check flag +/* * Segment selectors. */ .set SEL_SCODE,0x8 # Supervisor code @@ -48,7 +56,6 @@ */ .set TSS_ESP0,0x4 # PL 0 ESP .set TSS_SS0,0x8 # PL 0 SS - .set TSS_ESP1,0xc # PL 1 ESP .set TSS_MAP,0x66 # I/O bit map base /* * System calls. @@ -56,10 +63,20 @@ .set SYS_EXIT,0x0 # Exit .set SYS_EXEC,0x1 # Exec /* - * V86 constants. + * Fields in V86 interface structure. */ - .set V86_FLG,0x208eff # V86 flag mask - .set V86_STK,0x400 # V86 stack allowance + .set V86_CTL,0x0 # Control flags + .set V86_ADDR,0x4 # Int number/address + .set V86_ES,0x8 # V86 ES + .set V86_DS,0xc # V86 DS + .set V86_FS,0x10 # V86 FS + .set V86_GS,0x14 # V86 GS +/* + * V86 control flags. + */ + .set V86F_ADDR,0x10000 # Segment:offset address + .set V86F_CALLF,0x20000 # Emulate far call + .set V86F_FLAGS,0x40000 # Return flags /* * Dump format control bytes. */ @@ -77,13 +94,11 @@ * BIOS Data Area locations. */ .set BDA_MEM,0x501 # Free memory - .set BDA_KEYFLAGS,0x53a # Keyboard shift-state flags .set BDA_POS,0x53e # Cursor position /* * Derivations, for brevity. */ .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0 - .set _ESP1H,MEM_ESP1>>0x8 # Byte 1 of ESP1 .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base .set _TSSLM,MEM_TSS_END-MEM_TSS # TSS limit .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit @@ -100,7 +115,7 @@ btx_hdr: .byte 0xeb # Machine ID .byte 0xe # Header size .ascii "BTX" # Magic .byte 0x1 # Major version - .byte 0x1 # Minor version + .byte 0x2 # Minor version .byte BTX_FLAGS # Flags .word PAG_CNT-MEM_ORG>>0xc # Paging control .word break-start # Text size @@ -121,13 +136,24 @@ init: cli # Disable interrupts */ mov $MEM_IDT,%di # Memory to initialize mov $(MEM_ORG-MEM_IDT)/2,%cx # Words to zero - push %di # Save rep # Zero-fill stosw # memory - pop %di # Restore +/* + * Update real mode IDT for reflecting hardware interrupts. + */ + mov $intr20,%bx # Address first handler + mov $0x10,%cx # Number of handlers + mov $0x20*4,%di # First real mode IDT entry +init.0: mov %bx,(%di) # Store IP + inc %di # Address next + inc %di # entry + stosw # Store CS + add $4,%bx # Next handler + loop init.0 # Next IRQ /* * Create IDT. */ + mov $MEM_IDT,%di mov $idtctl,%si # Control string init.1: lodsb # Get entry cbw # count @@ -153,7 +179,6 @@ init.3: lea 0x8(%di),%di # Next entry */ init.4: movb $_ESP0H,TSS_ESP0+1(%di) # Set ESP0 movb $SEL_SDATA,TSS_SS0(%di) # Set SS0 - movb $_ESP1H,TSS_ESP1+1(%di) # Set ESP1 movb $_TSSIO,TSS_MAP(%di) # Set I/O bit map base /* * Bring up the system. @@ -253,8 +278,8 @@ exit.2: xor %ax,%ax # Real mode segme exit.3: jz exit.3 # No movb $0xa0,%al outb %al,$0x35 - movb 0,%al - outb %al,$0xf0 + movb $0x00,%al + outb %al,$0xf0 # reboot the machine exit.4: jmp exit.4 /* * Set IRQ offsets by reprogramming 8259A PICs. @@ -285,10 +310,6 @@ setpic: in $0x02,%al # Save master retw # To caller .code32 /* - * Initiate return from V86 mode to user mode. - */ -inthlt: hlt # To supervisor mode -/* * Exception jump table. */ intx00: push $0x0 # Int 0x0: #DE @@ -314,18 +335,12 @@ intx00: push $0x0 # Int 0x0: #DE push $0xc # Int 0xc: #SS jmp except # Stack segment fault push $0xd # Int 0xd: #GP - jmp ex_v86 # General protection + jmp except # General protection push $0xe # Int 0xe: #PF jmp except # Page fault intx10: push $0x10 # Int 0x10: #MF jmp ex_noc # Floating-point error /* - * Handle #GP exception. - */ -ex_v86: testb $0x2,0x12(%esp,1) # V86 mode? - jz except # No - jmp v86mon # To monitor -/* * Save a zero error code. */ ex_noc: pushl (%esp,1) # Duplicate int no @@ -337,24 +352,17 @@ except: cld # String ops inc pushl %ds # Save pushl %es # most pusha # registers - movb $0x6,%al # Push loop count - testb $0x2,0x3a(%esp,1) # V86 mode? - jnz except.1 # Yes pushl %gs # Set GS pushl %fs # Set FS pushl %ds # Set DS pushl %es # Set ES - movb $0x2,%al # Push loop count cmpw $SEL_SCODE,0x44(%esp,1) # Supervisor mode? jne except.1 # No pushl %ss # Set SS - leal 0x50(%esp,1),%eax # Set - pushl %eax # ESP jmp except.2 # Join common code -except.1: pushl 0x50(%esp,1) # Set GS, FS, DS, ES - decb %al # (if V86 mode), and - jne except.1 # SS, ESP -except.2: push $SEL_SDATA # Set up +except.1: pushl 0x50(%esp,1) # Set SS +except.2: pushl 0x50(%esp,1) # Set ESP + push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data @@ -363,14 +371,12 @@ except.2: push $SEL_SDATA # Set up movl $MEM_BUF,%edi # Buffer pushl %eax pushl %edx -wait.1: - inb $0x60,%al +wait.1: inb $0x60,%al testb $0x04,%al jz wait.1 movb $0xe0,%al outb %al,$0x62 -wait.2: - inb $0x60,%al +wait.2: inb $0x60,%al testb $0x01,%al jz wait.2 xorl %edx,%edx @@ -399,237 +405,11 @@ wait.2: je except.3 # Yes cmpb $0x1,(%esp,1) # Debug? jne except.2a # No - testl $0x100,0x10(%esp,1) # Trap flag set? + testl $PSL_T,0x10(%esp,1) # Trap flag set? jnz except.3 # Yes except.2a: jmp exit # Exit except.3: leal 0x8(%esp,1),%esp # Discard err, int no iret # From interrupt -/* - * Return to user mode from V86 mode. - */ -intrtn: cld # String ops inc - pushl %ds # Address - popl %es # data - leal 0x3c(%ebp),%edx # V86 Segment registers - movl MEM_TSS+TSS_ESP1,%esi # Link stack pointer - lodsl # INT_V86 args pointer - movl %esi,%ebx # Saved exception frame - testl %eax,%eax # INT_V86 args? - jz intrtn.2 # No - movl $MEM_USR,%edi # User base - movl 0x1c(%esi),%ebx # User ESP - movl %eax,(%edi,%ebx,1) # Restore to user stack - leal 0x8(%edi,%eax,1),%edi # Arg segment registers - testb $0x4,-0x6(%edi) # Return flags? - jz intrtn.1 # No - movl 0x30(%ebp),%eax # Get V86 flags - movw %ax,0x18(%esi) # Set user flags -intrtn.1: leal 0x10(%esi),%ebx # Saved exception frame - xchgl %edx,%esi # Segment registers - movb $0x4,%cl # Update seg regs - rep # in INT_V86 - movsl # args -intrtn.2: xchgl %edx,%esi # Segment registers - leal 0x28(%ebp),%edi # Set up seg - movb $0x4,%cl # regs for - rep # later - movsl # pop - xchgl %ebx,%esi # Restore exception - movb $0x5,%cl # frame to - rep # supervisor - movsl # stack - movl %esi,MEM_TSS+TSS_ESP1 # Link stack pointer - popa # Restore - leal 0x8(%esp,1),%esp # Discard err, int no - popl %es # Restore - popl %ds # user - popl %fs # segment - popl %gs # registers - iret # To user mode -/* - * V86 monitor. - */ -v86mon: cld # String ops inc - pushl $SEL_SDATA # Set up for - popl %ds # flat addressing - pusha # Save registers - movl %esp,%ebp # Address stack frame - movzwl 0x2c(%ebp),%edi # Load V86 CS - shll $0x4,%edi # To linear - movl 0x28(%ebp),%esi # Load V86 IP - addl %edi,%esi # Code pointer - xorl %ecx,%ecx # Zero - movb $0x2,%cl # 16-bit operands - xorl %eax,%eax # Zero -v86mon.1: lodsb # Get opcode - cmpb $0x66,%al # Operand size prefix? - jne v86mon.2 # No - movb $0x4,%cl # 32-bit operands - jmp v86mon.1 # Continue -v86mon.2: cmpb $0xf4,%al # HLT? - jne v86mon.3 # No - cmpl $inthlt+0x1,%esi # Is inthlt? - jne v86mon.7 # No (ignore) - jmp intrtn # Return to user mode -v86mon.3: cmpb $0xf,%al # Prefixed instruction? - jne v86mon.4 # No - cmpb $0x09,(%esi) # Is it a WBINVD? - je v86wbinvd # Yes - cmpb $0x30,(%esi) # Is it a WRMSR? - je v86wrmsr # Yes - cmpb $0x32,(%esi) # Is it a RDMSR? - je v86rdmsr # Yes - cmpb $0x20,(%esi) # Is this a MOV reg,CRx? - je v86mov # Yes -v86mon.4: cmpb $0xfa,%al # CLI? - je v86cli # Yes - cmpb $0xfb,%al # STI? - je v86sti # Yes - movzwl 0x38(%ebp),%ebx # Load V86 SS - shll $0x4,%ebx # To offset - pushl %ebx # Save - addl 0x34(%ebp),%ebx # Add V86 SP - movl 0x30(%ebp),%edx # Load V86 flags - cmpb $0x9c,%al # PUSHF/PUSHFD? - je v86pushf # Yes - cmpb $0x9d,%al # POPF/POPFD? - je v86popf # Yes - cmpb $0xcd,%al # INT imm8? - je v86intn # Yes - cmpb $0xcf,%al # IRET/IRETD? - je v86iret # Yes - popl %ebx # Restore - popa # Restore - jmp except # Handle exception -v86mon.5: movl %edx,0x30(%ebp) # Save V86 flags -v86mon.6: popl %edx # V86 SS adjustment - subl %edx,%ebx # Save V86 - movl %ebx,0x34(%ebp) # SP -v86mon.7: subl %edi,%esi # From linear - movl %esi,0x28(%ebp) # Save V86 IP - popa # Restore - leal 0x8(%esp,1),%esp # Discard int no, error - iret # To V86 mode -/* - * Emulate MOV reg,CRx. - */ -v86mov: movb 0x1(%esi),%bl # Fetch Mod R/M byte - testb $0x10,%bl # Read CR2 or CR3? - jnz v86mov.1 # Yes - movl %cr0,%eax # Read CR0 - testb $0x20,%bl # Read CR4 instead? - jz v86mov.2 # No - movl %cr4,%eax # Read CR4 - jmp v86mov.2 -v86mov.1: movl %cr2,%eax # Read CR2 - testb $0x08,%bl # Read CR3 instead? - jz v86mov.2 # No - movl %cr3,%eax # Read CR3 -v86mov.2: andl $0x7,%ebx # Compute offset in - shl $2,%ebx # frame of destination - neg %ebx # register - movl %eax,0x1c(%ebp,%ebx,1) # Store CR to reg - incl %esi # Adjust IP -/* - * Return from emulating a 0x0f prefixed instruction - */ -v86preret: incl %esi # Adjust IP - jmp v86mon.7 # Finish up -/* - * Emulate WBINVD - */ -v86wbinvd: wbinvd # Write back and invalidate - # cache - jmp v86preret # Finish up -/* - * Emulate WRMSR - */ -v86wrmsr: movl 0x18(%ebp),%ecx # Get user's %ecx (MSR to write) - movl 0x14(%ebp),%edx # Load the value - movl 0x1c(%ebp),%eax # to write - wrmsr # Write MSR - jmp v86preret # Finish up -/* - * Emulate RDMSR - */ -v86rdmsr: movl 0x18(%ebp),%ecx # MSR to read - rdmsr # Read the MSR - movl %eax,0x1c(%ebp) # Return the value of - movl %edx,0x14(%ebp) # the MSR to the user - jmp v86preret # Finish up -/* - * Emulate CLI. - */ -v86cli: andb $~0x2,0x31(%ebp) # Clear IF - jmp v86mon.7 # Finish up -/* - * Emulate STI. - */ -v86sti: orb $0x2,0x31(%ebp) # Set IF - jmp v86mon.7 # Finish up -/* - * Emulate PUSHF/PUSHFD. - */ -v86pushf: subl %ecx,%ebx # Adjust SP - cmpb $0x4,%cl # 32-bit - je v86pushf.1 # Yes - data16 # 16-bit -v86pushf.1: movl %edx,(%ebx) # Save flags - jmp v86mon.6 # Finish up -/* - * Emulate IRET/IRETD. - */ -v86iret: movzwl (%ebx),%esi # Load V86 IP - movzwl 0x2(%ebx),%edi # Load V86 CS - leal 0x4(%ebx),%ebx # Adjust SP - movl %edi,0x2c(%ebp) # Save V86 CS - xorl %edi,%edi # No ESI adjustment -/* - * Emulate POPF/POPFD (and remainder of IRET/IRETD). - */ -v86popf: cmpb $0x4,%cl # 32-bit? - je v86popf.1 # Yes - movl %edx,%eax # Initialize - data16 # 16-bit -v86popf.1: movl (%ebx),%eax # Load flags - addl %ecx,%ebx # Adjust SP - andl $V86_FLG,%eax # Merge - andl $~V86_FLG,%edx # the - orl %eax,%edx # flags - jmp v86mon.5 # Finish up -/* - * trap int 15, function 87 - * reads %es:%si from saved registers on stack to find a GDT containing - * source and destination locations - * reads count of words from saved %cx - * returns success by setting %ah to 0 - */ -int15_87: pushl %esi # Save - pushl %edi # registers - movl 0x3C(%ebp),%edi # Load ES - movzwl 0x4(%ebp),%eax # Load user's SI - shll $0x4,%edi # EDI = (ES << 4) + - addl %eax,%edi # SI - movl 0x11(%edi),%eax # Read base of - movb 0x17(%edi),%al # GDT entry - ror $8,%eax # for source - xchgl %eax,%esi # into %esi - movl 0x19(%edi),%eax # Read base of - movb 0x1f(%edi),%al # GDT entry for - ror $8,%eax # destination - xchgl %eax,%edi # into %edi - pushl %ds # Make: - popl %es # es = ds - movzwl 0x18(%ebp),%ecx # Get user's CX - shll $0x1,%ecx # Convert count from words - rep # repeat... - movsb # perform copy. - popl %edi # Restore - popl %esi # registers - movb $0x0,0x1d(%ebp) # set ah = 0 to indicate - # success - andb $0xfe,%dl # clear CF - jmp v86mon.5 # Finish up /* * Reboot the machine by setting the reboot flag and exiting @@ -638,36 +418,7 @@ reboot: orb $0x1,btx_hdr+0x7 # Set the jmp exit # Terminate BTX and reboot /* - * Emulate INT imm8... also make sure to check if it's int 15/87 - */ -v86intn: lodsb # Get int no - cmpb $0x19,%al # is it int 19? - je reboot # yes, reboot the machine - cmpb $0x15,%al # is it int 15? - jne v86intn.1 # no, skip parse - cmpb $0x87,0x1d(%ebp) # is it the memcpy subfunction? - je int15_87 # yes - cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout? - jne v86intn.1 # no, handle the int normally - movb BDA_KEYFLAGS,%ch # get the shift key state - andb $0x18,%ch # mask off just Ctrl and Alt - cmpb $0x18,%ch # are both Ctrl and Alt down? - je reboot # yes, reboot the machine -v86intn.1: subl %edi,%esi # From - shrl $0x4,%edi # linear - movw %dx,-0x2(%ebx) # Save flags - movw %di,-0x4(%ebx) # Save CS - leal -0x6(%ebx),%ebx # Adjust SP - movw %si,(%ebx) # Save IP - shll $0x2,%eax # Scale - movzwl (%eax),%esi # Load IP - movzwl 0x2(%eax),%edi # Load CS - movl %edi,0x2c(%ebp) # Save CS - xorl %edi,%edi # No ESI adjustment - andb $~0x1,%dh # Clear TF - jmp v86mon.5 # Finish up -/* - * Hardware interrupt jump table. + * Protected Mode Hardware interrupt jump table. */ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x8 @@ -701,127 +452,267 @@ intx20: push $0x8 # Int 0x20: IRQ0 jmp int_hw # V86 int 0x16 push $0x17 # Int 0x2f: IRQ15 jmp int_hw # V86 int 0x17 + +/* + * Invoke real mode interrupt/function call from user mode with arguments. + */ +intx31: pushl $-1 # Dummy int no for btx_v86 /* - * Reflect hardware interrupts. + * Invoke real mode interrupt/function call from protected mode. + * + * We place a trampoline on the user stack that will return to rret_tramp + * which will reenter protected mode and then finally return to the user + * client. + * + * Kernel frame %esi points to: Real mode stack frame at MEM_ESPR: + * + * -0x00 user %ss -0x04 kernel %esp (with full frame) + * -0x04 user %esp -0x08 btx_v86 pointer + * -0x08 user %eflags -0x0c flags (only used if interrupt) + * -0x0c user %cs -0x10 real mode CS:IP return trampoline + * -0x10 user %eip -0x12 real mode flags + * -0x14 int no -0x16 real mode CS:IP (target) + * -0x18 %eax + * -0x1c %ecx + * -0x20 %edx + * -0x24 %ebx + * -0x28 %esp + * -0x2c %ebp + * -0x30 %esi + * -0x34 %edi + * -0x38 %gs + * -0x3c %fs + * -0x40 %ds + * -0x44 %es + * -0x48 zero %eax (hardware int only) + * -0x4c zero %ecx (hardware int only) + * -0x50 zero %edx (hardware int only) + * -0x54 zero %ebx (hardware int only) + * -0x58 zero %esp (hardware int only) + * -0x5c zero %ebp (hardware int only) + * -0x60 zero %esi (hardware int only) + * -0x64 zero %edi (hardware int only) + * -0x68 zero %gs (hardware int only) + * -0x6c zero %fs (hardware int only) + * -0x70 zero %ds (hardware int only) + * -0x74 zero %es (hardware int only) */ -int_hw: testb $0x2,0xe(%esp,1) # V86 mode? - jz intusr # No - pushl $SEL_SDATA # Address - popl %ds # data - xchgl %eax,(%esp,1) # Swap EAX, int no - pushl %ebp # Address - movl %esp,%ebp # stack frame - pushl %ebx # Save - shll $0x2,%eax # Get int - movl (%eax),%eax # vector - subl $0x6,0x14(%ebp) # Adjust V86 ESP - movzwl 0x18(%ebp),%ebx # V86 SS - shll $0x4,%ebx # * 0x10 - addl 0x14(%ebp),%ebx # + V86 ESP - xchgw %ax,0x8(%ebp) # Swap V86 IP - rorl $0x10,%eax # Swap words - xchgw %ax,0xc(%ebp) # Swap V86 CS - roll $0x10,%eax # Swap words - movl %eax,(%ebx) # CS:IP for IRET - movl 0x10(%ebp),%eax # V86 flags - movw %ax,0x4(%ebx) # Flags for IRET - andb $~0x3,0x11(%ebp) # Clear IF, TF - popl %ebx # Restore - popl %ebp # saved - popl %eax # registers - iret # To V86 mode -/* - * Invoke V86 interrupt from user mode, with arguments. - */ -intx31: stc # Have btx_v86 - pushl %eax # Missing int no -/* - * Invoke V86 interrupt from user mode. - */ -intusr: std # String ops dec - pushl %eax # Expand - pushl %eax # stack - pushl %eax # frame - pusha # Save +int_hw: cld # String ops inc + pusha # Save gp regs pushl %gs # Save - movl %esp,%eax # seg regs - pushl %fs # and - pushl %ds # point - pushl %es # to them + pushl %fs # seg + pushl %ds # regs + pushl %es push $SEL_SDATA # Set up popl %ds # to pushl %ds # address popl %es # data + leal 0x44(%esp,1),%esi # Base of frame + movl %esp,MEM_ESPR-0x04 # Save kernel stack pointer + movl -0x14(%esi),%eax # Get Int no + cmpl $-1,%eax # Hardware interrupt? + jne intusr.1 # Yes +/* + * v86 calls save the btx_v86 pointer on the real mode stack and read + * the address and flags from the btx_v86 structure. For interrupt + * handler invocations (VM86 INTx requests), disable interrupts, + * tracing, and alignment checking while the handler runs. + */ movl $MEM_USR,%ebx # User base movl %ebx,%edx # address - jc intusr.1 # If btx_v86 - xorl %edx,%edx # Control flags - xorl %ebp,%ebp # btx_v86 pointer -intusr.1: leal 0x50(%esp,1),%esi # Base of frame - pushl %esi # Save addl -0x4(%esi),%ebx # User ESP - movl MEM_TSS+TSS_ESP1,%edi # Link stack pointer - leal -0x4(%edi),%edi # Adjust for push - xorl %ecx,%ecx # Zero - movb $0x5,%cl # Push exception - rep # frame on - movsl # link stack - xchgl %eax,%esi # Saved seg regs - movl 0x40(%esp,1),%eax # Get int no - testl %edx,%edx # Have btx_v86? - jz intusr.2 # No movl (%ebx),%ebp # btx_v86 pointer - movb $0x4,%cl # Count - addl %ecx,%ebx # Adjust for pop - rep # Push saved seg regs - movsl # on link stack addl %ebp,%edx # Flatten btx_v86 ptr - leal 0x14(%edx),%esi # Seg regs pointer - movl 0x4(%edx),%eax # Get int no/address - movzwl 0x2(%edx),%edx # Get control flags -intusr.2: movl %ebp,(%edi) # Push btx_v86 and - movl %edi,MEM_TSS+TSS_ESP1 # save link stack ptr - popl %edi # Base of frame - xchgl %eax,%ebp # Save intno/address - movl 0x48(%esp,1),%eax # Get flags - testb $0x2,%dl # Simulate CALLF? - jnz intusr.3 # Yes - decl %ebx # Push flags - decl %ebx # on V86 - movw %ax,(%ebx) # stack -intusr.3: movb $0x4,%cl # Count - subl %ecx,%ebx # Push return address - movl $inthlt,(%ebx) # on V86 stack - rep # Copy seg regs to - movsl # exception frame - xchgl %eax,%ecx # Save flags - movl %ebx,%eax # User ESP - subl $V86_STK,%eax # Less bytes - ja intusr.4 # to - xorl %eax,%eax # keep -intusr.4: shrl $0x4,%eax # Gives segment - stosl # Set SS - shll $0x4,%eax # To bytes - xchgl %eax,%ebx # Swap - subl %ebx,%eax # Gives offset - stosl # Set ESP - xchgl %eax,%ecx # Get flags - btsl $0x11,%eax # Set VM - andb $~0x1,%ah # Clear TF - stosl # Set EFL - xchgl %eax,%ebp # Get int no/address - testb $0x1,%dl # Address? - jnz intusr.5 # Yes - shll $0x2,%eax # Scale + movl %edx,MEM_ESPR-0x08 # Save btx_v86 ptr + movl V86_ADDR(%edx),%eax # Get int no/address + movl V86_CTL(%edx),%edx # Get control flags + movl -0x08(%esi),%ebx # Save user flags in %ebx + testl $V86F_ADDR,%edx # Segment:offset? + jnz intusr.4 # Yes + andl $~(PSL_I|PSL_T|PSL_AC),%ebx # Disable interrupts, tracing, + # and alignment checking for + # interrupt handler + jmp intusr.3 # Skip hardware interrupt +/* + * Hardware interrupts store a NULL btx_v86 pointer and use the + * address (interrupt number) from the stack with empty flags. Also, + * push a dummy frame of zeros onto the stack for all the general + * purpose and segment registers and clear %eflags. This gives the + * hardware interrupt handler a clean slate. + */ +intusr.1: xorl %edx,%edx # Control flags + movl %edx,MEM_ESPR-0x08 # NULL btx_v86 ptr + movl $12,%ecx # Frame is 12 dwords +intusr.2: pushl $0x0 # Fill frame + loop intusr.2 # with zeros + movl $PSL_RESERVED_DEFAULT,%ebx # Set clean %eflags +/* + * Look up real mode IDT entry for hardware interrupts and VM86 INTx + * requests. + */ +intusr.3: shll $0x2,%eax # Scale movl (%eax),%eax # Load int vector -intusr.5: movl %eax,%ecx # Save - shrl $0x10,%eax # Gives segment - stosl # Set CS - movw %cx,%ax # Restore - stosl # Set EIP - leal 0x10(%esp,1),%esp # Discard seg regs - popa # Restore - iret # To V86 mode + jmp intusr.5 # Skip CALLF test +/* + * Panic if V86F_CALLF isn't set with V86F_ADDR. + */ +intusr.4: testl $V86F_CALLF,%edx # Far call? + jnz intusr.5 # Ok + movl %edx,0x30(%esp,1) # Place VM86 flags in int no + movl $badvm86,%esi # Display bad + call putstr # VM86 call + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + jmp ex_noc # Panic +/* + * %eax now holds the segment:offset of the function. + * %ebx now holds the %eflags to pass to real mode. + * %edx now holds the V86F_* flags. + */ +intusr.5: movw %bx,MEM_ESPR-0x12 # Pass user flags to real mode + # target +/* + * If this is a v86 call, copy the seg regs out of the btx_v86 structure. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + jecxz intusr.6 # Skip for hardware ints + leal -0x44(%esi),%edi # %edi => kernel stack seg regs + pushl %esi # Save + leal V86_ES(%ecx),%esi # %esi => btx_v86 seg regs + movl $4,%ecx # Copy seg regs + rep # from btx_v86 + movsl # to kernel stack + popl %esi # Restore +intusr.6: movl -0x08(%esi),%ebx # Copy user flags to real + movl %ebx,MEM_ESPR-0x0c # mode return trampoline + movl $rret_tramp,%ebx # Set return trampoline + movl %ebx,MEM_ESPR-0x10 # CS:IP + movl %eax,MEM_ESPR-0x16 # Real mode target CS:IP + ljmpw $SEL_RCODE,$intusr.7 # Change to 16-bit segment + .code16 +intusr.7: movl %cr0,%eax # Leave + dec %al # protected + movl %eax,%cr0 # mode + ljmpw $0x0,$intusr.8 +intusr.8: xorw %ax,%ax # Reset %ds + movw %ax,%ds # and + movw %ax,%ss # %ss + lidt ivtdesc # Set IVT + popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + movw $MEM_ESPR-0x16,%sp # Switch to real mode stack + iret # Call target routine +/* + * For the return to real mode we setup a stack frame like this on the real + * mode stack. Note that callf calls won't pop off the flags, but we just + * ignore that by repositioning %sp to be just above the btx_v86 pointer + * so it is aligned. The stack is relative to MEM_ESPR. + * + * -0x04 kernel %esp + * -0x08 btx_v86 + * -0x0c %eax + * -0x10 %ecx + * -0x14 %edx + * -0x18 %ebx + * -0x1c %esp + * -0x20 %ebp + * -0x24 %esi + * -0x28 %edi + * -0x2c %gs + * -0x30 %fs + * -0x34 %ds + * -0x38 %es + * -0x3c %eflags + */ +rret_tramp: movw $MEM_ESPR-0x08,%sp # Reset stack pointer + pushal # Save gp regs + pushl %gs # Save + pushl %fs # seg + pushl %ds # regs + pushl %es + pushfl # Save %eflags + cli # Disable interrupts + std # String ops dec + xorw %ax,%ax # Reset seg + movw %ax,%ds # regs + movw %ax,%es # (%ss is already 0) + lidt idtdesc # Set IDT + lgdt gdtdesc # Set GDT + mov %cr0,%eax # Switch to protected + inc %ax # mode + mov %eax,%cr0 # + ljmp $SEL_SCODE,$rret_tramp.1 # To 32-bit code + .code32 +rret_tramp.1: xorl %ecx,%ecx # Zero + movb $SEL_SDATA,%cl # Setup + movw %cx,%ss # 32-bit + movw %cx,%ds # seg + movw %cx,%es # regs + movl MEM_ESPR-0x04,%esp # Switch to kernel stack + leal 0x44(%esp,1),%esi # Base of frame + andb $~0x2,tss_desc+0x5 # Clear TSS busy + movb $SEL_TSS,%cl # Set task + ltr %cx # register +/* + * Now we are back in protected mode. The kernel stack frame set up + * before entering real mode is still intact. For hardware interrupts, + * leave the frame unchanged. + */ + cmpl $0,MEM_ESPR-0x08 # Leave saved regs unchanged + jz rret_tramp.3 # for hardware ints +/* + * For V86 calls, copy the registers off of the real mode stack onto + * the kernel stack as we want their updated values. Also, initialize + * the segment registers on the kernel stack. + * + * Note that the %esp in the kernel stack after this is garbage, but popa + * ignores it, so we don't have to fix it up. + */ + leal -0x18(%esi),%edi # Kernel stack GP regs + pushl %esi # Save + movl $MEM_ESPR-0x0c,%esi # Real mode stack GP regs + movl $8,%ecx # Copy GP regs from + rep # real mode stack + movsl # to kernel stack + movl $SEL_UDATA,%eax # Selector for data seg regs + movl $4,%ecx # Initialize %ds, + rep # %es, %fs, and + stosl # %gs +/* + * For V86 calls, copy the saved seg regs on the real mode stack back + * over to the btx_v86 structure. Also, conditionally update the + * saved eflags on the kernel stack based on the flags from the user. + */ + movl MEM_ESPR-0x08,%ecx # Get btx_v86 ptr + leal V86_GS(%ecx),%edi # %edi => btx_v86 seg regs + leal MEM_ESPR-0x2c,%esi # %esi => real mode seg regs + xchgl %ecx,%edx # Save btx_v86 ptr + movl $4,%ecx # Copy seg regs + rep # from real mode stack + movsl # to btx_v86 + popl %esi # Restore + movl V86_CTL(%edx),%edx # Read V86 control flags + testl $V86F_FLAGS,%edx # User wants flags? + jz rret_tramp.3 # No + movl MEM_ESPR-0x3c,%eax # Read real mode flags + movw %ax,-0x08(%esi) # Update user flags (low 16) +/* + * Return to the user task + */ +rret_tramp.3: popl %es # Restore + popl %ds # seg + popl %fs # regs + popl %gs + popal # Restore gp regs + addl $4,%esp # Discard int no + iret # Return to user mode + /* * System Call. */ @@ -869,7 +760,7 @@ dump.1: testb $DMP_X32,%ch # Dump long dump.2: testb $DMP_MEM,%ch # Dump memory? jz dump.8 # No pushl %ds # Save - testb $0x2,0x52(%ebx) # V86 mode? + testl $PSL_VM,0x50(%ebx) # V86 mode? jnz dump.3 # Yes verr 0x4(%esi) # Readable selector? jnz dump.3 # No @@ -1060,6 +951,61 @@ putchr.4: movw %dx,(%ebx) # Update pos ret # To caller #endif + .code16 +/* + * Real Mode Hardware interrupt jump table. + */ +intr20: push $0x8 # Int 0x20: IRQ0 + jmp int_hwr # V86 int 0x8 + push $0x9 # Int 0x21: IRQ1 + jmp int_hwr # V86 int 0x9 + push $0xa # Int 0x22: IRQ2 + jmp int_hwr # V86 int 0xa + push $0xb # Int 0x23: IRQ3 + jmp int_hwr # V86 int 0xb + push $0xc # Int 0x24: IRQ4 + jmp int_hwr # V86 int 0xc + push $0xd # Int 0x25: IRQ5 + jmp int_hwr # V86 int 0xd + push $0xe # Int 0x26: IRQ6 + jmp int_hwr # V86 int 0xe + push $0xf # Int 0x27: IRQ7 + jmp int_hwr # V86 int 0xf + push $0x10 # Int 0x28: IRQ8 + jmp int_hwr # V86 int 0x10 + push $0x11 # Int 0x29: IRQ9 + jmp int_hwr # V86 int 0x11 + push $0x12 # Int 0x2a: IRQ10 + jmp int_hwr # V86 int 0x12 + push $0x13 # Int 0x2b: IRQ11 + jmp int_hwr # V86 int 0x13 + push $0x14 # Int 0x2c: IRQ12 + jmp int_hwr # V86 int 0x14 + push $0x15 # Int 0x2d: IRQ13 + jmp int_hwr # V86 int 0x15 + push $0x16 # Int 0x2e: IRQ14 + jmp int_hwr # V86 int 0x16 + push $0x17 # Int 0x2f: IRQ15 + jmp int_hwr # V86 int 0x17 +/* + * Reflect hardware interrupts in real mode. + */ +int_hwr: push %ax # Save + push %ds # Save + push %bp # Save + mov %sp,%bp # Address stack frame + xchg %bx,6(%bp) # Swap BX, int no + xor %ax,%ax # Set %ds:%bx to + shl $2,%bx # point to + mov %ax,%ds # IDT entry + mov (%bx),%ax # Load IP + mov 2(%bx),%bx # Load CS + xchg %ax,4(%bp) # Swap saved %ax,%bx with + xchg %bx,6(%bp) # CS:IP of handler + pop %bp # Restore + pop %ds # Restore + lret # Jump to handler + .p2align 4 /* * Global descriptor table. @@ -1071,7 +1017,7 @@ gdt: .word 0x0,0x0,0x0,0x0 # Null entr .word 0xffff,0x0,0x9200,0x0 # SEL_RDATA .word 0xffff,MEM_USR,0xfa00,0xcf# SEL_UCODE .word 0xffff,MEM_USR,0xf200,0xcf# SEL_UDATA - .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS +tss_desc: .word _TSSLM,MEM_TSS,0x8900,0x0 # SEL_TSS gdt.1: /* * Pseudo-descriptors. @@ -1140,6 +1086,11 @@ dmpfmt: .byte '\n' # "\n" .byte 0x80|DMP_MEM|DMP_EOL,0x0 # "00 00 ... 00 00\n" .asciz "BTX halted\n" # End /* + * Bad VM86 call panic + */ +badvm86: .asciz "Invalid VM86 Request\n" + +/* * End of BTX memory. */ .p2align 4 From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 13:06:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C1C6106568B; Tue, 8 Dec 2009 13:06:36 +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 D57C08FC0C; Tue, 8 Dec 2009 13:06:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8D6ZWX088704; Tue, 8 Dec 2009 13:06:35 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8D6Z4D088701; Tue, 8 Dec 2009 13:06:35 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912081306.nB8D6Z4D088701@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 8 Dec 2009 13:06: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: r200255 - in head/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 13:06:36 -0000 Author: nyan Date: Tue Dec 8 13:06:35 2009 New Revision: 200255 URL: http://svn.freebsd.org/changeset/base/200255 Log: MFi386: revision 200219 Improve the algorithm the loader uses to choose a memory range for its heap when using a range above 1MB. MFC after: 1 week Modified: head/sys/boot/pc98/libpc98/biosmem.c head/sys/boot/pc98/loader/main.c Modified: head/sys/boot/pc98/libpc98/biosmem.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosmem.c Tue Dec 8 13:04:26 2009 (r200254) +++ head/sys/boot/pc98/libpc98/biosmem.c Tue Dec 8 13:06:35 2009 (r200255) @@ -34,8 +34,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" -vm_offset_t memtop, memtop_copyin; -uint32_t bios_basemem, bios_extmem; +vm_offset_t memtop, memtop_copyin, high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) void bios_getmem(void) @@ -48,4 +53,12 @@ bios_getmem(void) /* Set memtop to actual top of memory */ memtop = memtop_copyin = 0x100000 + bios_extmem; + /* + * If we have extended memory, use the last 3MB of 'extended' memory + * as a high heap candidate. + */ + if (bios_extmem >= HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = memtop - HEAP_MIN; + } } Modified: head/sys/boot/pc98/loader/main.c ============================================================================== --- head/sys/boot/pc98/loader/main.c Tue Dec 8 13:04:26 2009 (r200254) +++ head/sys/boot/pc98/loader/main.c Tue Dec 8 13:06:35 2009 (r200255) @@ -97,13 +97,17 @@ main(void) bios_getmem(); #if defined(LOADER_BZIP2_SUPPORT) - heap_top = PTOV(memtop_copyin); - memtop_copyin -= 0x300000; - heap_bottom = PTOV(memtop_copyin); -#else - heap_top = (void *)bios_basemem; - heap_bottom = (void *)end; + if (high_heap_size > 0) { + heap_top = PTOV(high_heap_base + high_heap_size); + heap_bottom = PTOV(high_heap_base); + if (high_heap_base < memtop_copyin) + memtop_copyin = high_heap_base; + } else #endif + { + heap_top = (void *)PTOV(bios_basemem); + heap_bottom = (void *)end; + } setheap(heap_bottom, heap_top); /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 13:36:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D36751065676; Tue, 8 Dec 2009 13:36:08 +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 A485D8FC17; Tue, 8 Dec 2009 13:36:08 +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 59DCF46B6C; Tue, 8 Dec 2009 08:36:08 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 4A5BE8A01D; Tue, 8 Dec 2009 08:36:07 -0500 (EST) From: John Baldwin To: Takahashi Yoshihiro Date: Tue, 8 Dec 2009 08:22:27 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912081306.nB8D6Z4D088701@svn.freebsd.org> In-Reply-To: <200912081306.nB8D6Z4D088701@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912080822.27179.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 08 Dec 2009 08:36:07 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no 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: r200255 - in head/sys/boot/pc98: libpc98 loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 13:36:08 -0000 On Tuesday 08 December 2009 8:06:35 am Takahashi Yoshihiro wrote: > Author: nyan > Date: Tue Dec 8 13:06:35 2009 > New Revision: 200255 > URL: http://svn.freebsd.org/changeset/base/200255 > > Log: > MFi386: revision 200219 > > Improve the algorithm the loader uses to choose a memory range for its > heap when using a range above 1MB. Since PC-98 doesn't have an SMAP I expect this won't make any functional difference though it probably reduces diffs with i386. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 14:36:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9EBF1065672; Tue, 8 Dec 2009 14:36:32 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE518FC13; Tue, 8 Dec 2009 14:36:31 +0000 (UTC) Received: by bwz5 with SMTP id 5so4428403bwz.3 for ; Tue, 08 Dec 2009 06:36:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=+8/Zv/7PVKnPws0Fb8ipDiuB21KzsH2Yv6NDuc8328E=; b=jRkYDABdt2zFX7oS/Rv+kjGmqwGTvFOtWSOtt0vmG4uPuomIiEM78DixKc9eTxOrxW VW0dxjsZEgSyRfQ4aY55870Eu1s46UHSTDbTwzE6wqGuQ0+TC73yn25CEE9cssLfz9YP q6mym1b20pPNkWlR7LETpmy9XCRiCpOqmf6Co= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=A5BK54+9yO3QGDWqzfbINr+HFvHkU/DltNkwXtNymHQN18JQSW1q83UX59fEA1sOEx 0ImC2mJN9tcy2WxrlN3/x/Qw+gAjOvQuaBEaS0jGCfE9/MzTX752OLRZiLLHOvT+tu3q jss7QWCzJjTh9WBNCQ/92uO+tMxUlSEPtRGIs= Received: by 10.204.25.19 with SMTP id x19mr4917103bkb.189.1260282990996; Tue, 08 Dec 2009 06:36:30 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 13sm2377186fxm.1.2009.12.08.06.36.29 (version=SSLv3 cipher=RC4-MD5); Tue, 08 Dec 2009 06:36:30 -0800 (PST) Sender: Alexander Motin Message-ID: <4B1E646B.8050209@FreeBSD.org> Date: Tue, 08 Dec 2009 16:36:27 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: src-committers@freebsd.org References: <200912051340.nB5DepkE089078@svn.freebsd.org> <20091207174233.GG1688@garage.freebsd.pl> In-Reply-To: <20091207174233.GG1688@garage.freebsd.pl> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r200121 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 14:36:33 -0000 Pawel Jakub Dawidek wrote: > On Sat, Dec 05, 2009 at 01:40:51PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Sat Dec 5 13:40:51 2009 >> New Revision: 200121 >> URL: http://svn.freebsd.org/changeset/base/200121 >> >> Log: >> Do not ignore device interrupt if bus mastering is still active. It is >> normal in case of media read error and some ATAPI cases, when transfer size >> is unknown beforehand. PCI ATA BM specification tells that in case of such >> underrun driver should just manually stop DMA engine. DMA engine should >> same time guarantie that all bus mastering transfers completed at the moment >> of driver reads interrupt flag asserted. >> This change should fix interrupt storms and command timeouts in many cases. >> >> PR: kern/103602, sparc64/121539, kern/133122, kern/139654 > > I've a box where I see interrupt storm on. This is 8-STABLE with this > patch applied. Pawel found that it was not ATA issue, but USB. Fixed. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 14:55:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D6F106566B; Tue, 8 Dec 2009 14:55:08 +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 04CCE8FC0A; Tue, 8 Dec 2009 14:55: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 nB8Et79I090960; Tue, 8 Dec 2009 14:55:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Et7kb090958; Tue, 8 Dec 2009 14:55:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912081455.nB8Et7kb090958@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Dec 2009 14:55: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: r200257 - head/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 14:55:08 -0000 Author: mav Date: Tue Dec 8 14:55:07 2009 New Revision: 200257 URL: http://svn.freebsd.org/changeset/base/200257 Log: Add ID for NetMos NM9820 Serial Port chip, found on CardBus serial adapter. Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Tue Dec 8 13:25:00 2009 (r200256) +++ head/sys/dev/uart/uart_bus_pci.c Tue Dec 8 14:55:07 2009 (r200257) @@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, +{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 15:14:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20A661065670; Tue, 8 Dec 2009 15:14:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1E78FC22; Tue, 8 Dec 2009 15:14: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 nB8FEtrh091431; Tue, 8 Dec 2009 15:14:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8FEtGh091429; Tue, 8 Dec 2009 15:14:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912081514.nB8FEtGh091429@svn.freebsd.org> From: Andriy Gapon Date: Tue, 8 Dec 2009 15:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200258 - stable/8/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 15:14:56 -0000 Author: avg Date: Tue Dec 8 15:14:55 2009 New Revision: 200258 URL: http://svn.freebsd.org/changeset/base/200258 Log: MFC r200052: ichsmb: add pci ids for some newer supported hardware Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/8/sys/dev/ichsmb/ichsmb_pci.c Tue Dec 8 14:55:07 2009 (r200257) +++ stable/8/sys/dev/ichsmb/ichsmb_pci.c Tue Dec 8 15:14:55 2009 (r200258) @@ -75,6 +75,9 @@ __FBSDID("$FreeBSD$"); #define ID_82801EB 0x24D38086 #define ID_82801FB 0x266A8086 #define ID_82801GB 0x27da8086 +#define ID_82801H 0x283e8086 +#define ID_82801I 0x29308086 +#define ID_82801JI 0x3a308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -152,6 +155,15 @@ ichsmb_pci_probe(device_t dev) case ID_82801GB: device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); break; + case ID_82801H: + device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); + break; + case ID_82801I: + device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); + break; + case ID_82801JI: + device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 15:16:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6D3C106566B; Tue, 8 Dec 2009 15:16:48 +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 9562C8FC19; Tue, 8 Dec 2009 15:16: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 nB8FGmsm091556; Tue, 8 Dec 2009 15:16:48 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8FGmYQ091554; Tue, 8 Dec 2009 15:16:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912081516.nB8FGmYQ091554@svn.freebsd.org> From: Andriy Gapon Date: Tue, 8 Dec 2009 15:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200259 - stable/7/sys/dev/ichsmb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 15:16:48 -0000 Author: avg Date: Tue Dec 8 15:16:48 2009 New Revision: 200259 URL: http://svn.freebsd.org/changeset/base/200259 Log: MFC r200052: ichsmb: add pci ids for some newer supported hardware Modified: stable/7/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/7/sys/dev/ichsmb/ichsmb_pci.c Tue Dec 8 15:14:55 2009 (r200258) +++ stable/7/sys/dev/ichsmb/ichsmb_pci.c Tue Dec 8 15:16:48 2009 (r200259) @@ -75,6 +75,9 @@ __FBSDID("$FreeBSD$"); #define ID_82801EB 0x24D38086 #define ID_82801FB 0x266A8086 #define ID_82801GB 0x27da8086 +#define ID_82801H 0x283e8086 +#define ID_82801I 0x29308086 +#define ID_82801JI 0x3a308086 #define ID_6300ESB 0x25a48086 #define ID_631xESB 0x269b8086 @@ -152,6 +155,15 @@ ichsmb_pci_probe(device_t dev) case ID_82801GB: device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); break; + case ID_82801H: + device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); + break; + case ID_82801I: + device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); + break; + case ID_82801JI: + device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); + break; case ID_6300ESB: device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); break; From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 15:21:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F9AE106566C; Tue, 8 Dec 2009 15:21:39 +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 5DE7F8FC20; Tue, 8 Dec 2009 15:21: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 nB8FLdDH091778; Tue, 8 Dec 2009 15:21:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8FLd39091775; Tue, 8 Dec 2009 15:21:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912081521.nB8FLd39091775@svn.freebsd.org> From: Andriy Gapon Date: Tue, 8 Dec 2009 15:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200260 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 15:21:39 -0000 Author: avg Date: Tue Dec 8 15:21:39 2009 New Revision: 200260 URL: http://svn.freebsd.org/changeset/base/200260 Log: MFC r199184: reflect that pg_ps_enabled is a tunable Modified: stable/8/sys/amd64/amd64/pmap.c stable/8/sys/i386/i386/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Tue Dec 8 15:16:48 2009 (r200259) +++ stable/8/sys/amd64/amd64/pmap.c Tue Dec 8 15:21:39 2009 (r200260) @@ -181,7 +181,7 @@ pt_entry_t pg_nx; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled = 1; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); static u_int64_t KPTphys; /* phys addr of kernel level 1 */ Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Tue Dec 8 15:16:48 2009 (r200259) +++ stable/8/sys/i386/i386/pmap.c Tue Dec 8 15:21:39 2009 (r200260) @@ -217,7 +217,7 @@ static int pat_works; /* Is page attri SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 15:24:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B12A51065676; Tue, 8 Dec 2009 15:24:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA748FC25; Tue, 8 Dec 2009 15:24: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 nB8FOb6j091903; Tue, 8 Dec 2009 15:24:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8FOblF091900; Tue, 8 Dec 2009 15:24:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912081524.nB8FOblF091900@svn.freebsd.org> From: Andriy Gapon Date: Tue, 8 Dec 2009 15:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200261 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 15:24:37 -0000 Author: avg Date: Tue Dec 8 15:24:37 2009 New Revision: 200261 URL: http://svn.freebsd.org/changeset/base/200261 Log: MFC r199184: reflect that pg_ps_enabled is a tunable Modified: stable/7/sys/amd64/amd64/pmap.c stable/7/sys/i386/i386/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Tue Dec 8 15:21:39 2009 (r200260) +++ stable/7/sys/amd64/amd64/pmap.c Tue Dec 8 15:24:37 2009 (r200261) @@ -181,7 +181,7 @@ pt_entry_t pg_nx; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); static u_int64_t KPTphys; /* phys addr of kernel level 1 */ Modified: stable/7/sys/i386/i386/pmap.c ============================================================================== --- stable/7/sys/i386/i386/pmap.c Tue Dec 8 15:21:39 2009 (r200260) +++ stable/7/sys/i386/i386/pmap.c Tue Dec 8 15:24:37 2009 (r200261) @@ -214,7 +214,7 @@ static uma_zone_t pdptzone; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); static int pg_ps_enabled; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0, +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, "Are large page mappings enabled?"); /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 15:27:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0CA41065695; Tue, 8 Dec 2009 15:27:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8562C8FC12; Tue, 8 Dec 2009 15:27: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 nB8FR6qd092008; Tue, 8 Dec 2009 15:27:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8FR6Za092003; Tue, 8 Dec 2009 15:27:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912081527.nB8FR6Za092003@svn.freebsd.org> From: Andriy Gapon Date: Tue, 8 Dec 2009 15:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200262 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 15:27:06 -0000 Author: avg Date: Tue Dec 8 15:27:06 2009 New Revision: 200262 URL: http://svn.freebsd.org/changeset/base/200262 Log: MFC r199968: x86 cpu features: add MOVBE reporting and flag Modified: stable/8/sys/amd64/amd64/identcpu.c stable/8/sys/amd64/include/specialreg.h stable/8/sys/i386/i386/identcpu.c stable/8/sys/i386/include/specialreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/identcpu.c Tue Dec 8 15:24:37 2009 (r200261) +++ stable/8/sys/amd64/amd64/identcpu.c Tue Dec 8 15:27:06 2009 (r200262) @@ -259,7 +259,7 @@ printcpuinfo(void) "\024SSE4.1" "\025SSE4.2" "\026x2APIC" /* xAPIC Extensions */ - "\027" + "\027MOVBE" "\030POPCNT" "\031" "\032" Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Tue Dec 8 15:24:37 2009 (r200261) +++ stable/8/sys/amd64/include/specialreg.h Tue Dec 8 15:27:06 2009 (r200262) @@ -129,6 +129,7 @@ #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 #define CPUID2_X2APIC 0x00200000 +#define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 /* Modified: stable/8/sys/i386/i386/identcpu.c ============================================================================== --- stable/8/sys/i386/i386/identcpu.c Tue Dec 8 15:24:37 2009 (r200261) +++ stable/8/sys/i386/i386/identcpu.c Tue Dec 8 15:27:06 2009 (r200262) @@ -746,7 +746,7 @@ printcpuinfo(void) "\024SSE4.1" "\025SSE4.2" "\026x2APIC" /* xAPIC Extensions */ - "\027" + "\027MOVBE" "\030POPCNT" "\031" "\032" Modified: stable/8/sys/i386/include/specialreg.h ============================================================================== --- stable/8/sys/i386/include/specialreg.h Tue Dec 8 15:24:37 2009 (r200261) +++ stable/8/sys/i386/include/specialreg.h Tue Dec 8 15:27:06 2009 (r200262) @@ -126,6 +126,7 @@ #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 #define CPUID2_X2APIC 0x00200000 +#define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 15:29:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2FF21065693; Tue, 8 Dec 2009 15:29:12 +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 978638FC19; Tue, 8 Dec 2009 15:29: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 nB8FTCwZ092094; Tue, 8 Dec 2009 15:29:12 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8FTC22092089; Tue, 8 Dec 2009 15:29:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912081529.nB8FTC22092089@svn.freebsd.org> From: Andriy Gapon Date: Tue, 8 Dec 2009 15:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200263 - in stable/7/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 15:29:12 -0000 Author: avg Date: Tue Dec 8 15:29:12 2009 New Revision: 200263 URL: http://svn.freebsd.org/changeset/base/200263 Log: MFC r199968: x86 cpu features: add MOVBE reporting and flag Modified: stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/include/specialreg.h stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/include/specialreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Tue Dec 8 15:27:06 2009 (r200262) +++ stable/7/sys/amd64/amd64/identcpu.c Tue Dec 8 15:29:12 2009 (r200263) @@ -259,7 +259,7 @@ printcpuinfo(void) "\024SSE4.1" "\025SSE4.2" "\026x2APIC" /* xAPIC Extensions */ - "\027" + "\027MOVBE" "\030POPCNT" "\031" "\032" Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Tue Dec 8 15:27:06 2009 (r200262) +++ stable/7/sys/amd64/include/specialreg.h Tue Dec 8 15:29:12 2009 (r200263) @@ -129,6 +129,7 @@ #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 #define CPUID2_X2APIC 0x00200000 +#define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 /* Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Tue Dec 8 15:27:06 2009 (r200262) +++ stable/7/sys/i386/i386/identcpu.c Tue Dec 8 15:29:12 2009 (r200263) @@ -747,7 +747,7 @@ printcpuinfo(void) "\024SSE4.1" "\025SSE4.2" "\026x2APIC" /* xAPIC Extensions */ - "\027" + "\027MOVBE" "\030POPCNT" "\031" "\032" Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Tue Dec 8 15:27:06 2009 (r200262) +++ stable/7/sys/i386/include/specialreg.h Tue Dec 8 15:29:12 2009 (r200263) @@ -126,6 +126,7 @@ #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 #define CPUID2_X2APIC 0x00200000 +#define CPUID2_MOVBE 0x00400000 #define CPUID2_POPCNT 0x00800000 /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 17:54:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 120A11065672; Tue, 8 Dec 2009 17:54:24 +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 010048FC08; Tue, 8 Dec 2009 17:54: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 nB8HsNB7095024; Tue, 8 Dec 2009 17:54:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8HsNCF095021; Tue, 8 Dec 2009 17:54:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912081754.nB8HsNCF095021@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 8 Dec 2009 17:54: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: r200264 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 17:54:24 -0000 Author: yongari Date: Tue Dec 8 17:54:23 2009 New Revision: 200264 URL: http://svn.freebsd.org/changeset/base/200264 Log: Create sysctl node(dev.bge.%d.focred_collapse) instead of hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4) controllers on system which may not desirable behavior of the sysctl node. Also allow the sysctl node could be modified at any time. Reviewed by: bde (initial version) 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 Tue Dec 8 15:29:12 2009 (r200263) +++ head/sys/dev/bge/if_bge.c Tue Dec 8 17:54:23 2009 (r200264) @@ -483,29 +483,12 @@ DRIVER_MODULE(bge, pci, bge_driver, bge_ DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0); static int bge_allow_asf = 1; -/* - * A common design characteristic for many Broadcom client controllers - * is that they only support a single outstanding DMA read operation - * on the PCIe bus. This means that it will take twice as long to fetch - * a TX frame that is split into header and payload buffers as it does - * to fetch a single, contiguous TX frame (2 reads vs. 1 read). For - * these controllers, coalescing buffers to reduce the number of memory - * reads is effective way to get maximum performance(about 940Mbps). - * Without collapsing TX buffers the maximum TCP bulk transfer - * performance is about 850Mbps. However forcing coalescing mbufs - * consumes a lot of CPU cycles, so leave it off by default. - */ -static int bge_forced_collapse = 0; TUNABLE_INT("hw.bge.allow_asf", &bge_allow_asf); -TUNABLE_INT("hw.bge.forced_collapse", &bge_forced_collapse); SYSCTL_NODE(_hw, OID_AUTO, bge, CTLFLAG_RD, 0, "BGE driver parameters"); SYSCTL_INT(_hw_bge, OID_AUTO, allow_asf, CTLFLAG_RD, &bge_allow_asf, 0, "Allow ASF mode if available"); -SYSCTL_INT(_hw_bge, OID_AUTO, forced_collapse, CTLFLAG_RD, &bge_forced_collapse, - 0, "Number of fragmented TX buffers of a frame allowed before " - "forced collapsing"); #define SPARC64_BLADE_1500_MODEL "SUNW,Sun-Blade-1500" #define SPARC64_BLADE_1500_PATH_BGE "/pci@1f,700000/network@2" @@ -3937,17 +3920,17 @@ bge_encap(struct bge_softc *sc, struct m } if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 && - bge_forced_collapse > 0 && (sc->bge_flags & BGE_FLAG_PCIE) != 0 && - m->m_next != NULL) { + sc->bge_forced_collapse > 0 && + (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { /* * Forcedly collapse mbuf chains to overcome hardware * limitation which only support a single outstanding * DMA read operation. */ - if (bge_forced_collapse == 1) + if (sc->bge_forced_collapse == 1) m = m_defrag(m, M_DONTWAIT); else - m = m_collapse(m, M_DONTWAIT, bge_forced_collapse); + m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -4875,6 +4858,26 @@ bge_add_sysctls(struct bge_softc *sc) #endif + /* + * A common design characteristic for many Broadcom client controllers + * is that they only support a single outstanding DMA read operation + * on the PCIe bus. This means that it will take twice as long to fetch + * a TX frame that is split into header and payload buffers as it does + * to fetch a single, contiguous TX frame (2 reads vs. 1 read). For + * these controllers, coalescing buffers to reduce the number of memory + * reads is effective way to get maximum performance(about 940Mbps). + * Without collapsing TX buffers the maximum TCP bulk transfer + * performance is about 850Mbps. However forcing coalescing mbufs + * consumes a lot of CPU cycles, so leave it off by default. + */ + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse", + CTLFLAG_RW, &sc->bge_forced_collapse, 0, + "Number of fragmented TX buffers of a frame allowed before " + "forced collapsing"); + resource_int_value(device_get_name(sc->bge_dev), + device_get_unit(sc->bge_dev), "forced_collapse", + &sc->bge_forced_collapse); + if (BGE_IS_5705_PLUS(sc)) return; Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Tue Dec 8 15:29:12 2009 (r200263) +++ head/sys/dev/bge/if_bgereg.h Tue Dec 8 17:54:23 2009 (r200264) @@ -2647,6 +2647,7 @@ struct bge_softc { int bge_link; /* link state */ int bge_link_evt; /* pending link event */ int bge_timer; + int bge_forced_collapse; struct callout bge_stat_ch; uint32_t bge_rx_discards; uint32_t bge_tx_discards; From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 18:23:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F0F106566B; Tue, 8 Dec 2009 18:23:51 +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 67D398FC0A; Tue, 8 Dec 2009 18:23: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 nB8INpc1095768; Tue, 8 Dec 2009 18:23:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8INppk095763; Tue, 8 Dec 2009 18:23:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912081823.nB8INppk095763@svn.freebsd.org> From: Xin LI Date: Tue, 8 Dec 2009 18:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200265 - in stable/8: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 18:23:51 -0000 Author: delphij Date: Tue Dec 8 18:23:51 2009 New Revision: 200265 URL: http://svn.freebsd.org/changeset/base/200265 Log: MFC revisions 196550 and 196552: Add a new rc.d script, static_arp, which enables the administrator to statically bind IPv4 <-> MAC address at boot time. In order to use this, the administrator needs to configure the following rc.conf(5) variable: - static_arp_pairs: A list of names for static bind pairs, and, - a series of static_arp_(name): the arguments that is being passed to ``arp -S'' operation. Example: static_arp_pairs="gw" static_arp_gw="192.168.1.1 00:01:02:03:04:05" See the rc.conf(5) manual page for more details. Added: stable/8/etc/rc.d/static_arp - copied, changed from r196550, head/etc/rc.d/static_arp Modified: stable/8/etc/defaults/rc.conf stable/8/etc/rc.d/Makefile stable/8/share/man/man5/rc.conf.5 Directory Properties: stable/8/etc/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Tue Dec 8 17:54:23 2009 (r200264) +++ stable/8/etc/defaults/rc.conf Tue Dec 8 18:23:51 2009 (r200265) @@ -358,6 +358,7 @@ bsnmpd_flags="" # Flags for bsnmpd. ### Network routing options: ### defaultrouter="NO" # Set to default gateway (or NO). +static_arp_pairs="" # Set to static ARP list (or leave empty). static_routes="" # Set to static route list (or leave empty). natm_static_routes="" # Set to static route list for NATM (or leave empty). gateway_enable="NO" # Set to YES if this host will be a gateway. Modified: stable/8/etc/rc.d/Makefile ============================================================================== --- stable/8/etc/rc.d/Makefile Tue Dec 8 17:54:23 2009 (r200264) +++ stable/8/etc/rc.d/Makefile Tue Dec 8 18:23:51 2009 (r200265) @@ -32,7 +32,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI random rarpd resolv rfcomm_pppd_server root \ route6d routed routing rpcbind rtadvd rwho \ savecore sdpd securelevel sendmail \ - serial sppp statd swap1 \ + serial sppp statd static_arp swap1 \ syscons sysctl syslogd \ timed tmp \ ugidfw \ Copied and modified: stable/8/etc/rc.d/static_arp (from r196550, head/etc/rc.d/static_arp) ============================================================================== --- head/etc/rc.d/static_arp Tue Aug 25 19:07:26 2009 (r196550, copy source) +++ stable/8/etc/rc.d/static_arp Tue Dec 8 18:23:51 2009 (r200265) @@ -41,10 +41,11 @@ stop_cmd="static_arp_stop" static_arp_start() { + local e arp_args + if [ -n "${static_arp_pairs}" ]; then echo -n 'Binding static ARP pair(s):' for e in ${static_arp_pairs}; do - local arp_args echo -n " ${e}" eval arp_args=\$static_arp_${e} arp -S ${arp_args} >/dev/null 2>&1 @@ -55,10 +56,11 @@ static_arp_start() static_arp_stop() { + local e arp_args + if [ -n "${static_arp_pairs}" ]; then echo -n 'Unbinding static ARP pair(s):' for e in ${static_arp_pairs}; do - local arp_args echo -n " ${e}" eval arp_args=\$static_arp_${e} arp -d ${arp_args%%[ ]*} > /dev/null 2>&1 Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Tue Dec 8 17:54:23 2009 (r200264) +++ stable/8/share/man/man5/rc.conf.5 Tue Dec 8 18:23:51 2009 (r200265) @@ -2237,6 +2237,22 @@ name server!). .Pq Vt str The IPv6 equivalent of .Va defaultrouter . +.It Va static_arp_pairs +.Pq Vt str +Set to the list of static ARP pairs that are to be added at system +boot time. +For each whitespace separated +.Ar element +in the value, a +.Va static_arp_ Ns Aq Ar element +variable is assumed to exist whose contents will later be passed to a +.Dq Nm arp Cm -S +operation. +For example +.Bd -literal +static_arp_pairs="gw" +static_arp_gw="192.168.1.1 00:01:02:03:04:05" +.Ed .It Va static_routes .Pq Vt str Set to the list of static routes that are to be added at system From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 18:23:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF9A1065672; Tue, 8 Dec 2009 18:23:52 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD1EA8FC12; Tue, 8 Dec 2009 18:23: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 nB8INq82095801; Tue, 8 Dec 2009 18:23:52 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8INqrT095799; Tue, 8 Dec 2009 18:23:52 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912081823.nB8INqrT095799@svn.freebsd.org> From: Fabien Thomas Date: Tue, 8 Dec 2009 18:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200266 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 18:23:53 -0000 Author: fabient Date: Tue Dec 8 18:23:52 2009 New Revision: 200266 URL: http://svn.freebsd.org/changeset/base/200266 Log: MFC 198464: Inform hwpmc(4) of a thread's impending demise prior to invoking sched_throw(). Modified: stable/8/sys/kern/kern_thread.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_thread.c ============================================================================== --- stable/8/sys/kern/kern_thread.c Tue Dec 8 18:23:51 2009 (r200265) +++ stable/8/sys/kern/kern_thread.c Tue Dec 8 18:23:52 2009 (r200266) @@ -27,6 +27,7 @@ */ #include "opt_witness.h" +#include "opt_hwpmc_hooks.h" #include __FBSDID("$FreeBSD$"); @@ -47,6 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include @@ -417,6 +421,14 @@ thread_exit(void) panic ("thread_exit: Last thread exiting on its own"); } } +#ifdef HWPMC_HOOKS + /* + * If this thread is part of a process that is being tracked by hwpmc(4), + * inform the module of the thread's impending exit. + */ + if (PMC_PROC_IS_USING_PMCS(td->td_proc)) + PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); +#endif PROC_UNLOCK(p); thread_lock(td); /* Save our tick information with both the thread and proc locked */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 18:35:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 464D3106566B; Tue, 8 Dec 2009 18:35:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 345988FC1B; Tue, 8 Dec 2009 18:35: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 nB8IZwGu096130; Tue, 8 Dec 2009 18:35:58 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8IZwRE096125; Tue, 8 Dec 2009 18:35:58 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912081835.nB8IZwRE096125@svn.freebsd.org> From: Xin LI Date: Tue, 8 Dec 2009 18:35:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200267 - in stable/7: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 18:35:58 -0000 Author: delphij Date: Tue Dec 8 18:35:57 2009 New Revision: 200267 URL: http://svn.freebsd.org/changeset/base/200267 Log: MFC revisions 196550 and 196552: Add a new rc.d script, static_arp, which enables the administrator to statically bind IPv4 <-> MAC address at boot time. In order to use this, the administrator needs to configure the following rc.conf(5) variable: - static_arp_pairs: A list of names for static bind pairs, and, - a series of static_arp_(name): the arguments that is being passed to ``arp -S'' operation. Example: static_arp_pairs="gw" static_arp_gw="192.168.1.1 00:01:02:03:04:05" See the rc.conf(5) manual page for more details. Added: stable/7/etc/rc.d/static_arp - copied, changed from r196550, head/etc/rc.d/static_arp Modified: stable/7/etc/defaults/rc.conf stable/7/etc/rc.d/Makefile stable/7/share/man/man5/rc.conf.5 (contents, props changed) Directory Properties: stable/7/etc/ (props changed) stable/7/share/man/man5/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Tue Dec 8 18:23:52 2009 (r200266) +++ stable/7/etc/defaults/rc.conf Tue Dec 8 18:35:57 2009 (r200267) @@ -344,6 +344,7 @@ bsnmpd_flags="" # Flags for bsnmpd. ### Network routing options: ### defaultrouter="NO" # Set to default gateway (or NO). +static_arp_pairs="" # Set to static ARP list (or leave empty). static_routes="" # Set to static route list (or leave empty). natm_static_routes="" # Set to static route list for NATM (or leave empty). gateway_enable="NO" # Set to YES if this host will be a gateway. Modified: stable/7/etc/rc.d/Makefile ============================================================================== --- stable/7/etc/rc.d/Makefile Tue Dec 8 18:23:52 2009 (r200266) +++ stable/7/etc/rc.d/Makefile Tue Dec 8 18:35:57 2009 (r200267) @@ -32,7 +32,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI random rarpd resolv rfcomm_pppd_server root \ route6d routed routing rpcbind rtadvd rwho \ savecore sdpd securelevel sendmail \ - serial sppp statd swap1 \ + serial sppp statd static_arp swap1 \ syscons sysctl syslogd \ timed tmp \ ugidfw \ Copied and modified: stable/7/etc/rc.d/static_arp (from r196550, head/etc/rc.d/static_arp) ============================================================================== --- head/etc/rc.d/static_arp Tue Aug 25 19:07:26 2009 (r196550, copy source) +++ stable/7/etc/rc.d/static_arp Tue Dec 8 18:35:57 2009 (r200267) @@ -41,10 +41,11 @@ stop_cmd="static_arp_stop" static_arp_start() { + local e arp_args + if [ -n "${static_arp_pairs}" ]; then echo -n 'Binding static ARP pair(s):' for e in ${static_arp_pairs}; do - local arp_args echo -n " ${e}" eval arp_args=\$static_arp_${e} arp -S ${arp_args} >/dev/null 2>&1 @@ -55,10 +56,11 @@ static_arp_start() static_arp_stop() { + local e arp_args + if [ -n "${static_arp_pairs}" ]; then echo -n 'Unbinding static ARP pair(s):' for e in ${static_arp_pairs}; do - local arp_args echo -n " ${e}" eval arp_args=\$static_arp_${e} arp -d ${arp_args%%[ ]*} > /dev/null 2>&1 Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Tue Dec 8 18:23:52 2009 (r200266) +++ stable/7/share/man/man5/rc.conf.5 Tue Dec 8 18:35:57 2009 (r200267) @@ -2193,6 +2193,22 @@ name server!). .Pq Vt str The IPv6 equivalent of .Va defaultrouter . +.It Va static_arp_pairs +.Pq Vt str +Set to the list of static ARP pairs that are to be added at system +boot time. +For each whitespace separated +.Ar element +in the value, a +.Va static_arp_ Ns Aq Ar element +variable is assumed to exist whose contents will later be passed to a +.Dq Nm arp Cm -S +operation. +For example +.Bd -literal +static_arp_pairs="gw" +static_arp_gw="192.168.1.1 00:01:02:03:04:05" +.Ed .It Va static_routes .Pq Vt str Set to the list of static routes that are to be added at system From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 18:54:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8312810656C4; Tue, 8 Dec 2009 18:54:37 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72C2B8FC18; Tue, 8 Dec 2009 18:54: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 nB8IsbuR096594; Tue, 8 Dec 2009 18:54:37 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8IsbrP096592; Tue, 8 Dec 2009 18:54:37 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <200912081854.nB8IsbrP096592@svn.freebsd.org> From: Jack F Vogel Date: Tue, 8 Dec 2009 18:54: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: r200268 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 18:54:37 -0000 Author: jfv Date: Tue Dec 8 18:54:37 2009 New Revision: 200268 URL: http://svn.freebsd.org/changeset/base/200268 Log: Remove phantom line of code that somehow slipped into the checkin. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Dec 8 18:35:57 2009 (r200267) +++ head/sys/dev/e1000/if_igb.c Tue Dec 8 18:54:37 2009 (r200268) @@ -4231,7 +4231,6 @@ igb_rxeof(struct rx_ring *rxr, int count /* Get the RSS Hash */ sendmp->m_pkthdr.flowid = le32toh(cur->wb.lower.hi_dword.rss); - curcpu; sendmp->m_flags |= M_FLOWID; #endif } From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 19:01:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8562A10656A6; Tue, 8 Dec 2009 19:01:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 741C58FC2A; Tue, 8 Dec 2009 19:01: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 nB8J15Xp096983; Tue, 8 Dec 2009 19:01:05 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8J15Y5096981; Tue, 8 Dec 2009 19:01:05 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912081901.nB8J15Y5096981@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 8 Dec 2009 19:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200269 - stable/7/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 19:01:05 -0000 Author: jilles Date: Tue Dec 8 19:01:05 2009 New Revision: 200269 URL: http://svn.freebsd.org/changeset/base/200269 Log: MFC r198963: sh: Fix memory leak when using a variable in arithmetic like $((x)). Modified: stable/7/bin/sh/arith_lex.l Directory Properties: stable/7/bin/sh/ (props changed) Modified: stable/7/bin/sh/arith_lex.l ============================================================================== --- stable/7/bin/sh/arith_lex.l Tue Dec 8 18:54:37 2009 (r200268) +++ stable/7/bin/sh/arith_lex.l Tue Dec 8 19:01:05 2009 (r200269) @@ -51,6 +51,13 @@ __FBSDID("$FreeBSD$"); int yylex(void); +struct varname +{ + struct varname *next; + char name[1]; +}; +static struct varname *varnames; + #undef YY_INPUT #define YY_INPUT(buf,result,max) \ result = (*buf = *arith_buf++) ? 1 : YY_NULL; @@ -80,11 +87,14 @@ int yylex(void); * If variable doesn't exist, we should initialize * it to zero. */ - char *temp; + struct varname *temp; if (lookupvar(yytext) == NULL) setvarsafe(yytext, "0", 0); - temp = (char *)ckmalloc(strlen(yytext) + 1); - yylval.s_value = strcpy(temp, yytext); + temp = ckmalloc(sizeof(struct varname) + + strlen(yytext)); + temp->next = varnames; + varnames = temp; + yylval.s_value = strcpy(temp->name, yytext); return ARITH_VAR; } @@ -130,5 +140,15 @@ int yylex(void); void arith_lex_reset(void) { + struct varname *name, *next; + YY_NEW_FILE; + + name = varnames; + while (name != NULL) { + next = name->next; + ckfree(name); + name = next; + } + varnames = NULL; } From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 19:12:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90852106566C; Tue, 8 Dec 2009 19:12:38 +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 7FDD58FC13; Tue, 8 Dec 2009 19:12:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8JCcsB097289; Tue, 8 Dec 2009 19:12:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8JCcdN097287; Tue, 8 Dec 2009 19:12:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912081912.nB8JCcdN097287@svn.freebsd.org> From: Xin LI Date: Tue, 8 Dec 2009 19:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200270 - head/contrib/netcat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 19:12:38 -0000 Author: delphij Date: Tue Dec 8 19:12:38 2009 New Revision: 200270 URL: http://svn.freebsd.org/changeset/base/200270 Log: What we have in base system is actually OpenBSD 4.5's netcat, update this file to reflect the fact. Modified: head/contrib/netcat/FREEBSD-vendor Modified: head/contrib/netcat/FREEBSD-vendor ============================================================================== --- head/contrib/netcat/FREEBSD-vendor Tue Dec 8 19:01:05 2009 (r200269) +++ head/contrib/netcat/FREEBSD-vendor Tue Dec 8 19:12:38 2009 (r200270) @@ -1,5 +1,5 @@ # $FreeBSD$ Project: netcat (aka src/usr.bin/nc in OpenBSD) ProjectURL: http://www.openbsd.org/ -Version: 4.4 +Version: 4.5 License: BSD From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 19:18:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87AC810656A6; Tue, 8 Dec 2009 19:18:32 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7639C8FC12; Tue, 8 Dec 2009 19:18:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8JIWRT097455; Tue, 8 Dec 2009 19:18:32 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8JIWv9097453; Tue, 8 Dec 2009 19:18:32 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912081918.nB8JIWv9097453@svn.freebsd.org> From: Fabien Thomas Date: Tue, 8 Dec 2009 19:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200271 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 19:18:32 -0000 Author: fabient Date: Tue Dec 8 19:18:32 2009 New Revision: 200271 URL: http://svn.freebsd.org/changeset/base/200271 Log: MFC 198464: Inform hwpmc(4) of a thread's impending demise prior to invoking sched_throw(). Modified: stable/7/sys/kern/kern_thread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_thread.c ============================================================================== --- stable/7/sys/kern/kern_thread.c Tue Dec 8 19:12:38 2009 (r200270) +++ stable/7/sys/kern/kern_thread.c Tue Dec 8 19:18:32 2009 (r200271) @@ -26,6 +26,8 @@ * DAMAGE. */ +#include "opt_hwpmc_hooks.h" + #include __FBSDID("$FreeBSD$"); @@ -44,6 +46,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef HWPMC_HOOKS +#include +#endif #include @@ -497,6 +502,14 @@ thread_exit(void) panic ("thread_exit: Last thread exiting on its own"); } } +#ifdef HWPMC_HOOKS + /* + * If this thread is part of a process that is being tracked by hwpmc(4), + * inform the module of the thread's impending exit. + */ + if (PMC_PROC_IS_USING_PMCS(td->td_proc)) + PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); +#endif PROC_UNLOCK(p); thread_lock(td); /* Save our tick information with both the thread and proc locked */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 20:18:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6AF8106566B; Tue, 8 Dec 2009 20:18:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBD1A8FC1D; Tue, 8 Dec 2009 20:18:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8KIsZ2098723; Tue, 8 Dec 2009 20:18:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8KIseI098720; Tue, 8 Dec 2009 20:18:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912082018.nB8KIseI098720@svn.freebsd.org> From: Marius Strobl Date: Tue, 8 Dec 2009 20:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200272 - in head/sys: sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 20:18:55 -0000 Author: marius Date: Tue Dec 8 20:18:54 2009 New Revision: 200272 URL: http://svn.freebsd.org/changeset/base/200272 Log: Add additional checks of the kernel stack addresses in order to ensure we don't overrun the end of the call chain. MFC after: 1 week Modified: head/sys/sparc64/sparc64/stack_machdep.c head/sys/sun4v/sun4v/stack_machdep.c Modified: head/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/stack_machdep.c Tue Dec 8 19:18:32 2009 (r200271) +++ head/sys/sparc64/sparc64/stack_machdep.c Tue Dec 8 20:18:54 2009 (r200272) @@ -36,15 +36,20 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; @@ -56,6 +61,9 @@ stack_capture(struct stack *st, struct f break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } Modified: head/sys/sun4v/sun4v/stack_machdep.c ============================================================================== --- head/sys/sun4v/sun4v/stack_machdep.c Tue Dec 8 19:18:32 2009 (r200271) +++ head/sys/sun4v/sun4v/stack_machdep.c Tue Dec 8 20:18:54 2009 (r200272) @@ -36,20 +36,28 @@ __FBSDID("$FreeBSD$"); #include #include -static void stack_capture(struct stack *st, struct frame *fp); +static void stack_capture(struct stack *st, struct frame *frame); static void -stack_capture(struct stack *st, struct frame *fp) +stack_capture(struct stack *st, struct frame *frame) { + struct frame *fp; vm_offset_t callpc; stack_zero(st); - while (1) { + fp = frame; + for (;;) { + if (!INKERNEL((vm_offset_t)fp) || + !ALIGNED_POINTER(fp, uint64_t)) + break; callpc = fp->fr_pc; if (!INKERNEL(callpc)) break; if (stack_put(st, callpc) == -1) break; + if (v9next_frame(fp) <= fp || + v9next_frame(fp) >= frame + KSTACK_PAGES * PAGE_SIZE) + break; fp = v9next_frame(fp); } } From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 20:32:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CB951065676 for ; Tue, 8 Dec 2009 20:32:46 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from yergi.telenet-ops.be (yergi.telenet-ops.be [195.130.132.36]) by mx1.freebsd.org (Postfix) with ESMTP id 5A1358FC14 for ; Tue, 8 Dec 2009 20:32:46 +0000 (UTC) Received: from brigitte.telenet-ops.be (unknown [195.130.137.66]) by yergi.telenet-ops.be (Postfix) with ESMTP id 735AAD022B for ; Tue, 8 Dec 2009 21:21:11 +0100 (CET) Received: from triton.sigsegv.be ([213.119.65.102]) by brigitte.telenet-ops.be with bizsmtp id EkM91d0092CNSFp0GkM9pp; Tue, 08 Dec 2009 21:21:09 +0100 Received: from nereid (nereid.neptune.sigsegv.be [IPv6:2001:470:c8f4:0:200:ff:fe00:8]) by triton.sigsegv.be (Postfix) with SMTP id 54C811C1E3; Tue, 8 Dec 2009 22:21:54 +0100 (CET) Received: by nereid (sSMTP sendmail emulation); Tue, 08 Dec 2009 21:21:04 +0100 Date: Tue, 8 Dec 2009 21:21:03 +0100 From: Kristof Provost To: Alexander Motin Message-ID: <20091208202103.GN2753@nereid> References: <200912060010.nB60AD12004058@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912060010.nB60AD12004058@svn.freebsd.org> X-PGP-Fingerprint: 6B6E 5EED 8ECF FAE7 1F61 7458 5046 7D0E 11B0 0EE8 User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200171 - in head: sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 20:32:46 -0000 On 2009-12-06 00:10:13 (+0000), Alexander Motin wrote: > Author: mav > Date: Sun Dec 6 00:10:13 2009 > New Revision: 200171 > URL: http://svn.freebsd.org/changeset/base/200171 I think this commit broke the build for mv_sata. sys/arm/mv/mv_sata.c currently reads: @@ -751,10 +751,10 @@ static int sata_channel_setmode(device_t parent, int target, int mode) { /* Disable EDMA before using legacy registers */ sata_edma_ctrl(parent, 0); return (ata_sata_setmode(dev, mode)); } This doesn't build because 'dev' isn't defined. As far as I can tell the following patch matches what was intended, but I have no idea if it's correct. It does at least build: Index: sys/arm/mv/mv_sata.c =================================================================== --- sys/arm/mv/mv_sata.c (revision 200245) +++ sys/arm/mv/mv_sata.c (working copy) @@ -751,10 +751,10 @@ static int sata_channel_setmode(device_t parent, int target, int mode) { /* Disable EDMA before using legacy registers */ sata_edma_ctrl(parent, 0); - return (ata_sata_setmode(dev, mode)); + return (min(mode, ATA_UDMA5)); } Regards, Kristof From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 20:46:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B88E1106566B; Tue, 8 Dec 2009 20:46:50 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id E1E388FC15; Tue, 8 Dec 2009 20:46:49 +0000 (UTC) Received: by bwz5 with SMTP id 5so4755903bwz.3 for ; Tue, 08 Dec 2009 12:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=kw6ZBaD9ksWUF2jlDsXfjxAjcQ85tgdGCmj9oHPCsuc=; b=xVMcKd4FQQP3FIcZTMzCb1tWHoUU/eZFA2FRVuyFyD+tEXWsVamzjWPw0dkW6IS75Z CdVqMBDzv9nXGcrZkKLDAPOF6OwJfqS3N1O85MrY+qp2j7Fz6AuLE+YZ6+8JjJWzxQPI MyQR9yYMLoG4ACyyB/6UasyLaAxyxdM0YYhAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=eUpTwkWCc1/q25qfABX6SuXuHiSSZK1O2GFJRRhFquDcw/NuG1k1c/vv2e7Puu+QYT gXmRrYnoZjHpfqi8Hp/w93Oky8A3+nxthsQXVmtd3cm38Sf6YDi9ADjLAn7+kcnQPps2 F+BXuFJaagISX0hhXgtsgVU8hU8hEF9EP6eyw= Received: by 10.204.3.152 with SMTP id 24mr1300737bkn.168.1260305208521; Tue, 08 Dec 2009 12:46:48 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 15sm2476318fxm.6.2009.12.08.12.46.47 (version=SSLv3 cipher=RC4-MD5); Tue, 08 Dec 2009 12:46:47 -0800 (PST) Sender: Alexander Motin Message-ID: <4B1EBB35.2030906@FreeBSD.org> Date: Tue, 08 Dec 2009 22:46:45 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: Kristof Provost References: <200912060010.nB60AD12004058@svn.freebsd.org> <20091208202103.GN2753@nereid> In-Reply-To: <20091208202103.GN2753@nereid> X-Enigmail-Version: 0.96.0 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: r200171 - in head: sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 20:46:50 -0000 Kristof Provost wrote: > This doesn't build because 'dev' isn't defined. As far as I can tell the > following patch matches what was intended, but I have no idea if it's > correct. It does at least build: Oops! Missed it. Please test this one: http://people.freebsd.org/~mav/mv_sata.c.patch -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 20:47:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8ACE1065672; Tue, 8 Dec 2009 20:47:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B77518FC0C; Tue, 8 Dec 2009 20:47: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 nB8KlArT099368; Tue, 8 Dec 2009 20:47:10 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8KlASO099365; Tue, 8 Dec 2009 20:47:10 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200912082047.nB8KlASO099365@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 8 Dec 2009 20:47: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: r200273 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 20:47:10 -0000 Author: trasz Date: Tue Dec 8 20:47:10 2009 New Revision: 200273 URL: http://svn.freebsd.org/changeset/base/200273 Log: Don't add VAPPEND if the file is not being opened for writing. Note that this only affects cases where open(2) is being used improperly - i.e. when the user specifies O_APPEND without O_WRONLY or O_RDWR. Reviewed by: rwatson Modified: head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Dec 8 20:18:54 2009 (r200272) +++ head/sys/kern/vfs_syscalls.c Tue Dec 8 20:47:10 2009 (r200273) @@ -4426,7 +4426,7 @@ fhopen(td, uap) } if (fmode & FREAD) accmode |= VREAD; - if (fmode & O_APPEND) + if ((fmode & O_APPEND) && (fmode & FWRITE)) accmode |= VAPPEND; #ifdef MAC error = mac_vnode_check_open(td->td_ucred, vp, accmode); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Tue Dec 8 20:18:54 2009 (r200272) +++ head/sys/kern/vfs_vnops.c Tue Dec 8 20:47:10 2009 (r200273) @@ -212,7 +212,7 @@ restart: accmode |= VREAD; if (fmode & FEXEC) accmode |= VEXEC; - if (fmode & O_APPEND) + if ((fmode & O_APPEND) && (fmode & FWRITE)) accmode |= VAPPEND; #ifdef MAC error = mac_vnode_check_open(cred, vp, accmode); From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 20:48:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CED46106568F; Tue, 8 Dec 2009 20:48:06 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDAB58FC18; Tue, 8 Dec 2009 20:48: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 nB8Km6xp099422; Tue, 8 Dec 2009 20:48:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Km6aP099420; Tue, 8 Dec 2009 20:48:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912082048.nB8Km6aP099420@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 8 Dec 2009 20:48: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: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 20:48:06 -0000 Author: jilles Date: Tue Dec 8 20:48:06 2009 New Revision: 200274 URL: http://svn.freebsd.org/changeset/base/200274 Log: sem_init(3): document process shared semaphores and their restrictions Modified: head/lib/libc/gen/sem_init.3 Modified: head/lib/libc/gen/sem_init.3 ============================================================================== --- head/lib/libc/gen/sem_init.3 Tue Dec 8 20:47:10 2009 (r200273) +++ head/lib/libc/gen/sem_init.3 Tue Dec 8 20:48:06 2009 (r200274) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2000 +.Dd December 8, 2009 .Dt SEM_INIT 3 .Os .Sh NAME @@ -48,8 +48,7 @@ to have the value .Fa value . A non-zero value for .Fa pshared -specifies a shared semaphore that can be used by multiple processes, which this -implementation is not capable of. +specifies a shared semaphore that can be used by multiple processes. .Pp Following a successful call to .Fn sem_init , @@ -78,8 +77,6 @@ argument exceeds .Dv SEM_VALUE_MAX . .It Bq Er ENOSPC Memory allocation error. -.It Bq Er EPERM -Unable to initialize a shared semaphore. .El .Sh SEE ALSO .Xr sem_destroy 3 , @@ -93,16 +90,10 @@ The .Fn sem_init function conforms to .St -p1003.1-96 . -.Pp -This implementation does not support shared semaphores, and reports this fact -by setting -.Va errno -to -.Er EPERM . -This is perhaps a stretch of the intention of -.Tn POSIX , -but is -compliant, with the caveat that -.Fn sem_init -always reports a permissions error when an attempt to create a shared semaphore -is made. +.Sh BUGS +A sem_t is a pointer to a separately allocated structure, +therefore process shared semaphores only work between related processes +and do not perform very well +(each operation is a system call, +while single-process semaphores only do a system call +if they need to block or wake up a thread). From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 20:53:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2807A10656D4 for ; Tue, 8 Dec 2009 20:53:50 +0000 (UTC) (envelope-from kristof@sigsegv.be) Received: from brigitte.telenet-ops.be (brigitte.telenet-ops.be [195.130.137.66]) by mx1.freebsd.org (Postfix) with ESMTP id 863518FC24 for ; Tue, 8 Dec 2009 20:53:49 +0000 (UTC) Received: from triton.sigsegv.be ([213.119.65.102]) by brigitte.telenet-ops.be with bizsmtp id Ekto1d0062CNSFp0GktoND; Tue, 08 Dec 2009 21:53:48 +0100 Received: from nereid (nereid.neptune.sigsegv.be [IPv6:2001:470:c8f4:0:200:ff:fe00:8]) by triton.sigsegv.be (Postfix) with SMTP id 837F11C1E3; Tue, 8 Dec 2009 22:54:33 +0100 (CET) Received: by nereid (sSMTP sendmail emulation); Tue, 08 Dec 2009 21:53:47 +0100 Date: Tue, 8 Dec 2009 21:53:46 +0100 From: Kristof Provost To: Alexander Motin Message-ID: <20091208205346.GO2753@nereid> References: <200912060010.nB60AD12004058@svn.freebsd.org> <20091208202103.GN2753@nereid> <4B1EBB35.2030906@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B1EBB35.2030906@FreeBSD.org> X-PGP-Fingerprint: 6B6E 5EED 8ECF FAE7 1F61 7458 5046 7D0E 11B0 0EE8 User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200171 - in head: sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 20:53:50 -0000 On 2009-12-08 22:46:45 (+0200), Alexander Motin wrote: > Kristof Provost wrote: > > This doesn't build because 'dev' isn't defined. As far as I can tell the > > following patch matches what was intended, but I have no idea if it's > > correct. It does at least build: > > Oops! Missed it. Please test this one: > http://people.freebsd.org/~mav/mv_sata.c.patch > That builds and boots up to bootpc_init. (I'm still trying to get the device to boot, so that's as far as I expected it to get.) In other words: as far as I can tell that's ok, but I can't test it with an actual disk yet. Regards, Kristof From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 21:42:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D06D1065700; Tue, 8 Dec 2009 21:42:05 +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 EFC788FC19; Tue, 8 Dec 2009 21:42:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8Lg4Es000845; Tue, 8 Dec 2009 21:42:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Lg4A5000843; Tue, 8 Dec 2009 21:42:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912082142.nB8Lg4A5000843@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Dec 2009 21:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200275 - head/sys/arm/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 21:42:05 -0000 Author: mav Date: Tue Dec 8 21:42:04 2009 New Revision: 200275 URL: http://svn.freebsd.org/changeset/base/200275 Log: Fix the build. Modified: head/sys/arm/mv/mv_sata.c Modified: head/sys/arm/mv/mv_sata.c ============================================================================== --- head/sys/arm/mv/mv_sata.c Tue Dec 8 20:48:06 2009 (r200274) +++ head/sys/arm/mv/mv_sata.c Tue Dec 8 21:42:04 2009 (r200275) @@ -137,6 +137,7 @@ static int sata_channel_begin_transactio static int sata_channel_end_transaction(struct ata_request *request); static int sata_channel_status(device_t dev); static int sata_channel_setmode(device_t dev, int target, int mode); +static int sata_channel_getrev(device_t dev, int target); static void sata_channel_reset(device_t dev); static void sata_channel_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); @@ -423,7 +424,7 @@ sata_channel_attach(device_t dev) ch->dev = dev; ch->unit = device_get_unit(dev); - ch->flags |= ATA_USE_16BIT | ATA_NO_SLAVE; + ch->flags |= ATA_USE_16BIT | ATA_NO_SLAVE | ATA_SATA; /* Set legacy ATA resources. */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { @@ -754,7 +755,16 @@ sata_channel_setmode(device_t parent, in /* Disable EDMA before using legacy registers */ sata_edma_ctrl(parent, 0); - return (ata_sata_setmode(dev, mode)); + return (ata_sata_setmode(parent, target, mode)); +} + +static int +sata_channel_getrev(device_t parent, int target) +{ + + /* Disable EDMA before using legacy registers */ + sata_edma_ctrl(parent, 0); + return (ata_sata_getrev(parent, target)); } static void @@ -843,6 +853,7 @@ static device_method_t sata_channel_meth /* ATA channel interface */ DEVMETHOD(ata_reset, sata_channel_reset), DEVMETHOD(ata_setmode, sata_channel_setmode), + DEVMETHOD(ata_getrev, sata_channel_getrev), { 0, 0 } }; From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 21:45:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 676A81065695; Tue, 8 Dec 2009 21:45:57 +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 3B7AB8FC13; Tue, 8 Dec 2009 21:45:57 +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 AE44346B45; Tue, 8 Dec 2009 16:45:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 1298B8A01F; Tue, 8 Dec 2009 16:45:56 -0500 (EST) From: John Baldwin To: Jilles Tjoelker Date: Tue, 8 Dec 2009 16:45:37 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912082048.nB8Km6aP099420@svn.freebsd.org> In-Reply-To: <200912082048.nB8Km6aP099420@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <200912081645.37356.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 08 Dec 2009 16:45:56 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no 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: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 21:45:57 -0000 On Tuesday 08 December 2009 3:48:06 pm Jilles Tjoelker wrote: > Author: jilles > Date: Tue Dec 8 20:48:06 2009 > New Revision: 200274 > URL: http://svn.freebsd.org/changeset/base/200274 > > Log: > sem_init(3): document process shared semaphores and their restrictions I think the other language was more accurate. The new language has far less detail such as no longer documenting EPERM. I think it is also quite accurate to say that the current implementation is not capable of process shared semaphores. Several things would need to be changed including moving away from using file descriptors. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 21:46:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 566CF106568B; Tue, 8 Dec 2009 21:46:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447F88FC21; Tue, 8 Dec 2009 21:46: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 nB8LkU7j001000; Tue, 8 Dec 2009 21:46:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8LkU4C000998; Tue, 8 Dec 2009 21:46:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912082146.nB8LkU4C000998@svn.freebsd.org> From: Xin LI Date: Tue, 8 Dec 2009 21:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200276 - stable/7/sys/geom/virstor X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 21:46:30 -0000 Author: delphij Date: Tue Dec 8 21:46:30 2009 New Revision: 200276 URL: http://svn.freebsd.org/changeset/base/200276 Log: MFC r180120: Avoid NULL deference. Modified: stable/7/sys/geom/virstor/g_virstor.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/7/sys/geom/virstor/g_virstor.c Tue Dec 8 21:42:04 2009 (r200275) +++ stable/7/sys/geom/virstor/g_virstor.c Tue Dec 8 21:46:30 2009 (r200276) @@ -225,6 +225,11 @@ virstor_ctl_stop(struct gctl_req *req, s sprintf(param, "arg%d", i); name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%d' argument", i); + g_topology_unlock(); + return; + } sc = virstor_find_geom(cp, name); LOG_MSG(LVL_INFO, "Stopping %s by the userland command", sc->geom->name); From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:10:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1646F106568F; Tue, 8 Dec 2009 22:10:30 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id CE6C48FC1C; Tue, 8 Dec 2009 22:10:29 +0000 (UTC) Received: from toad.stack.nl (toad.stack.nl [IPv6:2001:610:1108:5010::135]) by mx1.stack.nl (Postfix) with ESMTP id D522C1DD635; Tue, 8 Dec 2009 23:10:28 +0100 (CET) Received: by toad.stack.nl (Postfix, from userid 1677) id CC52073FA4; Tue, 8 Dec 2009 23:10:28 +0100 (CET) Date: Tue, 8 Dec 2009 23:10:28 +0100 From: Jilles Tjoelker To: John Baldwin Message-ID: <20091208221028.GA57735@stack.nl> References: <200912082048.nB8Km6aP099420@svn.freebsd.org> <200912081645.37356.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912081645.37356.jhb@freebsd.org> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:10:30 -0000 On Tue, Dec 08, 2009 at 04:45:37PM -0500, John Baldwin wrote: > On Tuesday 08 December 2009 3:48:06 pm Jilles Tjoelker wrote: > > Author: jilles > > Date: Tue Dec 8 20:48:06 2009 > > New Revision: 200274 > > URL: http://svn.freebsd.org/changeset/base/200274 > > Log: > > sem_init(3): document process shared semaphores and their restrictions > I think the other language was more accurate. The new language has > far less detail such as no longer documenting EPERM. It seems that EPERM longer happens, at least not for any process-shared semaphore at all. What's missing is the SIGSYS/ENOSYS you'll get if sem.ko is not loaded, and you're requesting a process-shared semaphore or not linking with the threading library. > I think it is also quite accurate to say that the current > implementation is not capable of process shared semaphores. Several > things would need to be changed including moving away from using file > descriptors. There are some lines of code dedicated to make it work, and some people seem to use it, although they notice that it does not work very well. This topic has come up on the mailing lists several times recently. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:28:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 047821065670; Tue, 8 Dec 2009 22:28:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A04078FC1A; Tue, 8 Dec 2009 22:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8MStPa003142; Tue, 8 Dec 2009 22:28:55 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8MSt6Y003138; Tue, 8 Dec 2009 22:28:55 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200912082228.nB8MSt6Y003138@svn.freebsd.org> From: Rick Macklem Date: Tue, 8 Dec 2009 22:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200277 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:28:56 -0000 Author: rmacklem Date: Tue Dec 8 22:28:55 2009 New Revision: 200277 URL: http://svn.freebsd.org/changeset/base/200277 Log: MFC: r199616 Patch the experimental NFS server is a manner analagous to r197525, so that the creation verifier is handled correctly in va_atime for 64bit architectures. There were two problems. One was that the code incorrectly assumed that sizeof (struct timespec) == 8 and the other was that the tv_sec field needs to be assigned from a signed 32bit integer, so that sign extension occurs on 64bit architectures. This is required for correct operation when exporting ZFS volumes. Tested by: gerrit at pmp.uni-hannover.de Reviewed by: pjd Modified: stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Tue Dec 8 21:46:30 2009 (r200276) +++ stable/8/sys/fs/nfs/nfs_var.h Tue Dec 8 22:28:55 2009 (r200277) @@ -529,7 +529,7 @@ int nfsvno_read(vnode_t, off_t, int, str int nfsvno_write(vnode_t, off_t, int, int, int, mbuf_t, char *, struct ucred *, NFSPROC_T *); int nfsvno_createsub(struct nfsrv_descript *, struct nameidata *, - vnode_t *, struct nfsvattr *, int *, u_char *, NFSDEV_T, NFSPROC_T *, + vnode_t *, struct nfsvattr *, int *, int32_t *, NFSDEV_T, NFSPROC_T *, struct nfsexstuff *); int nfsvno_mknod(struct nameidata *, struct nfsvattr *, struct ucred *, NFSPROC_T *); @@ -552,7 +552,7 @@ int nfsvno_fsync(vnode_t, u_int64_t, int int nfsvno_statfs(vnode_t, struct statfs *); void nfsvno_getfs(struct nfsfsinfo *, int); void nfsvno_open(struct nfsrv_descript *, struct nameidata *, nfsquad_t, - nfsv4stateid_t *, struct nfsstate *, int *, struct nfsvattr *, u_char *, + nfsv4stateid_t *, struct nfsstate *, int *, struct nfsvattr *, int32_t *, int, NFSACL_T *, nfsattrbit_t *, struct ucred *, NFSPROC_T *, struct nfsexstuff *, vnode_t *); void nfsvno_updfilerev(vnode_t, struct nfsvattr *, struct ucred *, Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 8 21:46:30 2009 (r200276) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 8 22:28:55 2009 (r200277) @@ -720,7 +720,7 @@ nfsvno_write(struct vnode *vp, off_t off int nfsvno_createsub(struct nfsrv_descript *nd, struct nameidata *ndp, struct vnode **vpp, struct nfsvattr *nvap, int *exclusive_flagp, - u_char *cverf, NFSDEV_T rdev, struct thread *p, struct nfsexstuff *exp) + int32_t *cverf, NFSDEV_T rdev, struct thread *p, struct nfsexstuff *exp) { u_quad_t tempsize; int error; @@ -737,8 +737,8 @@ nfsvno_createsub(struct nfsrv_descript * if (*exclusive_flagp) { *exclusive_flagp = 0; NFSVNO_ATTRINIT(nvap); - NFSBCOPY(cverf,(caddr_t)&nvap->na_atime, - NFSX_VERF); + nvap->na_atime.tv_sec = cverf[0]; + nvap->na_atime.tv_nsec = cverf[1]; error = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, nd->nd_cred); } @@ -1285,7 +1285,7 @@ nfsvno_statfs(struct vnode *vp, struct s void nfsvno_open(struct nfsrv_descript *nd, struct nameidata *ndp, nfsquad_t clientid, nfsv4stateid_t *stateidp, struct nfsstate *stp, - int *exclusive_flagp, struct nfsvattr *nvap, u_char *cverf, int create, + int *exclusive_flagp, struct nfsvattr *nvap, int32_t *cverf, int create, NFSACL_T *aclp, nfsattrbit_t *attrbitp, struct ucred *cred, struct thread *p, struct nfsexstuff *exp, struct vnode **vpp) { @@ -1307,9 +1307,8 @@ nfsvno_open(struct nfsrv_descript *nd, s if (*exclusive_flagp) { *exclusive_flagp = 0; NFSVNO_ATTRINIT(nvap); - NFSBCOPY(cverf, - (caddr_t)&nvap->na_atime, - NFSX_VERF); + nvap->na_atime.tv_sec = cverf[0]; + nvap->na_atime.tv_nsec = cverf[1]; nd->nd_repstat = VOP_SETATTR(ndp->ni_vp, &nvap->na_vattr, cred); } else { Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Tue Dec 8 21:46:30 2009 (r200276) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Tue Dec 8 22:28:55 2009 (r200277) @@ -865,11 +865,11 @@ nfsrvd_create(struct nfsrv_descript *nd, int how = NFSCREATE_UNCHECKED, exclusive_flag = 0; NFSDEV_T rdev = 0; vnode_t vp = NULL, dirp = NULL; - u_char cverf[NFSX_VERF], *cp; fhandle_t fh; char *bufp; u_long *hashp; enum vtype vtyp; + int32_t cverf[2], tverf[2] = { 0, 0 }; if (nd->nd_repstat) { nfsrv_wcc(nd, dirfor_ret, &dirfor, diraft_ret, &diraft); @@ -920,8 +920,9 @@ nfsrvd_create(struct nfsrv_descript *nd, goto nfsmout; break; case NFSCREATE_EXCLUSIVE: - NFSM_DISSECT(cp, u_char *, NFSX_VERF); - NFSBCOPY(cp, cverf, NFSX_VERF); + NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); + cverf[0] = *tl++; + cverf[1] = *tl; exclusive_flag = 1; break; }; @@ -988,6 +989,10 @@ nfsrvd_create(struct nfsrv_descript *nd, nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); vput(vp); + if (!nd->nd_repstat) { + tverf[0] = nva.na_atime.tv_sec; + tverf[1] = nva.na_atime.tv_nsec; + } } if (nd->nd_flag & ND_NFSV2) { if (!nd->nd_repstat) { @@ -995,8 +1000,8 @@ nfsrvd_create(struct nfsrv_descript *nd, nfsrv_fillattr(nd, &nva); } } else { - if (exclusive_flag && !nd->nd_repstat && - NFSBCMP(cverf, (caddr_t)&nva.na_atime, NFSX_VERF)) + if (exclusive_flag && !nd->nd_repstat && (cverf[0] != tverf[0] + || cverf[1] != tverf[1])) nd->nd_repstat = EEXIST; diraft_ret = nfsvno_getattr(dirp, &diraft, nd->nd_cred, p); vrele(dirp); @@ -2406,7 +2411,7 @@ nfsrvd_open(struct nfsrv_descript *nd, _ int error = 0, create, claim, exclusive_flag = 0; u_int32_t rflags = NFSV4OPEN_LOCKTYPEPOSIX, acemask; int how = NFSCREATE_UNCHECKED; - u_char cverf[NFSX_VERF]; + int32_t cverf[2], tverf[2] = { 0, 0 }; vnode_t vp = NULL, dirp = NULL; struct nfsvattr nva, dirfor, diraft; struct nameidata named; @@ -2517,7 +2522,8 @@ nfsrvd_open(struct nfsrv_descript *nd, _ break; case NFSCREATE_EXCLUSIVE: NFSM_DISSECT(tl, u_int32_t *, NFSX_VERF); - NFSBCOPY((caddr_t)tl, cverf, NFSX_VERF); + cverf[0] = *tl++; + cverf[1] = *tl; break; default: nd->nd_repstat = NFSERR_BADXDR; @@ -2677,10 +2683,15 @@ nfsrvd_open(struct nfsrv_descript *nd, _ NFSACCCHK_VPISLOCKED); } - if (!nd->nd_repstat) + if (!nd->nd_repstat) { nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); - if (!nd->nd_repstat && exclusive_flag && - NFSBCMP(cverf, (caddr_t)&nva.na_atime, NFSX_VERF)) + if (!nd->nd_repstat) { + tverf[0] = nva.na_atime.tv_sec; + tverf[1] = nva.na_atime.tv_nsec; + } + } + if (!nd->nd_repstat && exclusive_flag && (cverf[0] != tverf[0] || + cverf[1] != tverf[1])) nd->nd_repstat = EEXIST; /* * Do the open locking/delegation stuff. From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:37:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31BB9106566C; Tue, 8 Dec 2009 22:37:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E0428FC0C; Tue, 8 Dec 2009 22:37: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 nB8Mb8bG003385; Tue, 8 Dec 2009 22:37:08 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Mb72q003377; Tue, 8 Dec 2009 22:37:07 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912082237.nB8Mb72q003377@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 8 Dec 2009 22:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200279 - in stable/7: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:37:08 -0000 Author: jilles Date: Tue Dec 8 22:37:07 2009 New Revision: 200279 URL: http://svn.freebsd.org/changeset/base/200279 Log: MFC r196483,r196634: sh: Fix crash when undefining or redefining a currently executing function Add a reference count to function definitions. Memory may leak if a SIGINT arrives in interactive mode at exactly the wrong time. PR: bin/137640 Added: stable/7/tools/regression/bin/sh/execution/ stable/7/tools/regression/bin/sh/execution/func1.0 - copied unchanged from r196483, head/tools/regression/bin/sh/execution/func1.0 stable/7/tools/regression/bin/sh/execution/func2.0 - copied unchanged from r196634, head/tools/regression/bin/sh/execution/func2.0 Modified: stable/7/bin/sh/eval.c stable/7/bin/sh/exec.c stable/7/bin/sh/exec.h stable/7/bin/sh/mknodes.c stable/7/bin/sh/nodes.c.pat Directory Properties: stable/7/bin/sh/ (props changed) stable/7/tools/regression/bin/sh/ (props changed) Modified: stable/7/bin/sh/eval.c ============================================================================== --- stable/7/bin/sh/eval.c Tue Dec 8 22:35:39 2009 (r200278) +++ stable/7/bin/sh/eval.c Tue Dec 8 22:37:07 2009 (r200279) @@ -773,6 +773,7 @@ evalcommand(union node *cmd, int flags, INTOFF; savelocalvars = localvars; localvars = NULL; + reffunc(cmdentry.u.func); INTON; if (setjmp(jmploc.loc)) { if (exception == EXSHELLPROC) @@ -781,6 +782,7 @@ evalcommand(union node *cmd, int flags, freeparam(&shellparam); shellparam = saveparam; } + unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; handler = savehandler; @@ -792,11 +794,12 @@ evalcommand(union node *cmd, int flags, mklocal(sp->text); funcnest++; if (flags & EV_TESTED) - evaltree(cmdentry.u.func, EV_TESTED); + evaltree(getfuncnode(cmdentry.u.func), EV_TESTED); else - evaltree(cmdentry.u.func, 0); + evaltree(getfuncnode(cmdentry.u.func), 0); funcnest--; INTOFF; + unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; freeparam(&shellparam); Modified: stable/7/bin/sh/exec.c ============================================================================== --- stable/7/bin/sh/exec.c Tue Dec 8 22:35:39 2009 (r200278) +++ stable/7/bin/sh/exec.c Tue Dec 8 22:37:07 2009 (r200279) @@ -285,7 +285,7 @@ printentry(struct tblentry *cmdp, int ve out1fmt("function %s", cmdp->cmdname); if (verbose) { INTOFF; - name = commandtext(cmdp->param.func); + name = commandtext(getfuncnode(cmdp->param.func)); out1c(' '); out1str(name); ckfree(name); @@ -582,7 +582,7 @@ deletefuncs(void) while ((cmdp = *pp) != NULL) { if (cmdp->cmdtype == CMDFUNCTION) { *pp = cmdp->next; - freefunc(cmdp->param.func); + unreffunc(cmdp->param.func); ckfree(cmdp); } else { pp = &cmdp->next; @@ -669,7 +669,7 @@ addcmdentry(char *name, struct cmdentry INTOFF; cmdp = cmdlookup(name, 1); if (cmdp->cmdtype == CMDFUNCTION) { - freefunc(cmdp->param.func); + unreffunc(cmdp->param.func); } cmdp->cmdtype = entry->cmdtype; cmdp->param = entry->u; @@ -704,7 +704,7 @@ unsetfunc(char *name) struct tblentry *cmdp; if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->cmdtype == CMDFUNCTION) { - freefunc(cmdp->param.func); + unreffunc(cmdp->param.func); delete_cmd_entry(); return (0); } Modified: stable/7/bin/sh/exec.h ============================================================================== --- stable/7/bin/sh/exec.h Tue Dec 8 22:35:39 2009 (r200278) +++ stable/7/bin/sh/exec.h Tue Dec 8 22:37:07 2009 (r200279) @@ -46,11 +46,12 @@ enum { TYPECMD_TYPE /* type */ }; +union node; struct cmdentry { int cmdtype; union param { int index; - union node *func; + struct funcdef *func; } u; int special; }; Modified: stable/7/bin/sh/mknodes.c ============================================================================== --- stable/7/bin/sh/mknodes.c Tue Dec 8 22:35:39 2009 (r200278) +++ stable/7/bin/sh/mknodes.c Tue Dec 8 22:37:07 2009 (r200279) @@ -248,8 +248,11 @@ output(char *file) fputs("\tstruct nodelist *next;\n", hfile); fputs("\tunion node *n;\n", hfile); fputs("};\n\n\n", hfile); - fputs("union node *copyfunc(union node *);\n", hfile); - fputs("void freefunc(union node *);\n", hfile); + fputs("struct funcdef;\n", hfile); + fputs("struct funcdef *copyfunc(union node *);\n", hfile); + fputs("union node *getfuncnode(struct funcdef *);\n", hfile); + fputs("void reffunc(struct funcdef *);\n", hfile); + fputs("void unreffunc(struct funcdef *);\n", hfile); fputs(writer, cfile); while (fgets(line, sizeof line, patfile) != NULL) { Modified: stable/7/bin/sh/nodes.c.pat ============================================================================== --- stable/7/bin/sh/nodes.c.pat Tue Dec 8 22:35:39 2009 (r200278) +++ stable/7/bin/sh/nodes.c.pat Tue Dec 8 22:37:07 2009 (r200279) @@ -35,6 +35,7 @@ #include #include +#include /* * Routine for dealing with parsed shell commands. */ @@ -60,25 +61,40 @@ STATIC struct nodelist *copynodelist(str STATIC char *nodesavestr(char *); +struct funcdef { + unsigned int refcount; + union node n; +}; /* * Make a copy of a parse tree. */ -union node * +struct funcdef * copyfunc(union node *n) { + struct funcdef *fn; + if (n == NULL) return NULL; - funcblocksize = 0; + funcblocksize = offsetof(struct funcdef, n); funcstringsize = 0; calcsize(n); - funcblock = ckmalloc(funcblocksize + funcstringsize); - funcstring = (char *)funcblock + funcblocksize; - return copynode(n); + fn = ckmalloc(funcblocksize + funcstringsize); + fn->refcount = 1; + funcblock = (char *)fn + offsetof(struct funcdef, n); + funcstring = (char *)fn + funcblocksize; + copynode(n); + return fn; } +union node * +getfuncnode(struct funcdef *fn) +{ + return fn == NULL ? NULL : &fn->n; +} + STATIC void calcsize(union node *n) @@ -144,14 +160,26 @@ nodesavestr(char *s) } +void +reffunc(struct funcdef *fn) +{ + if (fn) + fn->refcount++; +} + /* - * Free a parse tree. + * Decrement the reference count of a function definition, freeing it + * if it falls to 0. */ void -freefunc(union node *n) +unreffunc(struct funcdef *fn) { - if (n) - ckfree(n); + if (fn) { + fn->refcount--; + if (fn->refcount > 0) + return; + ckfree(fn); + } } Copied: stable/7/tools/regression/bin/sh/execution/func1.0 (from r196483, head/tools/regression/bin/sh/execution/func1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/regression/bin/sh/execution/func1.0 Tue Dec 8 22:37:07 2009 (r200279, copy of r196483, head/tools/regression/bin/sh/execution/func1.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +MALLOC_OPTIONS=J sh -c 'g() { g() { :; }; :; }; g' && +MALLOC_OPTIONS=J sh -c 'g() { unset -f g; :; }; g' Copied: stable/7/tools/regression/bin/sh/execution/func2.0 (from r196634, head/tools/regression/bin/sh/execution/func2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/tools/regression/bin/sh/execution/func2.0 Tue Dec 8 22:37:07 2009 (r200279, copy of r196634, head/tools/regression/bin/sh/execution/func2.0) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +f() { } +f +hash -v f >/dev/null +f() { { }; } +f +hash -v f >/dev/null +f() { { } } +f +hash -v f >/dev/null From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:38:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DA261065672; Tue, 8 Dec 2009 22:38:43 +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 1C7518FC14; Tue, 8 Dec 2009 22:38: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 nB8MchKj003459; Tue, 8 Dec 2009 22:38:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Mch2h003457; Tue, 8 Dec 2009 22:38:43 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912082238.nB8Mch2h003457@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 8 Dec 2009 22:38: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: r200280 - head/sys/amd64/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:38:43 -0000 Author: jkim Date: Tue Dec 8 22:38:42 2009 New Revision: 200280 URL: http://svn.freebsd.org/changeset/base/200280 Log: Simplify a macro not to generate unncessary symbols. Modified: head/sys/amd64/acpica/acpi_switch.S Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Tue Dec 8 22:37:07 2009 (r200279) +++ head/sys/amd64/acpica/acpi_switch.S Tue Dec 8 22:38:42 2009 (r200280) @@ -34,20 +34,7 @@ #include "acpi_wakedata.h" #include "assym.s" -#define WAKEUP_DECL(member) \ - .set WAKEUP_ ## member, wakeup_ ## member - wakeup_ctx - - WAKEUP_DECL(xpcb) - WAKEUP_DECL(gdt) - WAKEUP_DECL(efer) - WAKEUP_DECL(pat) - WAKEUP_DECL(star) - WAKEUP_DECL(lstar) - WAKEUP_DECL(cstar) - WAKEUP_DECL(sfmask) - WAKEUP_DECL(cpu) - -#define WAKEUP_CTX(member) WAKEUP_ ## member (%rdi) +#define WAKEUP_CTX(member) wakeup_ ## member - wakeup_ctx(%rdi) #define WAKEUP_PCB(member) PCB_ ## member(%r11) #define WAKEUP_XPCB(member) XPCB_ ## member(%r11) From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:41:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33EAA1065670; Tue, 8 Dec 2009 22:41:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2108E8FC13; Tue, 8 Dec 2009 22:41: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 nB8Mfc1D003589; Tue, 8 Dec 2009 22:41:38 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Mfc9a003587; Tue, 8 Dec 2009 22:41:38 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200912082241.nB8Mfc9a003587@svn.freebsd.org> From: Rick Macklem Date: Tue, 8 Dec 2009 22:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200281 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:41:38 -0000 Author: rmacklem Date: Tue Dec 8 22:41:37 2009 New Revision: 200281 URL: http://svn.freebsd.org/changeset/base/200281 Log: MFC: r199715 Modify the experimental nfs server so that it falls back to using VOP_LOOKUP() when VFS_VGET() returns EOPNOTSUPP in the ReaddirPlus RPC. This patch is based upon one by pjd@ for the regular nfs server which has not yet been committed. It is needed when a ZFS volume is exported and ReaddirPlus (which almost always happens for NFSv4) is performed by a client. The patch also simplifies vnode lock handling somewhat. Tested by: gerrit at pmp.uni-hannover.de Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 8 22:38:42 2009 (r200280) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Dec 8 22:41:37 2009 (r200281) @@ -1675,7 +1675,7 @@ nfsrvd_readdirplus(struct nfsrv_descript struct nfsvattr nva, at, *nvap = &nva; struct mbuf *mb0, *mb1; struct nfsreferral *refp; - int nlen, r, error = 0, getret = 1, vgetret; + int nlen, r, error = 0, getret = 1, usevget = 1; int siz, cnt, fullsiz, eofflag, ncookies, entrycnt; caddr_t bpos0, bpos1; u_int64_t off, toff, verf; @@ -1683,6 +1683,7 @@ nfsrvd_readdirplus(struct nfsrv_descript nfsattrbit_t attrbits, rderrbits, savbits; struct uio io; struct iovec iv; + struct componentname cn; if (nd->nd_repstat) { nfsrv_postopattr(nd, getret, &at); @@ -1761,8 +1762,6 @@ nfsrvd_readdirplus(struct nfsrv_descript return (0); } - NFSVOPUNLOCK(vp, 0, p); - MALLOC(rbuf, caddr_t, siz, M_TEMP, M_WAITOK); again: eofflag = 0; @@ -1780,10 +1779,8 @@ again: io.uio_segflg = UIO_SYSSPACE; io.uio_rw = UIO_READ; io.uio_td = NULL; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); nd->nd_repstat = VOP_READDIR(vp, &io, nd->nd_cred, &eofflag, &ncookies, &cookies); - NFSVOPUNLOCK(vp, 0, p); off = (u_int64_t)io.uio_offset; if (io.uio_resid) siz -= io.uio_resid; @@ -1795,7 +1792,7 @@ again: if (!nd->nd_repstat) nd->nd_repstat = getret; if (nd->nd_repstat) { - vrele(vp); + vput(vp); if (cookies) free((caddr_t)cookies, M_TEMP); free((caddr_t)rbuf, M_TEMP); @@ -1808,7 +1805,7 @@ again: * rpc reply */ if (siz == 0) { - vrele(vp); + vput(vp); if (nd->nd_flag & ND_NFSV3) nfsrv_postopattr(nd, getret, &at); NFSM_BUILD(tl, u_int32_t *, 4 * NFSX_UNSIGNED); @@ -1853,33 +1850,7 @@ again: toff = off; goto again; } - - /* - * Probe one of the directory entries to see if the filesystem - * supports VGET for NFSv3. For NFSv4, it will return an - * error later, if attributes are required. - * (To be honest, most if not all NFSv4 clients will require - * attributes, but??) - */ - if ((nd->nd_flag & ND_NFSV3)) { - vgetret = VFS_VGET(vp->v_mount, dp->d_fileno, LK_EXCLUSIVE, - &nvp); - if (vgetret != 0) { - if (vgetret == EOPNOTSUPP) - nd->nd_repstat = NFSERR_NOTSUPP; - else - nd->nd_repstat = NFSERR_SERVERFAULT; - vrele(vp); - if (cookies) - free((caddr_t)cookies, M_TEMP); - free((caddr_t)rbuf, M_TEMP); - nfsrv_postopattr(nd, getret, &at); - return (0); - } - if (!vgetret) - vput(nvp); - nvp = NULL; - } + NFSVOPUNLOCK(vp, 0, p); /* * Save this position, in case there is an error before one entry @@ -1937,9 +1908,41 @@ again: if (nd->nd_flag & ND_NFSV4) refp = nfsv4root_getreferral(NULL, vp, dp->d_fileno); - if (refp == NULL) - r = VFS_VGET(vp->v_mount, dp->d_fileno, - LK_EXCLUSIVE, &nvp); + if (refp == NULL) { + if (usevget) + r = VFS_VGET(vp->v_mount, + dp->d_fileno, LK_EXCLUSIVE, + &nvp); + else + r = EOPNOTSUPP; + if (r == EOPNOTSUPP) { + if (usevget) { + usevget = 0; + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = + LK_EXCLUSIVE | + LK_RETRY; + cn.cn_cred = + nd->nd_cred; + cn.cn_thread = p; + } + cn.cn_nameptr = dp->d_name; + cn.cn_namelen = nlen; + cn.cn_flags = ISLASTCN | + NOFOLLOW | LOCKLEAF | + MPSAFE; + if (nlen == 2 && + dp->d_name[0] == '.' && + dp->d_name[1] == '.') + cn.cn_flags |= + ISDOTDOT; + if (!VOP_ISLOCKED(vp)) + vn_lock(vp, + LK_EXCLUSIVE | + LK_RETRY); + r = VOP_LOOKUP(vp, &nvp, &cn); + } + } if (!r) { if (refp == NULL && ((nd->nd_flag & ND_NFSV3) || @@ -2018,7 +2021,10 @@ again: cookiep++; ncookies--; } - vrele(vp); + if (!usevget && VOP_ISLOCKED(vp)) + vput(vp); + else + vrele(vp); /* * If dirlen > cnt, we must strip off the last entry. If that From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:43:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CBE910656AA; Tue, 8 Dec 2009 22:43:30 +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 EF7578FC26; Tue, 8 Dec 2009 22:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB8MhT3T003757; Tue, 8 Dec 2009 22:43:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8MhTMe003755; Tue, 8 Dec 2009 22:43:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912082243.nB8MhTMe003755@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Dec 2009 22:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200282 - head/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:43:30 -0000 Author: mav Date: Tue Dec 8 22:43:29 2009 New Revision: 200282 URL: http://svn.freebsd.org/changeset/base/200282 Log: Change gmirror default balance algorithm from "split" to "load". "split" is very ineffective for devices with rotating media as HDDs. To be effective, it needs that transfer time reduction due to block splitting was bigger then access time increase due to non-sequential access. For modern HDDs I was able to reproduce it only with read sizes of 2MB and above, which is almost not applicable in real life. "load" algorithm same time is more universal and effective now. Reviewed by: pjd Modified: head/sbin/geom/class/mirror/geom_mirror.c Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Tue Dec 8 22:41:37 2009 (r200281) +++ head/sbin/geom/class/mirror/geom_mirror.c Tue Dec 8 22:43:29 2009 (r200282) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; -static char label_balance[] = "split", configure_balance[] = "none"; +static char label_balance[] = "load", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; static intmax_t insert_priority = 0, configure_priority = -1; From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 22:43:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4E3106566B; Tue, 8 Dec 2009 22:43:40 +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 0A36A8FC13; Tue, 8 Dec 2009 22:43:40 +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 B02A946B7F; Tue, 8 Dec 2009 17:43:39 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 0A21A8A01B; Tue, 8 Dec 2009 17:43:39 -0500 (EST) From: John Baldwin To: Jilles Tjoelker Date: Tue, 8 Dec 2009 17:42:58 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912082048.nB8Km6aP099420@svn.freebsd.org> <200912081645.37356.jhb@freebsd.org> <20091208221028.GA57735@stack.nl> In-Reply-To: <20091208221028.GA57735@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912081742.58162.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 08 Dec 2009 17:43:39 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no 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: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 22:43:40 -0000 On Tuesday 08 December 2009 5:10:28 pm Jilles Tjoelker wrote: > On Tue, Dec 08, 2009 at 04:45:37PM -0500, John Baldwin wrote: > > On Tuesday 08 December 2009 3:48:06 pm Jilles Tjoelker wrote: > > > Author: jilles > > > Date: Tue Dec 8 20:48:06 2009 > > > New Revision: 200274 > > > URL: http://svn.freebsd.org/changeset/base/200274 > > > > Log: > > > sem_init(3): document process shared semaphores and their restrictions > > > I think the other language was more accurate. The new language has > > far less detail such as no longer documenting EPERM. > > It seems that EPERM longer happens, at least not for any process-shared > semaphore at all. This does seem true. > What's missing is the SIGSYS/ENOSYS you'll get if sem.ko is not loaded, > and you're requesting a process-shared semaphore or not linking with > the threading library. This is probably less important since it is now enabled by default in HEAD. I think ENOSYS is a bit of a special case as we don't document it for other optional services such as SYSV IPC primitives. > > I think it is also quite accurate to say that the current > > implementation is not capable of process shared semaphores. Several > > things would need to be changed including moving away from using file > > descriptors. > > There are some lines of code dedicated to make it work, and some people > seem to use it, although they notice that it does not work very well. > This topic has come up on the mailing lists several times recently. No, it doesn't really work. It happens to work across a fork(), but that is the only case. In particular, you can't mmap() a file (or a shared memory descriptor) and sem_init() a region of it and expect another process to be able to use it directly via sem_wait() (which is what pshared is supposed to mean): If the pshared argument has a non-zero value, then the semaphore is shared between processes; in this case, any process that can access the semaphore sem can use sem for performing sem_wait(), [TMO] [Option Start] sem_timedwait(), [Option End] sem_trywait(), sem_post(), and sem_destroy() operations. The fact that we don't fail attempts to use pshared outright is probably dubious. They cannot possibly work as currently implemented aside from fork() since the structure embeds a file descriptor and file descriptor indices are a per-process namespace, not a global namespace. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 23:15:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA71B106566C; Tue, 8 Dec 2009 23:15: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 D31818FC14; Tue, 8 Dec 2009 23:15: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 nB8NFmrA004526; Tue, 8 Dec 2009 23:15:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8NFmmZ004522; Tue, 8 Dec 2009 23:15:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912082315.nB8NFmmZ004522@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Dec 2009 23:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200284 - in stable/8: . contrib/top lib/libusb sbin/geom/class/mirror sys/geom/mirror tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termca... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 23:15:49 -0000 Author: mav Date: Tue Dec 8 23:15:48 2009 New Revision: 200284 URL: http://svn.freebsd.org/changeset/base/200284 Log: MFC r196879: Add support for changing providers priority. Modified: stable/8/sbin/geom/class/mirror/geom_mirror.c stable/8/sbin/geom/class/mirror/gmirror.8 stable/8/sys/geom/mirror/g_mirror_ctl.c Directory Properties: stable/8/ (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- stable/8/sbin/geom/class/mirror/geom_mirror.c Tue Dec 8 22:49:03 2009 (r200283) +++ stable/8/sbin/geom/class/mirror/geom_mirror.c Tue Dec 8 23:15:48 2009 (r200284) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2005 Pawel Jakub Dawidek + * Copyright (c) 2004-2009 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,13 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include - uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; static char label_balance[] = "split", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; -static intmax_t insert_priority = 0; +static intmax_t insert_priority = 0, configure_priority = -1; static void mirror_main(struct gctl_req *req, unsigned flags); static void mirror_activate(struct gctl_req *req); @@ -71,10 +70,12 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'h', "hardcode", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 'p', "priority", &configure_priority, G_TYPE_NUMBER }, { 's', "slice", &configure_slice, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-adfFhnv] [-b balance] [-s slice] name" + NULL, "[-adfFhnv] [-b balance] [-s slice] name\n" + "[-v] -p priority name prov" }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov ..." Modified: stable/8/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- stable/8/sbin/geom/class/mirror/gmirror.8 Tue Dec 8 22:49:03 2009 (r200283) +++ stable/8/sbin/geom/class/mirror/gmirror.8 Tue Dec 8 23:15:48 2009 (r200284) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek +.\" Copyright (c) 2004-2009 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd August 1, 2009 .Dt GMIRROR 8 .Os .Sh NAME @@ -49,6 +49,12 @@ .Op Fl s Ar slice .Ar name .Nm +.Cm configure +.Op Fl v +.Fl p Ar priority +.Ar name +.Ar prov +.Nm .Cm rebuild .Op Fl v .Ar name @@ -115,8 +121,8 @@ indicates an action to be performed: .It Cm label Create a mirror. The order of components is important, because a component's priority is based on its position -(starting from 0). -The component with the biggest priority is used by the +(starting from 0 to 255). +The component with the biggest priority (the lowest number) is used by the .Cm prefer balance algorithm and is also used as a master component when resynchronization is needed, @@ -159,7 +165,7 @@ Clear metadata on the given providers. Configure the given device. .Pp Additional options include: -.Bl -tag -width ".Fl b Ar balance" +.Bl -tag -width ".Fl p Ar priority" .It Fl a Turn on autosynchronization of stale components. .It Fl b Ar balance @@ -175,6 +181,9 @@ Assumes device is in consistent state. Hardcode providers' names in metadata. .It Fl n Turn off autosynchronization of stale components. +.It Fl p Ar priority +Specifies priority for the given component +.Ar prov . .It Fl s Ar slice Specifies slice size for .Cm split Modified: stable/8/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror_ctl.c Tue Dec 8 22:49:03 2009 (r200283) +++ stable/8/sys/geom/mirror/g_mirror_ctl.c Tue Dec 8 23:15:48 2009 (r200284) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004-2006 Pawel Jakub Dawidek + * Copyright (c) 2004-2009 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,19 +93,19 @@ g_mirror_ctl_configure(struct gctl_req * { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - const char *name, *balancep; - intmax_t *slicep; + const char *name, *balancep, *prov; + intmax_t *slicep, *priority; uint32_t slice; uint8_t balance; int *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic; - int *nargs, do_sync = 0, dirty = 1; + int *nargs, do_sync = 0, dirty = 1, do_priority = 0; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { gctl_error(req, "No '%s' argument.", "nargs"); return; } - if (*nargs != 1) { + if (*nargs != 1 && *nargs != 2) { gctl_error(req, "Invalid number of arguments."); return; } @@ -149,6 +149,29 @@ g_mirror_ctl_configure(struct gctl_req * gctl_error(req, "No '%s' argument.", "dynamic"); return; } + priority = gctl_get_paraml(req, "priority", sizeof(*priority)); + if (priority == NULL) { + gctl_error(req, "No '%s' argument.", "priority"); + return; + } + if (*priority < -1 || *priority > 255) { + gctl_error(req, "Priority range is 0 to 255, %jd given", + *priority); + return; + } + /* + * Since we have a priority, we also need a provider now. + * Note: be WARNS safe, by always assigning prov and only throw an + * error if *priority != -1. + */ + prov = gctl_get_asciiparam(req, "arg1"); + if (*priority > -1) { + if (prov == NULL) { + gctl_error(req, "Priority needs a disk name"); + return; + } + do_priority = 1; + } if (*autosync && *noautosync) { gctl_error(req, "'%s' and '%s' specified.", "autosync", "noautosync"); @@ -189,19 +212,32 @@ g_mirror_ctl_configure(struct gctl_req * slice = sc->sc_slice; else slice = *slicep; - if (g_mirror_ndisks(sc, -1) < sc->sc_ndisks) { + /* Enforce usage() of -p not allowing any other options. */ + if (do_priority && (*autosync || *noautosync || *failsync || + *nofailsync || *hardcode || *dynamic || *slicep != -1 || + strcmp(balancep, "none") != 0)) { sx_xunlock(&sc->sc_lock); - gctl_error(req, "Not all disks connected. Try 'forget' command " - "first."); + gctl_error(req, "only -p accepted when setting priority"); return; } if (sc->sc_balance == balance && sc->sc_slice == slice && !*autosync && !*noautosync && !*failsync && !*nofailsync && !*hardcode && - !*dynamic) { + !*dynamic && !do_priority) { sx_xunlock(&sc->sc_lock); gctl_error(req, "Nothing has changed."); return; } + if ((!do_priority && *nargs != 1) || (do_priority && *nargs != 2)) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Invalid number of arguments."); + return; + } + if (g_mirror_ndisks(sc, -1) < sc->sc_ndisks) { + sx_xunlock(&sc->sc_lock); + gctl_error(req, "Not all disks connected. Try 'forget' command " + "first."); + return; + } sc->sc_balance = balance; sc->sc_slice = slice; if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_NOAUTOSYNC) != 0) { @@ -223,6 +259,23 @@ g_mirror_ctl_configure(struct gctl_req * } } LIST_FOREACH(disk, &sc->sc_disks, d_next) { + /* + * Handle priority first, since we only need one disk, do one + * operation on it and then we're done. No need to check other + * flags, as usage doesn't allow it. + */ + if (do_priority) { + if (strcmp(disk->d_name, prov) == 0) { + if (disk->d_priority == *priority) + gctl_error(req, "Nothing has changed."); + else { + disk->d_priority = *priority; + g_mirror_update_metadata(disk); + } + break; + } + continue; + } if (do_sync) { if (disk->d_state == G_MIRROR_DISK_STATE_SYNCHRONIZING) disk->d_flags &= ~G_MIRROR_DISK_FLAG_FORCE_SYNC; From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 23:23:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35DCC106566B; Tue, 8 Dec 2009 23:23:46 +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 233848FC13; Tue, 8 Dec 2009 23:23: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 nB8NNk1A004827; Tue, 8 Dec 2009 23:23:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8NNkgn004824; Tue, 8 Dec 2009 23:23:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912082323.nB8NNkgn004824@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Dec 2009 23:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200285 - stable/8/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 23:23:46 -0000 Author: mav Date: Tue Dec 8 23:23:45 2009 New Revision: 200285 URL: http://svn.freebsd.org/changeset/base/200285 Log: MFC r200086: Change 'load' balancing mode algorithm: - Instead of measuring last request execution time for each drive and choosing one with smallest time, use averaged number of requests, running on each drive. This information is more accurate and timely. It allows to distribute load between drives in more even and predictable way. - For each drive track offset of the last submitted request. If new request offset matches previous one or close for some drive, prefer that drive. It allows to significantly speedup simultaneous sequential reads. PR: kern/113885 Modified: stable/8/sys/geom/mirror/g_mirror.c stable/8/sys/geom/mirror/g_mirror.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Tue Dec 8 23:15:48 2009 (r200284) +++ stable/8/sys/geom/mirror/g_mirror.c Tue Dec 8 23:23:45 2009 (r200285) @@ -451,9 +451,6 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_id = md->md_did; disk->d_state = G_MIRROR_DISK_STATE_NONE; disk->d_priority = md->md_priority; - disk->d_delay.sec = 0; - disk->d_delay.frac = 0; - binuptime(&disk->d_last_used); disk->d_flags = md->md_dflags; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; @@ -863,16 +860,6 @@ bintime_cmp(struct bintime *bt1, struct } static void -g_mirror_update_delay(struct g_mirror_disk *disk, struct bio *bp) -{ - - if (disk->d_softc->sc_balance != G_MIRROR_BALANCE_LOAD) - return; - binuptime(&disk->d_delay); - bintime_sub(&disk->d_delay, &bp->bio_t0); -} - -static void g_mirror_done(struct bio *bp) { struct g_mirror_softc *sc; @@ -904,8 +891,6 @@ g_mirror_regular_request(struct bio *bp) g_topology_lock(); g_mirror_kill_consumer(sc, bp->bio_from); g_topology_unlock(); - } else { - g_mirror_update_delay(disk, bp); } pbp->bio_inbed++; @@ -1465,30 +1450,35 @@ g_mirror_request_round_robin(struct g_mi g_io_request(cbp, cp); } +#define TRACK_SIZE (1 * 1024 * 1024) +#define LOAD_SCALE 256 +#define ABS(x) (((x) >= 0) ? (x) : (-(x))) + static void g_mirror_request_load(struct g_mirror_softc *sc, struct bio *bp) { struct g_mirror_disk *disk, *dp; struct g_consumer *cp; struct bio *cbp; - struct bintime curtime; + int prio, best; - binuptime(&curtime); - /* - * Find a disk which the smallest load. - */ + /* Find a disk with the smallest load. */ disk = NULL; + best = INT_MAX; LIST_FOREACH(dp, &sc->sc_disks, d_next) { if (dp->d_state != G_MIRROR_DISK_STATE_ACTIVE) continue; - /* If disk wasn't used for more than 2 sec, use it. */ - if (curtime.sec - dp->d_last_used.sec >= 2) { - disk = dp; - break; - } - if (disk == NULL || - bintime_cmp(&dp->d_delay, &disk->d_delay) < 0) { + prio = dp->load; + /* If disk head is precisely in position - highly prefer it. */ + if (dp->d_last_offset == bp->bio_offset) + prio -= 2 * LOAD_SCALE; + else + /* If disk head is close to position - prefer it. */ + if (ABS(dp->d_last_offset - bp->bio_offset) < TRACK_SIZE) + prio -= 1 * LOAD_SCALE; + if (prio <= best) { disk = dp; + best = prio; } } KASSERT(disk != NULL, ("NULL disk for %s.", sc->sc_name)); @@ -1505,12 +1495,18 @@ g_mirror_request_load(struct g_mirror_so cp = disk->d_consumer; cbp->bio_done = g_mirror_done; cbp->bio_to = cp->provider; - binuptime(&disk->d_last_used); G_MIRROR_LOGREQ(3, cbp, "Sending request."); KASSERT(cp->acr >= 1 && cp->acw >= 1 && cp->ace >= 1, ("Consumer %s not opened (r%dw%de%d).", cp->provider->name, cp->acr, cp->acw, cp->ace)); cp->index++; + /* Remember last head position */ + disk->d_last_offset = bp->bio_offset + bp->bio_length; + /* Update loads. */ + LIST_FOREACH(dp, &sc->sc_disks, d_next) { + dp->load = (dp->d_consumer->index * LOAD_SCALE + + dp->load * 7) / 8; + } g_io_request(cbp, cp); } Modified: stable/8/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.h Tue Dec 8 23:15:48 2009 (r200284) +++ stable/8/sys/geom/mirror/g_mirror.h Tue Dec 8 23:23:45 2009 (r200285) @@ -133,8 +133,8 @@ struct g_mirror_disk { struct g_mirror_softc *d_softc; /* Back-pointer to softc. */ int d_state; /* Disk state. */ u_int d_priority; /* Disk priority. */ - struct bintime d_delay; /* Disk delay. */ - struct bintime d_last_used; /* When disk was last used. */ + u_int load; /* Averaged queue length */ + off_t d_last_offset; /* Last read offset */ uint64_t d_flags; /* Additional flags. */ u_int d_genid; /* Disk's generation ID. */ struct g_mirror_disk_sync d_sync;/* Sync information. */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 23:34:34 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 638871065676; Tue, 8 Dec 2009 23:34:34 +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 512028FC1A; Tue, 8 Dec 2009 23:34: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 nB8NYYFX005214; Tue, 8 Dec 2009 23:34:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8NYYhY005211; Tue, 8 Dec 2009 23:34:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912082334.nB8NYYhY005211@svn.freebsd.org> From: Alexander Motin Date: Tue, 8 Dec 2009 23:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200286 - stable/7/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 23:34:34 -0000 Author: mav Date: Tue Dec 8 23:34:34 2009 New Revision: 200286 URL: http://svn.freebsd.org/changeset/base/200286 Log: MFC r200086: Change 'load' balancing mode algorithm: - Instead of measuring last request execution time for each drive and choosing one with smallest time, use averaged number of requests, running on each drive. This information is more accurate and timely. It allows to distribute load between drives in more even and predictable way. - For each drive track offset of the last submitted request. If new request offset matches previous one or close for some drive, prefer that drive. It allows to significantly speedup simultaneous sequential reads. PR: kern/113885 Modified: stable/7/sys/geom/mirror/g_mirror.c stable/7/sys/geom/mirror/g_mirror.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/7/sys/geom/mirror/g_mirror.c Tue Dec 8 23:23:45 2009 (r200285) +++ stable/7/sys/geom/mirror/g_mirror.c Tue Dec 8 23:34:34 2009 (r200286) @@ -451,9 +451,6 @@ g_mirror_init_disk(struct g_mirror_softc disk->d_id = md->md_did; disk->d_state = G_MIRROR_DISK_STATE_NONE; disk->d_priority = md->md_priority; - disk->d_delay.sec = 0; - disk->d_delay.frac = 0; - binuptime(&disk->d_last_used); disk->d_flags = md->md_dflags; if (md->md_provider[0] != '\0') disk->d_flags |= G_MIRROR_DISK_FLAG_HARDCODED; @@ -863,16 +860,6 @@ bintime_cmp(struct bintime *bt1, struct } static void -g_mirror_update_delay(struct g_mirror_disk *disk, struct bio *bp) -{ - - if (disk->d_softc->sc_balance != G_MIRROR_BALANCE_LOAD) - return; - binuptime(&disk->d_delay); - bintime_sub(&disk->d_delay, &bp->bio_t0); -} - -static void g_mirror_done(struct bio *bp) { struct g_mirror_softc *sc; @@ -904,8 +891,6 @@ g_mirror_regular_request(struct bio *bp) g_topology_lock(); g_mirror_kill_consumer(sc, bp->bio_from); g_topology_unlock(); - } else { - g_mirror_update_delay(disk, bp); } pbp->bio_inbed++; @@ -1465,30 +1450,35 @@ g_mirror_request_round_robin(struct g_mi g_io_request(cbp, cp); } +#define TRACK_SIZE (1 * 1024 * 1024) +#define LOAD_SCALE 256 +#define ABS(x) (((x) >= 0) ? (x) : (-(x))) + static void g_mirror_request_load(struct g_mirror_softc *sc, struct bio *bp) { struct g_mirror_disk *disk, *dp; struct g_consumer *cp; struct bio *cbp; - struct bintime curtime; + int prio, best; - binuptime(&curtime); - /* - * Find a disk which the smallest load. - */ + /* Find a disk with the smallest load. */ disk = NULL; + best = INT_MAX; LIST_FOREACH(dp, &sc->sc_disks, d_next) { if (dp->d_state != G_MIRROR_DISK_STATE_ACTIVE) continue; - /* If disk wasn't used for more than 2 sec, use it. */ - if (curtime.sec - dp->d_last_used.sec >= 2) { - disk = dp; - break; - } - if (disk == NULL || - bintime_cmp(&dp->d_delay, &disk->d_delay) < 0) { + prio = dp->load; + /* If disk head is precisely in position - highly prefer it. */ + if (dp->d_last_offset == bp->bio_offset) + prio -= 2 * LOAD_SCALE; + else + /* If disk head is close to position - prefer it. */ + if (ABS(dp->d_last_offset - bp->bio_offset) < TRACK_SIZE) + prio -= 1 * LOAD_SCALE; + if (prio <= best) { disk = dp; + best = prio; } } KASSERT(disk != NULL, ("NULL disk for %s.", sc->sc_name)); @@ -1505,12 +1495,18 @@ g_mirror_request_load(struct g_mirror_so cp = disk->d_consumer; cbp->bio_done = g_mirror_done; cbp->bio_to = cp->provider; - binuptime(&disk->d_last_used); G_MIRROR_LOGREQ(3, cbp, "Sending request."); KASSERT(cp->acr >= 1 && cp->acw >= 1 && cp->ace >= 1, ("Consumer %s not opened (r%dw%de%d).", cp->provider->name, cp->acr, cp->acw, cp->ace)); cp->index++; + /* Remember last head position */ + disk->d_last_offset = bp->bio_offset + bp->bio_length; + /* Update loads. */ + LIST_FOREACH(dp, &sc->sc_disks, d_next) { + dp->load = (dp->d_consumer->index * LOAD_SCALE + + dp->load * 7) / 8; + } g_io_request(cbp, cp); } Modified: stable/7/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/7/sys/geom/mirror/g_mirror.h Tue Dec 8 23:23:45 2009 (r200285) +++ stable/7/sys/geom/mirror/g_mirror.h Tue Dec 8 23:34:34 2009 (r200286) @@ -133,8 +133,8 @@ struct g_mirror_disk { struct g_mirror_softc *d_softc; /* Back-pointer to softc. */ int d_state; /* Disk state. */ u_int d_priority; /* Disk priority. */ - struct bintime d_delay; /* Disk delay. */ - struct bintime d_last_used; /* When disk was last used. */ + u_int load; /* Averaged queue length */ + off_t d_last_offset; /* Last read offset */ uint64_t d_flags; /* Additional flags. */ u_int d_genid; /* Disk's generation ID. */ struct g_mirror_disk_sync d_sync;/* Sync information. */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 8 23:43:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A87491065696; Tue, 8 Dec 2009 23:43:50 +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 976B38FC26; Tue, 8 Dec 2009 23:43: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 nB8Nhokg005425; Tue, 8 Dec 2009 23:43:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB8Nhotg005423; Tue, 8 Dec 2009 23:43:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912082343.nB8Nhotg005423@svn.freebsd.org> From: Xin LI Date: Tue, 8 Dec 2009 23:43: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: r200287 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 23:43:50 -0000 Author: delphij Date: Tue Dec 8 23:43:50 2009 New Revision: 200287 URL: http://svn.freebsd.org/changeset/base/200287 Log: Allow using IPv6 in nfsrvd_sentcache() callback. PR: kern/141289 Submitted by: Petr Lampa Approved by: rmacklem MFC after: 1 week Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdcache.c Tue Dec 8 23:34:34 2009 (r200286) +++ head/sys/fs/nfsserver/nfs_nfsdcache.c Tue Dec 8 23:43:50 2009 (r200287) @@ -522,8 +522,9 @@ nfsrvd_sentcache(struct nfsrvcache *rp, if (!(rp->rc_flag & RC_LOCKED)) panic("nfsrvd_sentcache not locked"); if (!err) { - if (so->so_proto->pr_domain->dom_family != AF_INET || - so->so_proto->pr_protocol != IPPROTO_TCP) + if ((so->so_proto->pr_domain->dom_family != AF_INET && + so->so_proto->pr_domain->dom_family != AF_INET6) || + so->so_proto->pr_protocol != IPPROTO_TCP) panic("nfs sent cache"); if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq)) rp->rc_flag |= RC_TCPSEQ; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 08:09:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B072C106568F; Wed, 9 Dec 2009 08:09:25 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F4C28FC27; Wed, 9 Dec 2009 08:09: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 nB989PfV016124; Wed, 9 Dec 2009 08:09:25 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB989Pfu016123; Wed, 9 Dec 2009 08:09:25 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200912090809.nB989Pfu016123@svn.freebsd.org> From: Kip Macy Date: Wed, 9 Dec 2009 08:09: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: r200288 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 08:09:25 -0000 Author: kmacy Date: Wed Dec 9 08:09:25 2009 New Revision: 200288 URL: http://svn.freebsd.org/changeset/base/200288 Log: make PV core dump actually dump memory - still need to fix program header initialization Modified: head/sys/i386/i386/dump_machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/dump_machdep.c ============================================================================== --- head/sys/i386/i386/dump_machdep.c Tue Dec 8 23:43:50 2009 (r200287) +++ head/sys/i386/i386/dump_machdep.c Wed Dec 9 08:09:25 2009 (r200288) @@ -182,7 +182,11 @@ cb_dumpdata(struct md_pa *mdp, int seqnr } for (i = 0; i < chunk; i++) { a = pa + i * PAGE_SIZE; +#ifdef XEN + va = pmap_kenter_temporary(xpmap_ptom(trunc_page(a)), i); +#else va = pmap_kenter_temporary(trunc_page(a), i); +#endif } error = dump_write(di, va, 0, dumplo, sz); if (error) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Dec 8 23:43:50 2009 (r200287) +++ head/sys/i386/i386/machdep.c Wed Dec 9 08:09:25 2009 (r200288) @@ -2432,6 +2432,9 @@ do_next: #else phys_avail[0] = physfree; phys_avail[1] = xen_start_info->nr_pages*PAGE_SIZE; + dump_avail[0] = 0; + dump_avail[1] = xen_start_info->nr_pages*PAGE_SIZE; + #endif /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 08:16:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8302C106566B; Wed, 9 Dec 2009 08:16:12 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5783F8FC0C; Wed, 9 Dec 2009 08:16: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 nB98GC9b016411; Wed, 9 Dec 2009 08:16:12 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB98GCuI016408; Wed, 9 Dec 2009 08:16:12 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <200912090816.nB98GCuI016408@svn.freebsd.org> From: Scott Long Date: Wed, 9 Dec 2009 08:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200289 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 08:16:12 -0000 Author: scottl Date: Wed Dec 9 08:16:12 2009 New Revision: 200289 URL: http://svn.freebsd.org/changeset/base/200289 Log: MFC: fix alignment calculation for situations where alignment needs to be exactly on page boundary or less. Modified: stable/7/sys/amd64/amd64/busdma_machdep.c stable/7/sys/i386/i386/busdma_machdep.c Modified: stable/7/sys/amd64/amd64/busdma_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/busdma_machdep.c Wed Dec 9 08:09:25 2009 (r200288) +++ stable/7/sys/amd64/amd64/busdma_machdep.c Wed Dec 9 08:16:12 2009 (r200289) @@ -597,7 +597,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm * Count the number of bounce pages * needed in order to complete this transfer */ - vaddr = trunc_page((vm_offset_t)buf); + vaddr = (vm_offset_t)buf; vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { @@ -607,7 +607,7 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm paddr = pmap_kextract(vaddr); if (run_filter(dmat, paddr) != 0) map->pagesneeded++; - vaddr += PAGE_SIZE; + vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); } CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } Modified: stable/7/sys/i386/i386/busdma_machdep.c ============================================================================== --- stable/7/sys/i386/i386/busdma_machdep.c Wed Dec 9 08:09:25 2009 (r200288) +++ stable/7/sys/i386/i386/busdma_machdep.c Wed Dec 9 08:16:12 2009 (r200289) @@ -584,7 +584,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm * Count the number of bounce pages * needed in order to complete this transfer */ - vaddr = trunc_page((vm_offset_t)buf); + vaddr = (vm_offset_t)buf; vendaddr = (vm_offset_t)buf + buflen; while (vaddr < vendaddr) { @@ -596,7 +596,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm run_filter(dmat, paddr) != 0) { map->pagesneeded++; } - vaddr += PAGE_SIZE; + vaddr += (PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK)); } CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 11:00:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5CB91065670; Wed, 9 Dec 2009 11:00:00 +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 C4A3E8FC0C; Wed, 9 Dec 2009 11:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB9B00K2023412; Wed, 9 Dec 2009 11:00:00 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9B00V9023410; Wed, 9 Dec 2009 11:00:00 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912091100.nB9B00V9023410@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 9 Dec 2009 11:00: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: r200290 - head/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 11:00:00 -0000 Author: ru Date: Wed Dec 9 11:00:00 2009 New Revision: 200290 URL: http://svn.freebsd.org/changeset/base/200290 Log: The default balance algorithm has changed from "split" to (the improved version of) "load". Modified: head/sbin/geom/class/mirror/gmirror.8 Modified: head/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- head/sbin/geom/class/mirror/gmirror.8 Wed Dec 9 08:16:12 2009 (r200289) +++ head/sbin/geom/class/mirror/gmirror.8 Wed Dec 9 11:00:00 2009 (r200290) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2009 +.Dd December 8, 2009 .Dt GMIRROR 8 .Os .Sh NAME @@ -135,6 +135,7 @@ Specifies balance algorithm to use, one .Bl -tag -width ".Cm round-robin" .It Cm load Read from the component with the lowest load. +This is the default balance algorithm. .It Cm prefer Read from the component with the biggest priority. .It Cm round-robin @@ -142,7 +143,6 @@ Use round-robin algorithm when choosing .It Cm split Split read requests, which are bigger than or equal to slice size on N pieces, where N is the number of active components. -This is the default balance algorithm. .El .It Fl F Do not synchronize after a power failure or system crash. From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 13:10:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB9341065679; Wed, 9 Dec 2009 13:10:10 +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 CB1068FC2E; Wed, 9 Dec 2009 13:10: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 nB9DAAs4026007; Wed, 9 Dec 2009 13:10:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9DAAMG026005; Wed, 9 Dec 2009 13:10:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091310.nB9DAAMG026005@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 13:10: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: r200291 - head/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 13:10:11 -0000 Author: mav Date: Wed Dec 9 13:10:10 2009 New Revision: 200291 URL: http://svn.freebsd.org/changeset/base/200291 Log: Increase Max Read Request Size for PCIe chips from 512 to 1024 bytes. It gives those beasts additional 10% of write bandwidth. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Wed Dec 9 11:00:00 2009 (r200290) +++ head/sys/dev/siis/siis.c Wed Dec 9 13:10:10 2009 (r200291) @@ -231,7 +231,20 @@ static int siis_resume(device_t dev) { struct siis_controller *ctlr = device_get_softc(dev); + int cap; + uint16_t val; + /* Set PCIe max read request size to at least 1024 bytes */ + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + val = pci_read_config(dev, + cap + PCIR_EXPRESS_DEVICE_CTL, 2); + if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) < 0x3000) { + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; + val |= 0x3000; + pci_write_config(dev, + cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); + } + } /* Put controller into reset state. */ ctlr->gctl |= SIIS_GCTL_GRESET; ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 13:27:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E431065670; Wed, 9 Dec 2009 13:27:06 +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 A55098FC15; Wed, 9 Dec 2009 13:27: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 nB9DR6wr026438; Wed, 9 Dec 2009 13:27:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9DR6TF026436; Wed, 9 Dec 2009 13:27:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091327.nB9DR6TF026436@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 13:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200292 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 13:27:06 -0000 Author: mav Date: Wed Dec 9 13:27:06 2009 New Revision: 200292 URL: http://svn.freebsd.org/changeset/base/200292 Log: MFC r200196: Add Asynchronous Notification support for controllers without SNTF capability by snooping SDB FIS receive area. It should be even faster then regular way, but less reliable. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Wed Dec 9 13:10:10 2009 (r200291) +++ stable/8/sys/dev/ahci/ahci.c Wed Dec 9 13:27:06 2009 (r200292) @@ -1129,7 +1129,8 @@ ahci_notify_events(device_t dev, u_int32 struct cam_path *dpath; int i; - ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); + if (ch->caps & AHCI_CAP_SSNTF) + ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); if (bootverbose) device_printf(dev, "SNTF 0x%04x\n", status); for (i = 0; i < 16; i++) { @@ -1188,8 +1189,16 @@ ahci_ch_intr(void *data) /* Read command statuses. */ sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT); cstatus = ATA_INL(ch->r_mem, AHCI_P_CI); - if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF)) - sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); + if (istatus & AHCI_P_IX_SDB) { + if (ch->caps & AHCI_CAP_SSNTF) + sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); + else { + u_int8_t *fis = ch->dma.rfis + 0x58; + + if (fis[1] & 0x80) + sntf = (1 << (fis[1] & 0x0f)); + } + } /* Process PHY events */ if (istatus & (AHCI_P_IX_PC | AHCI_P_IX_PRC | AHCI_P_IX_OF | AHCI_P_IX_IF | AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 13:30:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B509106566C; Wed, 9 Dec 2009 13:30:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19CED8FC0A; Wed, 9 Dec 2009 13:30: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 nB9DUBw4026559; Wed, 9 Dec 2009 13:30:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9DUB6d026556; Wed, 9 Dec 2009 13:30:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091330.nB9DUB6d026556@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 13:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200293 - stable/8/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 13:30:12 -0000 Author: mav Date: Wed Dec 9 13:30:11 2009 New Revision: 200293 URL: http://svn.freebsd.org/changeset/base/200293 Log: MFC r200217: SiI3124 has no SNotification register. Handle Asynchronous Notifications there without it as good as possible. Modified: stable/8/sys/dev/siis/siis.c stable/8/sys/dev/siis/siis.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Wed Dec 9 13:27:06 2009 (r200292) +++ stable/8/sys/dev/siis/siis.c Wed Dec 9 13:30:11 2009 (r200293) @@ -93,15 +93,17 @@ static struct { uint32_t id; const char *name; int ports; + int quirks; +#define SIIS_Q_SNTF 1 } siis_ids[] = { - {0x31241095, "SiI3124", 4}, - {0x31248086, "SiI3124", 4}, - {0x31321095, "SiI3132", 2}, - {0x02421095, "SiI3132", 2}, - {0x02441095, "SiI3132", 2}, - {0x31311095, "SiI3131", 1}, - {0x35311095, "SiI3531", 1}, - {0, NULL, 0} + {0x31241095, "SiI3124", 4, 0}, + {0x31248086, "SiI3124", 4, 0}, + {0x31321095, "SiI3132", 2, SIIS_Q_SNTF}, + {0x02421095, "SiI3132", 2, SIIS_Q_SNTF}, + {0x02441095, "SiI3132", 2, SIIS_Q_SNTF}, + {0x31311095, "SiI3131", 1, SIIS_Q_SNTF}, + {0x35311095, "SiI3531", 1, SIIS_Q_SNTF}, + {0, NULL, 0, 0} }; static int @@ -113,7 +115,7 @@ siis_probe(device_t dev) for (i = 0; siis_ids[i].id != 0; i++) { if (siis_ids[i].id == devid) { - snprintf(buf, sizeof(buf), "%s SATA2 controller", + snprintf(buf, sizeof(buf), "%s SATA controller", siis_ids[i].name); device_set_desc_copy(dev, buf); return (BUS_PROBE_VENDOR); @@ -130,11 +132,12 @@ siis_attach(device_t dev) device_t child; int error, i, unit; + ctlr->dev = dev; for (i = 0; siis_ids[i].id != 0; i++) { if (siis_ids[i].id == devid) break; } - ctlr->dev = dev; + ctlr->quirks = siis_ids[i].quirks; /* Global memory */ ctlr->r_grid = PCIR_BAR(0); if (!(ctlr->r_gmem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -413,12 +416,14 @@ siis_ch_probe(device_t dev) static int siis_ch_attach(device_t dev) { + struct siis_controller *ctlr = device_get_softc(device_get_parent(dev)); struct siis_channel *ch = device_get_softc(dev); struct cam_devq *devq; int rid, error, i, sata_rev = 0; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); + ch->quirks = ctlr->quirks; resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); resource_int_value(device_get_name(dev), @@ -680,8 +685,16 @@ siis_notify_events(device_t dev) u_int32_t status; int i; - status = ATA_INL(ch->r_mem, SIIS_P_SNTF); - ATA_OUTL(ch->r_mem, SIIS_P_SNTF, status); + if (ch->quirks & SIIS_Q_SNTF) { + status = ATA_INL(ch->r_mem, SIIS_P_SNTF); + ATA_OUTL(ch->r_mem, SIIS_P_SNTF, status); + } else { + /* + * Without SNTF we have no idea which device sent notification. + * If PMP is connected, assume it, else - device. + */ + status = (ch->pm_present) ? 0x8000 : 0x0001; + } if (bootverbose) device_printf(dev, "SNTF 0x%04x\n", status); for (i = 0; i < 16; i++) { Modified: stable/8/sys/dev/siis/siis.h ============================================================================== --- stable/8/sys/dev/siis/siis.h Wed Dec 9 13:27:06 2009 (r200292) +++ stable/8/sys/dev/siis/siis.h Wed Dec 9 13:30:11 2009 (r200293) @@ -363,6 +363,7 @@ struct siis_channel { struct ata_dma dma; /* DMA data */ struct cam_sim *sim; struct cam_path *path; + int quirks; int pm_level; /* power management level */ struct siis_slot slot[SIIS_MAX_SLOTS]; @@ -400,6 +401,7 @@ struct siis_controller { void *handle; int r_irq_rid; } irq; + int quirks; int channels; struct { void (*function)(void *); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 13:32:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 977151065670; Wed, 9 Dec 2009 13:32:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CADC8FC0A; Wed, 9 Dec 2009 13:32: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 nB9DWnlw026671; Wed, 9 Dec 2009 13:32:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9DWnuS026667; Wed, 9 Dec 2009 13:32:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091332.nB9DWnuS026667@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 13:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200294 - stable/8/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 13:32:49 -0000 Author: mav Date: Wed Dec 9 13:32:49 2009 New Revision: 200294 URL: http://svn.freebsd.org/changeset/base/200294 Log: MFC r200223: Explicitly acknowledge MSI completion, as required by SiI3124 datasheet. It makes MSI working there. Later (and cheaper) PCIe chips (3132/3531) still randomly crashing system in few seconds of high MSI rates, generating something inaporopriate, like NMI or "Fatal trap 30". Modified: stable/8/sys/dev/siis/siis.c stable/8/sys/dev/siis/siis.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Wed Dec 9 13:30:11 2009 (r200293) +++ stable/8/sys/dev/siis/siis.c Wed Dec 9 13:32:49 2009 (r200294) @@ -143,6 +143,7 @@ siis_attach(device_t dev) if (!(ctlr->r_gmem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &ctlr->r_grid, RF_ACTIVE))) return (ENXIO); + ctlr->gctl = ATA_INL(ctlr->r_gmem, SIIS_GCTL); /* Channels memory */ ctlr->r_rid = PCIR_BAR(2); if (!(ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, @@ -221,7 +222,8 @@ siis_suspend(device_t dev) bus_generic_suspend(dev); /* Put controller into reset state. */ - ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, SIIS_GCTL_GRESET); + ctlr->gctl |= SIIS_GCTL_GRESET; + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); return 0; } @@ -231,10 +233,13 @@ siis_resume(device_t dev) struct siis_controller *ctlr = device_get_softc(dev); /* Put controller into reset state. */ - ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, SIIS_GCTL_GRESET); + ctlr->gctl |= SIIS_GCTL_GRESET; + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); DELAY(10000); /* Get controller out of reset state and enable port interrupts. */ - ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, 0x0000000f); + ctlr->gctl &= ~(SIIS_GCTL_GRESET | SIIS_GCTL_I2C_IE); + ctlr->gctl |= 0x0000000f; + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); return (bus_generic_resume(dev)); } @@ -288,6 +293,11 @@ siis_intr(void *data) ctlr->interrupt[unit].function(arg); } } + /* Acknowledge interrupt, if MSI enabled. */ + if (ctlr->irq.r_irq_rid) { + ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, + ctlr->gctl | SIIS_GCTL_MSIACK); + } } static struct resource * Modified: stable/8/sys/dev/siis/siis.h ============================================================================== --- stable/8/sys/dev/siis/siis.h Wed Dec 9 13:30:11 2009 (r200293) +++ stable/8/sys/dev/siis/siis.h Wed Dec 9 13:32:49 2009 (r200294) @@ -403,6 +403,7 @@ struct siis_controller { } irq; int quirks; int channels; + uint32_t gctl; struct { void (*function)(void *); void *argument; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 13:54:33 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E37771065670; Wed, 9 Dec 2009 13:54:33 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.freebsd.org (Postfix) with ESMTP id A607F8FC0A; Wed, 9 Dec 2009 13:54:33 +0000 (UTC) Received: from [172.31.193.10] (cpe-174-097-131-132.nc.res.rr.com [174.97.131.132]) (authenticated bits=0) by duke.cs.duke.edu (8.14.2/8.14.2) with ESMTP id nB9DsWia007162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 9 Dec 2009 08:54:32 -0500 (EST) Message-ID: <4B1FAC12.6080907@cs.duke.edu> Date: Wed, 09 Dec 2009 08:54:26 -0500 From: Andrew Gallatin User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: John Baldwin References: <200912082048.nB8Km6aP099420@svn.freebsd.org> <200912081645.37356.jhb@freebsd.org> <20091208221028.GA57735@stack.nl> <200912081742.58162.jhb@freebsd.org> In-Reply-To: <200912081742.58162.jhb@freebsd.org> 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, Jilles Tjoelker Subject: Re: svn commit: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 13:54:34 -0000 John Baldwin wrote: > The fact that we don't fail attempts to use pshared outright is probably > dubious. They cannot possibly work as currently implemented aside from fork() > since the structure embeds a file descriptor and file descriptor indices are a > per-process namespace, not a global namespace. FWIW, this is what confused me. It tends to be kind of a land-mine, since programs can be ported from Linux, and appear to work at first for casual use. If we don't support pshared, we should return an error from sem_init() to make it obvious. Also, perhaps the sem_init() man page should mention sem_open(), since that seems to be the only way to really share a semaphore between processes on FreeBSD. Drew From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 14:21:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BD81065696; Wed, 9 Dec 2009 14:21:22 +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 02E698FC1B; Wed, 9 Dec 2009 14:21: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 nB9ELL1f027778; Wed, 9 Dec 2009 14:21:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9ELL9P027777; Wed, 9 Dec 2009 14:21:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091421.nB9ELL9P027777@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 14:21: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: r200295 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 14:21:22 -0000 Author: mav Date: Wed Dec 9 14:21:21 2009 New Revision: 200295 URL: http://svn.freebsd.org/changeset/base/200295 Log: Clear result before requesting XPT_PATH_INQ. Many SIMs doesn't fill maxio field yet. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Dec 9 13:32:49 2009 (r200294) +++ head/sys/cam/scsi/scsi_cd.c Wed Dec 9 14:21:21 2009 (r200295) @@ -673,6 +673,7 @@ cdregister(struct cam_periph *periph, vo softc->quirks = CD_Q_NONE; /* Check if the SIM does not want 6 byte commands */ + bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:11:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E5E1065672; Wed, 9 Dec 2009 17:11:10 +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 E34C48FC17; Wed, 9 Dec 2009 17:11: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 nB9HB9eN031545; Wed, 9 Dec 2009 17:11:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9HB9Ek031544; Wed, 9 Dec 2009 17:11:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091711.nB9HB9Ek031544@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200296 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:11:10 -0000 Author: mav Date: Wed Dec 9 17:11:09 2009 New Revision: 200296 URL: http://svn.freebsd.org/changeset/base/200296 Log: MFC r200117: On Soft Reset, read device signature from FIS receive area, instead of PxSIG register. It works better for NVidia chipsets. ahci(4) does the same. PR: kern/140472, i386/138668 Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Wed Dec 9 14:21:21 2009 (r200295) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Wed Dec 9 17:11:09 2009 (r200296) @@ -824,11 +824,10 @@ ata_ahci_hardreset(device_t dev, int por static u_int32_t ata_ahci_softreset(device_t dev, int port) { - struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - int offset = ch->unit << 7; struct ata_ahci_cmd_tab *ctp = (struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET); + u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; if (bootverbose) device_printf(dev, "software reset port %d...\n", port); @@ -865,7 +864,10 @@ ata_ahci_softreset(device_t dev, int por return (-1); } - return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); + return (((u_int32_t)fis[6] << 24) | + ((u_int32_t)fis[5] << 16) | + ((u_int32_t)fis[4] << 8) | + (u_int32_t)fis[12]); } static void From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:20:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE5610656E8; Wed, 9 Dec 2009 17:20:10 +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 4E5048FC1B; Wed, 9 Dec 2009 17:20: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 nB9HKALn031862; Wed, 9 Dec 2009 17:20:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9HKAsv031860; Wed, 9 Dec 2009 17:20:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091720.nB9HKAsv031860@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 17:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200297 - stable/8/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:20:10 -0000 Author: mav Date: Wed Dec 9 17:20:10 2009 New Revision: 200297 URL: http://svn.freebsd.org/changeset/base/200297 Log: MFC r200121: Do not ignore device interrupt if bus mastering is still active. It is normal in case of media read error and some ATAPI cases, when transfer size is unknown beforehand. PCI ATA BM specification tells that in case of such underrun driver should just manually stop DMA engine. DMA engine should same time guarantie that all bus mastering transfers completed at the moment of driver reads interrupt flag asserted. This change fixes interrupt storms and command timeouts in many cases. PR: kern/103602, sparc64/121539, kern/133122, kern/139654 Modified: stable/8/sys/dev/ata/ata-pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Wed Dec 9 17:11:09 2009 (r200296) +++ stable/8/sys/dev/ata/ata-pci.c Wed Dec 9 17:20:10 2009 (r200297) @@ -462,8 +462,7 @@ ata_pci_status(device_t dev) (ch->dma.flags & ATA_DMA_ACTIVE))) { int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; - if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) != - ATA_BMSTAT_INTERRUPT) + if ((bmstat & ATA_BMSTAT_INTERRUPT) == 0) return 0; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR); DELAY(1); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:23:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 454BF1065692; Wed, 9 Dec 2009 17:23:09 +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 33ED98FC17; Wed, 9 Dec 2009 17:23: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 nB9HN9tr031981; Wed, 9 Dec 2009 17:23:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9HN9Ld031979; Wed, 9 Dec 2009 17:23:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912091723.nB9HN9Ld031979@svn.freebsd.org> From: Alexander Motin Date: Wed, 9 Dec 2009 17:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200298 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:23:09 -0000 Author: mav Date: Wed Dec 9 17:23:08 2009 New Revision: 200298 URL: http://svn.freebsd.org/changeset/base/200298 Log: MFC r200121: Do not ignore device interrupt if bus mastering is still active. It is normal in case of media read error and some ATAPI cases, when transfer size is unknown beforehand. PCI ATA BM specification tells that in case of such underrun driver should just manually stop DMA engine. DMA engine should same time guarantie that all bus mastering transfers completed at the moment when driver reads interrupt flag asserted. This change fixes interrupt storms and command timeouts in many cases. PR: kern/103602, sparc64/121539, kern/133122, kern/139654 Modified: stable/7/sys/dev/ata/ata-pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-pci.c ============================================================================== --- stable/7/sys/dev/ata/ata-pci.c Wed Dec 9 17:20:10 2009 (r200297) +++ stable/7/sys/dev/ata/ata-pci.c Wed Dec 9 17:23:08 2009 (r200298) @@ -445,8 +445,7 @@ ata_pci_status(device_t dev) (ch->dma->flags & ATA_DMA_ACTIVE))) { int bmstat = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK; - if ((bmstat & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) != - ATA_BMSTAT_INTERRUPT) + if ((bmstat & ATA_BMSTAT_INTERRUPT) == 0) return 0; ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, bmstat & ~ATA_BMSTAT_ERROR); DELAY(1); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:41:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE999106566B; Wed, 9 Dec 2009 17:41:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADE048FC19; Wed, 9 Dec 2009 17:41:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB9Hflrj032392; Wed, 9 Dec 2009 17:41:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9HflxU032390; Wed, 9 Dec 2009 17:41:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912091741.nB9HflxU032390@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 9 Dec 2009 17:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200299 - head/release/picobsd/bridge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:41:47 -0000 Author: luigi Date: Wed Dec 9 17:41:47 2009 New Revision: 200299 URL: http://svn.freebsd.org/changeset/base/200299 Log: add -lulog, the program "less" and a comment Modified: head/release/picobsd/bridge/crunch.conf Modified: head/release/picobsd/bridge/crunch.conf ============================================================================== --- head/release/picobsd/bridge/crunch.conf Wed Dec 9 17:23:08 2009 (r200298) +++ head/release/picobsd/bridge/crunch.conf Wed Dec 9 17:41:47 2009 (r200299) @@ -98,13 +98,15 @@ progs cat tail tee progs test ln test [ +progs less +ln less more progs mount progs minigzip ln minigzip gzip progs kill progs df progs ps -progs ns # this is the +progs ns # this is the picobsd version ln ns netstat progs vm progs hostname @@ -179,3 +181,4 @@ libs_so -lz libs_so -lbsdxml libs_so -lsbuf libs_so -ljail # used by ifconfig +libs_so -lulog # used by ifconfig From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:42:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A62481065692; Wed, 9 Dec 2009 17:42:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95BDD8FC0C; Wed, 9 Dec 2009 17:42: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 nB9HgEup032438; Wed, 9 Dec 2009 17:42:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9HgEtR032436; Wed, 9 Dec 2009 17:42:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912091742.nB9HgEtR032436@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 9 Dec 2009 17:42: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: r200300 - head/release/picobsd/bridge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:42:14 -0000 Author: luigi Date: Wed Dec 9 17:42:14 2009 New Revision: 200300 URL: http://svn.freebsd.org/changeset/base/200300 Log: use default HZ Modified: head/release/picobsd/bridge/PICOBSD Modified: head/release/picobsd/bridge/PICOBSD ============================================================================== --- head/release/picobsd/bridge/PICOBSD Wed Dec 9 17:41:47 2009 (r200299) +++ head/release/picobsd/bridge/PICOBSD Wed Dec 9 17:42:14 2009 (r200300) @@ -46,7 +46,7 @@ options IPDIVERT # divert (for natd) # Support for bridging and bandwidth limiting options DUMMYNET device if_bridge -options HZ=1000 +#options HZ=1000 device random # used by ssh device pci From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:47:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AF71106566C; Wed, 9 Dec 2009 17:47:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id D359C8FC21; Wed, 9 Dec 2009 17:47:00 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id E19961CC8E; Wed, 9 Dec 2009 18:46:57 +0100 (CET) Date: Wed, 9 Dec 2009 18:46:57 +0100 From: Ed Schouten To: Luigi Rizzo Message-ID: <20091209174657.GW64905@hoeg.nl> References: <200912091741.nB9HflxU032390@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/7iChtZxVrnwuN4b" Content-Disposition: inline In-Reply-To: <200912091741.nB9HflxU032390@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200299 - head/release/picobsd/bridge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:47:01 -0000 --/7iChtZxVrnwuN4b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Luigi, * Luigi Rizzo wrote: > +libs_so -lulog # used by ifconfig ^^^^^^^^ Shouldn't this also read `less'? --=20 Ed Schouten WWW: http://80386.nl/ --/7iChtZxVrnwuN4b Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksf4pEACgkQ52SDGA2eCwUKtACeOPdBY7dRADKC8yj8jqZGPs7M acYAn221pZnWhD45dWBrBgTNPjYLzK+q =Iz49 -----END PGP SIGNATURE----- --/7iChtZxVrnwuN4b-- From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:48:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79DBD1065676; Wed, 9 Dec 2009 17:48:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 693068FC1B; Wed, 9 Dec 2009 17:48: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 nB9Hm5nM032603; Wed, 9 Dec 2009 17:48:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Hm5CK032601; Wed, 9 Dec 2009 17:48:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912091748.nB9Hm5CK032601@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 9 Dec 2009 17:48: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: r200301 - head/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:48:05 -0000 Author: luigi Date: Wed Dec 9 17:48:05 2009 New Revision: 200301 URL: http://svn.freebsd.org/changeset/base/200301 Log: when calling ldd, use the cross libraries and not the host version MFC after: 3 days Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Wed Dec 9 17:42:14 2009 (r200300) +++ head/release/picobsd/build/picobsd Wed Dec 9 17:48:05 2009 (r200301) @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi @@ -587,8 +587,9 @@ find_progs() { # programs local i u_progs="`find_progs_helper $*`" local o=${o_objdir:-${_SHLIBDIRPREFIX}} + log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" [ -z "${u_progs}" ] && return 1 # not found, error - i="`ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" + i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" u_libs="`find_progs_helper $i`" return 0 } @@ -719,8 +720,7 @@ populate_mfs_tree() { (cd ${dst}; chown -R root . ) fi - # If we are building a shared 'crunch', take the libraries - # and the dynamic loader as well + log "for a shared 'crunch' take libraries and dynamic loader as well" find_progs ${dst}/stand/crunch if [ -n "${u_libs}" ] ; then mkdir -p ${dst}/lib && cp -p ${u_libs} ${dst}/lib From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 17:49:44 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD4C7106566B; Wed, 9 Dec 2009 17:49:44 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 8BE6E8FC1F; Wed, 9 Dec 2009 17:49:44 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 36E1173106; Wed, 9 Dec 2009 18:58:06 +0100 (CET) Date: Wed, 9 Dec 2009 18:58:06 +0100 From: Luigi Rizzo To: Ed Schouten Message-ID: <20091209175806.GA40646@onelab2.iet.unipi.it> References: <200912091741.nB9HflxU032390@svn.freebsd.org> <20091209174657.GW64905@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091209174657.GW64905@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r200299 - head/release/picobsd/bridge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:49:44 -0000 On Wed, Dec 09, 2009 at 06:46:57PM +0100, Ed Schouten wrote: > Luigi, > > * Luigi Rizzo wrote: > > +libs_so -lulog # used by ifconfig > ^^^^^^^^ > > Shouldn't this also read `less'? i think -lulog is used by ifconfig and other progras. "less" is a former change that i forgot to commit cheers luigi From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 19:46:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B214106568F; Wed, 9 Dec 2009 19:46:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE5608FC15; Wed, 9 Dec 2009 19:46: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 nB9JkudS035149; Wed, 9 Dec 2009 19:46:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9JkunU035147; Wed, 9 Dec 2009 19:46:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912091946.nB9JkunU035147@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Dec 2009 19:46: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: r200302 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 19:46:57 -0000 Author: ed Date: Wed Dec 9 19:46:56 2009 New Revision: 200302 URL: http://svn.freebsd.org/changeset/base/200302 Log: Don't let sysinstall depend on . Looking at the other entries, I suspect we must also reserve one terminating byte, so I'm using UNAME_FIELD_LEN - 1, not UNAME_FIELD_LEN. Modified: head/usr.sbin/sysinstall/user.c Modified: head/usr.sbin/sysinstall/user.c ============================================================================== --- head/usr.sbin/sysinstall/user.c Wed Dec 9 17:48:05 2009 (r200301) +++ head/usr.sbin/sysinstall/user.c Wed Dec 9 19:46:56 2009 (r200302) @@ -35,7 +35,6 @@ */ #include "sysinstall.h" -#include #include #include #include @@ -47,7 +46,7 @@ #define GNAME_FIELD_LEN 32 #define GID_FIELD_LEN 11 #define GMEMB_FIELD_LEN 64 - +#define UNAME_FIELD_LEN MAXLOGNAME #define UID_FIELD_LEN 11 #define UGROUP_FIELD_LEN GNAME_FIELD_LEN #define GECOS_FIELD_LEN 64 @@ -61,7 +60,7 @@ static char gname[GNAME_FIELD_LEN], gid[GID_FIELD_LEN], gmemb[GMEMB_FIELD_LEN], - uname[UT_NAMESIZE + 1], + uname[UNAME_FIELD_LEN], passwd[PASSWD_FIELD_LEN], confpasswd[PASSWD_FIELD_LEN], uid[UID_FIELD_LEN], @@ -109,7 +108,7 @@ static Layout groupLayout[] = { /* The user configuration menu. */ static Layout userLayout[] = { #define LAYOUT_UNAME 0 - { 2, 6, UT_NAMESIZE, UT_NAMESIZE + 1, + { 2, 6, 16, UNAME_FIELD_LEN - 1, "Login ID:", "The login name of the new user (mandatory)", uname, STRINGOBJ, NULL }, #define LAYOUT_UID 1 From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:05:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A72106566C; Wed, 9 Dec 2009 20:05:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 270338FC25; Wed, 9 Dec 2009 20:05: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 nB9K5cvb035556; Wed, 9 Dec 2009 20:05:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9K5ciU035553; Wed, 9 Dec 2009 20:05:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912092005.nB9K5ciU035553@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Dec 2009 20:05: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: r200303 - head/usr.sbin/lastlogin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:05:38 -0000 Author: ed Date: Wed Dec 9 20:05:37 2009 New Revision: 200303 URL: http://svn.freebsd.org/changeset/base/200303 Log: Port lastlogin(1) to libulog. Just use ulog_getutxuser() to obtain lastlog records or ulog_getutxent() to browse through all of them. Modified: head/usr.sbin/lastlogin/Makefile head/usr.sbin/lastlogin/lastlogin.c Modified: head/usr.sbin/lastlogin/Makefile ============================================================================== --- head/usr.sbin/lastlogin/Makefile Wed Dec 9 19:46:56 2009 (r200302) +++ head/usr.sbin/lastlogin/Makefile Wed Dec 9 20:05:37 2009 (r200303) @@ -3,6 +3,9 @@ PROG= lastlogin MAN= lastlogin.8 -WARNS?= 2 +DPADD= ${LIBULOG} +LDADD= -lulog + +WARNS?= 6 .include Modified: head/usr.sbin/lastlogin/lastlogin.c ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.c Wed Dec 9 19:46:56 2009 (r200302) +++ head/usr.sbin/lastlogin/lastlogin.c Wed Dec 9 20:05:37 2009 (r200303) @@ -36,20 +36,16 @@ __RCSID("$FreeBSD$"); __RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $"); #endif -#include #include #include #include #include #include -#include -#include +#include #include -static const char *logfile = _PATH_LASTLOG; - int main(int, char **); -static void output(struct passwd *, struct lastlog *); +static void output(struct ulog_utmpx *); static void usage(void); int @@ -58,72 +54,51 @@ main(argc, argv) char *argv[]; { int ch, i; - FILE *fp; - struct passwd *passwd; - struct lastlog last; + struct ulog_utmpx *u; while ((ch = getopt(argc, argv, "")) != -1) { usage(); } - fp = fopen(logfile, "r"); - if (fp == NULL) - err(1, "%s", logfile); + if (ulog_setutxfile(UTXF_LASTLOG, NULL) != 0) + errx(1, "failed to open lastlog database"); setpassent(1); /* Keep passwd file pointers open */ /* Process usernames given on the command line. */ if (argc > 1) { - long offset; for (i = 1; i < argc; ++i) { - if ((passwd = getpwnam(argv[i])) == NULL) { + if ((u = ulog_getutxuser(argv[i])) == NULL) { warnx("user '%s' not found", argv[i]); continue; } - /* Calculate the offset into the lastlog file. */ - offset = (long)(passwd->pw_uid * sizeof(last)); - if (fseek(fp, offset, SEEK_SET)) { - warn("fseek error"); - continue; - } - if (fread(&last, sizeof(last), 1, fp) != 1) { - warnx("fread error on '%s'", passwd->pw_name); - clearerr(fp); - continue; - } - output(passwd, &last); + output(u); } } /* Read all lastlog entries, looking for active ones */ else { - for (i = 0; fread(&last, sizeof(last), 1, fp) == 1; i++) { - if (last.ll_time == 0) + while ((u = ulog_getutxent()) != NULL) { + if (u->ut_type != USER_PROCESS) continue; - if ((passwd = getpwuid((uid_t)i)) != NULL) - output(passwd, &last); + output(u); } - if (ferror(fp)) - warnx("fread error"); } setpassent(0); /* Close passwd file pointers */ - fclose(fp); + ulog_endutxent(); exit(0); } /* Duplicate the output of last(1) */ static void -output(p, l) - struct passwd *p; - struct lastlog *l; +output(struct ulog_utmpx *u) { - time_t t = _int_to_time(l->ll_time); - printf("%-*.*s %-*.*s %-*.*s %s", - UT_NAMESIZE, UT_NAMESIZE, p->pw_name, - UT_LINESIZE, UT_LINESIZE, l->ll_line, - UT_HOSTSIZE, UT_HOSTSIZE, l->ll_host, - (l->ll_time) ? ctime(&t) : "Never logged in\n"); + time_t t = u->ut_tv.tv_sec; + + printf("%-16s %-8s %-16s %s", + u->ut_user, u->ut_line, u->ut_host, + (u->ut_type == USER_PROCESS) ? ctime(&t) : "Never logged in\n"); } static void From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:15:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76270106566C; Wed, 9 Dec 2009 20:15:05 +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 64AF78FC14; Wed, 9 Dec 2009 20:15: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 nB9KF5v8035805; Wed, 9 Dec 2009 20:15:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9KF59X035803; Wed, 9 Dec 2009 20:15:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092015.nB9KF59X035803@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 20:15: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: r200304 - head/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:15:05 -0000 Author: thompsa Date: Wed Dec 9 20:15:05 2009 New Revision: 200304 URL: http://svn.freebsd.org/changeset/base/200304 Log: If the ID byte is non zero then we allow descriptors having multiple sizes. Submitted by: HPS Reported by: daichi Modified: head/sys/dev/usb/input/uhid.c Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Wed Dec 9 20:05:37 2009 (r200303) +++ head/sys/dev/usb/input/uhid.c Wed Dec 9 20:15:05 2009 (r200304) @@ -173,12 +173,21 @@ uhid_intr_callback(struct usb_xfer *xfer DPRINTF("transferred!\n"); pc = usbd_xfer_get_frame(xfer, 0); - if (actlen >= sc->sc_isize) { + + /* + * If the ID byte is non zero we allow descriptors + * having multiple sizes: + */ + if ((actlen >= sc->sc_isize) || + ((actlen > 0) && (sc->sc_iid != 0))) { + /* limit report length to the maximum */ + if (actlen > sc->sc_isize) + actlen = sc->sc_isize; usb_fifo_put_data(sc->sc_fifo.fp[USB_FIFO_RX], pc, - 0, sc->sc_isize, 1); + 0, actlen, 1); } else { /* ignore it */ - DPRINTF("ignored short transfer, %d bytes\n", actlen); + DPRINTF("ignored transfer, %d bytes\n", actlen); } case USB_ST_SETUP: From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:17:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2F4B10656C1; Wed, 9 Dec 2009 20:17:22 +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 D1BB18FC25; Wed, 9 Dec 2009 20: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 nB9KHM54035889; Wed, 9 Dec 2009 20:17:22 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9KHMI1035886; Wed, 9 Dec 2009 20:17:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092017.nB9KHMI1035886@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 20: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: r200305 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:17:23 -0000 Author: thompsa Date: Wed Dec 9 20:17:22 2009 New Revision: 200305 URL: http://svn.freebsd.org/changeset/base/200305 Log: Correct name, 82801IJ -> 82801JI Submitted by: mitya_cabletv.dp.ua Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/uhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Wed Dec 9 20:15:05 2009 (r200304) +++ head/sys/dev/usb/controller/ehci_pci.c Wed Dec 9 20:17:22 2009 (r200305) @@ -194,9 +194,9 @@ ehci_pci_match(device_t self) case 0x293c8086: return "Intel 82801I (ICH9) USB 2.0 controller"; case 0x3a3a8086: - return "Intel 82801IJ (ICH10) USB 2.0 controller USB-A"; + return "Intel 82801JI (ICH10) USB 2.0 controller USB-A"; case 0x3a3c8086: - return "Intel 82801IJ (ICH10) USB 2.0 controller USB-B"; + return "Intel 82801JI (ICH10) USB 2.0 controller USB-B"; case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); Modified: head/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/uhci_pci.c Wed Dec 9 20:15:05 2009 (r200304) +++ head/sys/dev/usb/controller/uhci_pci.c Wed Dec 9 20:17:22 2009 (r200305) @@ -231,17 +231,17 @@ uhci_pci_match(device_t self) case 0x29398086: return ("Intel 82801I (ICH9) USB controller"); case 0x3a348086: - return ("Intel 82801IJ (ICH10) USB controller USB-A"); + return ("Intel 82801JI (ICH10) USB controller USB-A"); case 0x3a358086: - return ("Intel 82801IJ (ICH10) USB controller USB-B"); + return ("Intel 82801JI (ICH10) USB controller USB-B"); case 0x3a368086: - return ("Intel 82801IJ (ICH10) USB controller USB-C"); + return ("Intel 82801JI (ICH10) USB controller USB-C"); case 0x3a378086: - return ("Intel 82801IJ (ICH10) USB controller USB-D"); + return ("Intel 82801JI (ICH10) USB controller USB-D"); case 0x3a388086: - return ("Intel 82801IJ (ICH10) USB controller USB-E"); + return ("Intel 82801JI (ICH10) USB controller USB-E"); case 0x3a398086: - return ("Intel 82801IJ (ICH10) USB controller USB-F"); + return ("Intel 82801JI (ICH10) USB controller USB-F"); case 0x719a8086: return ("Intel 82443MX USB controller"); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:24:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 445061065676; Wed, 9 Dec 2009 20:24:50 +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 2876C8FC16; Wed, 9 Dec 2009 20:24: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 nB9KOotF036155; Wed, 9 Dec 2009 20:24:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9KOoix036151; Wed, 9 Dec 2009 20:24:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092024.nB9KOoix036151@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 20:24: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: r200306 - in head/sys/dev/usb: . net serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:24:50 -0000 Author: thompsa Date: Wed Dec 9 20:24:49 2009 New Revision: 200306 URL: http://svn.freebsd.org/changeset/base/200306 Log: Add new device ids. PR: usb/140951, usb/140923 Submitted by: Romain Tartiere, Brett Glass Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Wed Dec 9 20:17:22 2009 (r200305) +++ head/sys/dev/usb/net/if_axe.c Wed Dec 9 20:24:49 2009 (r200306) @@ -141,6 +141,7 @@ static const struct usb_device_id axe_de {USB_VPI(USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88172, 0)}, {USB_VPI(USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88178, AXE_FLAG_178)}, {USB_VPI(USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88772, AXE_FLAG_772)}, + {USB_VPI(USB_VENDOR_ASIX, USB_PRODUCT_ASIX_AX88772A, AXE_FLAG_772)}, {USB_VPI(USB_VENDOR_ATEN, USB_PRODUCT_ATEN_UC210T, 0)}, {USB_VPI(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5D5055, AXE_FLAG_178)}, {USB_VPI(USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB2AR, 0)}, Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Dec 9 20:17:22 2009 (r200305) +++ head/sys/dev/usb/serial/uftdi.c Wed Dec 9 20:24:49 2009 (r200306) @@ -221,6 +221,7 @@ static struct usb_device_id uftdi_devs[] {USB_VPI(USB_VENDOR_DRESDENELEKTRONIK, USB_PRODUCT_DRESDENELEKTRONIK_WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U100AX, UFTDI_TYPE_SIO)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_2232C, UFTDI_TYPE_8U232AM)}, + {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_2232D, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U232AM, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SERIAL_8U232AM4, UFTDI_TYPE_8U232AM)}, {USB_VPI(USB_VENDOR_FTDI, USB_PRODUCT_FTDI_SEMC_DSS20, UFTDI_TYPE_8U232AM)}, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Dec 9 20:17:22 2009 (r200305) +++ head/sys/dev/usb/usbdevs Wed Dec 9 20:24:49 2009 (r200306) @@ -904,6 +904,7 @@ product ASANTE EA 0x1427 Ethernet product ASIX AX88172 0x1720 10/100 Ethernet product ASIX AX88178 0x1780 AX88178 product ASIX AX88772 0x7720 AX88772 +product ASIX AX88772A 0x772a AX88772A USB 2.0 10/100 Ethernet /* ASUS products */ product ASUS WL167G 0x1707 WL-167g Wireless Adapter @@ -1320,6 +1321,7 @@ product FTDI SERIAL_8U100AX 0x8372 8U100 product FTDI SERIAL_8U232AM 0x6001 8U232AM Serial product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial +product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:27:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42F151065679; Wed, 9 Dec 2009 20:27:07 +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 315E08FC15; Wed, 9 Dec 2009 20:27: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 nB9KR7KG036269; Wed, 9 Dec 2009 20:27:07 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9KR7qE036266; Wed, 9 Dec 2009 20:27:07 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092027.nB9KR7qE036266@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 20:27: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: r200307 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:27:07 -0000 Author: thompsa Date: Wed Dec 9 20:27:06 2009 New Revision: 200307 URL: http://svn.freebsd.org/changeset/base/200307 Log: Fix dwSignature for NCM mode and add extra debug output. Submitted by: HPS Modified: head/sys/dev/usb/net/if_cdce.c Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Wed Dec 9 20:24:49 2009 (r200306) +++ head/sys/dev/usb/net/if_cdce.c Wed Dec 9 20:27:06 2009 (r200307) @@ -1098,7 +1098,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer sc->sc_ncm.dpt.dwSignature[0] = 'N'; sc->sc_ncm.dpt.dwSignature[1] = 'C'; sc->sc_ncm.dpt.dwSignature[2] = 'M'; - sc->sc_ncm.dpt.dwSignature[3] = 'x'; + sc->sc_ncm.dpt.dwSignature[3] = '0'; USETW(sc->sc_ncm.dpt.wNextNdpIndex, 0); /* reserved */ usbd_copy_in(pc, 0, &(sc->sc_ncm.hdr), sizeof(sc->sc_ncm.hdr)); @@ -1182,7 +1182,7 @@ cdce_ncm_bulk_read_callback(struct usb_x if (actlen < (sizeof(sc->sc_ncm.hdr) + sizeof(sc->sc_ncm.dpt))) { DPRINTFN(1, "frame too short\n"); - goto tr_stall; + goto tr_setup; } usbd_copy_out(pc, 0, &(sc->sc_ncm.hdr), sizeof(sc->sc_ncm.hdr)); @@ -1191,7 +1191,12 @@ cdce_ncm_bulk_read_callback(struct usb_x (sc->sc_ncm.hdr.dwSignature[1] != 'C') || (sc->sc_ncm.hdr.dwSignature[2] != 'M') || (sc->sc_ncm.hdr.dwSignature[3] != 'H')) { - DPRINTFN(1, "invalid HDR signature\n"); + DPRINTFN(1, "invalid HDR signature: " + "0x%02x:0x%02x:0x%02x:0x%02x\n", + sc->sc_ncm.hdr.dwSignature[0], + sc->sc_ncm.hdr.dwSignature[1], + sc->sc_ncm.hdr.dwSignature[2], + sc->sc_ncm.hdr.dwSignature[3]); goto tr_stall; } temp = UGETW(sc->sc_ncm.hdr.wBlockLength); @@ -1202,7 +1207,7 @@ cdce_ncm_bulk_read_callback(struct usb_x } temp = UGETW(sc->sc_ncm.hdr.wDptIndex); if ((temp + sizeof(sc->sc_ncm.dpt)) > actlen) { - DPRINTFN(1, "invalid DPT index\n"); + DPRINTFN(1, "invalid DPT index: 0x%04x\n", temp); goto tr_stall; } usbd_copy_out(pc, temp, &(sc->sc_ncm.dpt), @@ -1211,8 +1216,13 @@ cdce_ncm_bulk_read_callback(struct usb_x if ((sc->sc_ncm.dpt.dwSignature[0] != 'N') || (sc->sc_ncm.dpt.dwSignature[1] != 'C') || (sc->sc_ncm.dpt.dwSignature[2] != 'M') || - (sc->sc_ncm.dpt.dwSignature[3] != 'x')) { - DPRINTFN(1, "invalid DPT signature\n"); + (sc->sc_ncm.dpt.dwSignature[3] != '0')) { + DPRINTFN(1, "invalid DPT signature" + "0x%02x:0x%02x:0x%02x:0x%02x\n", + sc->sc_ncm.dpt.dwSignature[0], + sc->sc_ncm.dpt.dwSignature[1], + sc->sc_ncm.dpt.dwSignature[2], + sc->sc_ncm.dpt.dwSignature[3]); goto tr_stall; } nframes = UGETW(sc->sc_ncm.dpt.wLength) / 4; @@ -1284,6 +1294,7 @@ cdce_ncm_bulk_read_callback(struct usb_x DPRINTFN(1, "Efficiency: %u/%u bytes\n", sumdata, actlen); case USB_ST_SETUP: +tr_setup: usbd_xfer_set_frame_len(xfer, 0, sc->sc_ncm.rx_max); usbd_xfer_set_frames(xfer, 1); usbd_transfer_submit(xfer); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:28:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7319410656C1; Wed, 9 Dec 2009 20:28:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 618358FC19; Wed, 9 Dec 2009 20:28: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 nB9KSXPo036331; Wed, 9 Dec 2009 20:28:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9KSXSZ036329; Wed, 9 Dec 2009 20:28:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092028.nB9KSXSZ036329@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 20:28: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: r200308 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:28:33 -0000 Author: thompsa Date: Wed Dec 9 20:28:33 2009 New Revision: 200308 URL: http://svn.freebsd.org/changeset/base/200308 Log: Fix hardware issue with FTDI chips: avoid sending a zero length packet due to hardware sending garbage on ZLPs. Reported by: Corey Smith Submitted by: HPS Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Wed Dec 9 20:27:06 2009 (r200307) +++ head/sys/dev/usb/serial/uftdi.c Wed Dec 9 20:28:33 2009 (r200308) @@ -165,7 +165,7 @@ static const struct usb_config uftdi_con .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = UFTDI_OBUFSIZE, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = {.pipe_bof = 1,}, .callback = &uftdi_write_callback, }, From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 20:36:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C911B106568B; Wed, 9 Dec 2009 20:36:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B74358FC25; Wed, 9 Dec 2009 20:36: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 nB9KauuS036547; Wed, 9 Dec 2009 20:36:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9KauhL036544; Wed, 9 Dec 2009 20:36:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912092036.nB9KauhL036544@svn.freebsd.org> From: John Baldwin Date: Wed, 9 Dec 2009 20:36: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: r200309 - in head/sys/boot: i386/zfsboot zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 20:36:56 -0000 Author: jhb Date: Wed Dec 9 20:36:56 2009 New Revision: 200309 URL: http://svn.freebsd.org/changeset/base/200309 Log: - Port bios_getmem() from libi386 to {gpt,}zfsboot() and use it to safely allocate a heap region above 1MB. This enables {gpt,}zfsboot() to allocate much larger buffers than before. - Use a larger buffer (1MB instead of 128K) for temporary ZFS buffers. This allows more reliable reading of compressed files in a raidz/raidz2 pool. Submitted by: Matt Reimer mattjreimer of gmail MFC after: 1 week Modified: head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Wed Dec 9 20:28:33 2009 (r200308) +++ head/sys/boot/i386/zfsboot/zfsboot.c Wed Dec 9 20:36:56 2009 (r200309) @@ -27,6 +27,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -90,8 +91,6 @@ __FBSDID("$FreeBSD$"); #define ARGS 0x900 #define NOPT 14 #define NDEV 3 -#define MEM_BASE 0x12 -#define MEM_EXT 0x15 #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) @@ -149,6 +148,19 @@ static struct bootinfo bootinfo; static uint32_t bootdev; static uint8_t ioctrl = IO_KEYBOARD; +vm_offset_t high_heap_base; +uint32_t bios_basemem, bios_extmem, high_heap_size; + +static struct bios_smap smap; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + +static char *heap_next; +static char *heap_end; + /* Buffers that must not span a 64k boundary. */ #define READ_BUF_SIZE 8192 struct dmadat { @@ -162,7 +174,7 @@ static void load(void); static int parse(void); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); +static void bios_getmem(void); static int drvread(struct dsk *, void *, daddr_t, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -237,14 +249,6 @@ memset(void *p, char val, size_t n) static void * malloc(size_t n) { - static char *heap_next; - static char *heap_end; - - if (!heap_next) { - heap_next = (char *) dmadat + sizeof(*dmadat); - heap_end = (char *) (640*1024); - } - char *p = heap_next; if (p + n > heap_end) { printf("malloc failure\n"); @@ -344,14 +348,91 @@ xfsread(const dnode_phys_t *dnode, off_t return 0; } -static inline uint32_t -memsize(void) +static void +bios_getmem(void) { - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} + uint64_t size; + + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { + bios_extmem = smap.length; + } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); + + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); + + bios_basemem = (v86.eax & 0xffff) * 1024; + } + + /* Fall back through several compatibility functions for extended memory */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + } + } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ + v86.eax = 0x8800; + v86int(); + bios_extmem = (v86.eax & 0xffff) * 1024; + } + + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } +} static inline void getstr(void) @@ -536,6 +617,16 @@ main(void) off_t off; struct dsk *dsk; + bios_getmem(); + + if (high_heap_size > 0) { + heap_end = PTOV(high_heap_base + high_heap_size); + heap_next = PTOV(high_heap_base); + } else { + heap_next = (char *) dmadat + sizeof(*dmadat); + heap_end = (char *) PTOV(bios_basemem); + } + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -550,8 +641,8 @@ main(void) bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); + bootinfo.bi_basemem = bios_basemem / 1024; + bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk->drive; Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Dec 9 20:28:33 2009 (r200308) +++ head/sys/boot/zfs/zfsimpl.c Wed Dec 9 20:36:56 2009 (r200309) @@ -51,7 +51,7 @@ static char *dnode_cache_buf; static char *zap_scratch; static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_ptr; -#define TEMP_SIZE (1*SPA_MAXBLOCKSIZE) +#define TEMP_SIZE (1024 * 1024) static int zio_read(spa_t *spa, const blkptr_t *bp, void *buf); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:09:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C497710656C4; Wed, 9 Dec 2009 21:09:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 989798FC16; Wed, 9 Dec 2009 21:09: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 nB9L9WNj037230; Wed, 9 Dec 2009 21:09:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9L9WPF037227; Wed, 9 Dec 2009 21:09:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912092109.nB9L9WPF037227@svn.freebsd.org> From: John Baldwin Date: Wed, 9 Dec 2009 21:09: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: r200310 - in head/sys/boot/i386: gptboot zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:09:32 -0000 Author: jhb Date: Wed Dec 9 21:09:32 2009 New Revision: 200310 URL: http://svn.freebsd.org/changeset/base/200310 Log: Fix a confusing typo in the EDD packet structure used in gptboot and gptzfsboot. I got the segment and offset fields reversed in the structure, but I also succeeded in crossing the assignments so the actual EDD packet ended up correct. MFC after: 1 week Modified: head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Wed Dec 9 20:36:56 2009 (r200309) +++ head/sys/boot/i386/gptboot/gptboot.c Wed Dec 9 21:09:32 2009 (r200310) @@ -642,8 +642,8 @@ bcmp(const void *b1, const void *b2, siz static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; @@ -656,8 +656,8 @@ drvread(void *buf, daddr_t lba, unsigned printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba; v86.ctl = V86_FLAGS; v86.addr = 0x13; Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Wed Dec 9 20:36:56 2009 (r200309) +++ head/sys/boot/i386/zfsboot/zfsboot.c Wed Dec 9 21:09:32 2009 (r200310) @@ -1049,8 +1049,8 @@ putchar(int c) static struct { uint16_t len; uint16_t count; - uint16_t seg; uint16_t off; + uint16_t seg; uint64_t lba; } packet; #endif @@ -1065,8 +1065,8 @@ drvread(struct dsk *dsk, void *buf, dadd printf("%c\b", c = c << 8 | c >> 24); packet.len = 0x10; packet.count = nblk; - packet.seg = VTOPOFF(buf); - packet.off = VTOPSEG(buf); + packet.off = VTOPOFF(buf); + packet.seg = VTOPSEG(buf); packet.lba = lba + dsk->start; v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:18:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57EA0106566B; Wed, 9 Dec 2009 21:18:56 +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 46A158FC14; Wed, 9 Dec 2009 21:18: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 nB9LIusf038088; Wed, 9 Dec 2009 21:18:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9LIuEL038086; Wed, 9 Dec 2009 21:18:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912092118.nB9LIuEL038086@svn.freebsd.org> From: Ed Schouten Date: Wed, 9 Dec 2009 21:18: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: r200311 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:18:56 -0000 Author: ed Date: Wed Dec 9 21:18:56 2009 New Revision: 200311 URL: http://svn.freebsd.org/changeset/base/200311 Log: Add missing relation between philip and I. It seems I forgot this when I became a committer last year. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Dec 9 21:09:32 2009 (r200310) +++ head/share/misc/committers-src.dot Wed Dec 9 21:18:56 2009 (r200311) @@ -384,6 +384,7 @@ peter -> asmodai peter -> jayanth peter -> ps +philip -> ed philip -> jls philip -> matteo From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:34:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C0221065670; Wed, 9 Dec 2009 21:34:39 +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 389518FC08; Wed, 9 Dec 2009 21:34: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 nB9LYdZV039142; Wed, 9 Dec 2009 21:34:39 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9LYdDe039136; Wed, 9 Dec 2009 21:34:39 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092134.nB9LYdDe039136@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 21:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200312 - stable/8/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:34:39 -0000 Author: thompsa Date: Wed Dec 9 21:34:38 2009 New Revision: 200312 URL: http://svn.freebsd.org/changeset/base/200312 Log: MFC r199575 - fix a transfer cancelling bug/segfault [1] - correct a return code in the transfer cancel function. - add new API function, libusb20_tr_bulk_intr_sync(). Submitted by: HPS Reported by: Robert Jenssen [1] Modified: stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb10.h stable/8/lib/libusb/libusb20.3 stable/8/lib/libusb/libusb20.c stable/8/lib/libusb/libusb20.h Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Wed Dec 9 21:18:56 2009 (r200311) +++ stable/8/lib/libusb/libusb10.c Wed Dec 9 21:34:38 2009 (r200312) @@ -833,8 +833,12 @@ libusb10_complete_transfer(struct libusb if (pxfer != NULL) libusb20_tr_set_priv_sc1(pxfer, NULL); + /* set transfer status */ uxfer->status = status; + /* update super transfer state */ + sxfer->state = LIBUSB_SUPER_XFER_ST_NONE; + dev = libusb_get_device(uxfer->dev_handle); TAILQ_INSERT_TAIL(&dev->ctx->tr_done, sxfer, entry); @@ -1111,6 +1115,8 @@ libusb10_submit_transfer_sub(struct libu return; case 2: sxfer = libusb20_tr_get_priv_sc1(pxfer1); + if (sxfer == NULL) + return; /* cancelling */ if (sxfer->rem_len) return; /* cannot queue another one */ /* swap transfers */ @@ -1118,6 +1124,8 @@ libusb10_submit_transfer_sub(struct libu break; case 1: sxfer = libusb20_tr_get_priv_sc1(pxfer0); + if (sxfer == NULL) + return; /* cancelling */ if (sxfer->rem_len) return; /* cannot queue another one */ /* swap transfers */ @@ -1229,12 +1237,18 @@ libusb_submit_transfer(struct libusb_tra if (pxfer0 == NULL || pxfer1 == NULL) { err = LIBUSB_ERROR_OTHER; } else if ((sxfer->entry.tqe_prev != NULL) || - (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) || + (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) || (libusb20_tr_get_priv_sc1(pxfer1) == sxfer)) { err = LIBUSB_ERROR_BUSY; } else { + + /* set pending state */ + sxfer->state = LIBUSB_SUPER_XFER_ST_PEND; + + /* insert transfer into transfer head list */ TAILQ_INSERT_TAIL(&dev->tr_head, sxfer, entry); + /* start work transfers */ libusb10_submit_transfer_sub( uxfer->dev_handle, endpoint); @@ -1258,12 +1272,14 @@ libusb_cancel_transfer(struct libusb_tra struct libusb_super_transfer *sxfer; struct libusb_device *dev; uint32_t endpoint; + int retval; if (uxfer == NULL) return (LIBUSB_ERROR_INVALID_PARAM); + /* check if not initialised */ if (uxfer->dev_handle == NULL) - return (LIBUSB_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_NOT_FOUND); endpoint = uxfer->endpoint; @@ -1277,39 +1293,50 @@ libusb_cancel_transfer(struct libusb_tra sxfer = (struct libusb_super_transfer *)( (uint8_t *)uxfer - sizeof(*sxfer)); + retval = 0; + CTX_LOCK(dev->ctx); pxfer0 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 0); pxfer1 = libusb10_get_transfer(uxfer->dev_handle, endpoint, 1); - if (sxfer->entry.tqe_prev != NULL) { + if (sxfer->state != LIBUSB_SUPER_XFER_ST_PEND) { + /* only update the transfer status */ + uxfer->status = LIBUSB_TRANSFER_CANCELLED; + retval = LIBUSB_ERROR_NOT_FOUND; + } else if (sxfer->entry.tqe_prev != NULL) { /* we are lucky - transfer is on a queue */ TAILQ_REMOVE(&dev->tr_head, sxfer, entry); sxfer->entry.tqe_prev = NULL; - libusb10_complete_transfer(NULL, sxfer, LIBUSB_TRANSFER_CANCELLED); + libusb10_complete_transfer(NULL, + sxfer, LIBUSB_TRANSFER_CANCELLED); } else if (pxfer0 == NULL || pxfer1 == NULL) { /* not started */ + retval = LIBUSB_ERROR_NOT_FOUND; } else if (libusb20_tr_get_priv_sc1(pxfer0) == sxfer) { - libusb10_complete_transfer(pxfer0, sxfer, LIBUSB_TRANSFER_CANCELLED); + libusb10_complete_transfer(pxfer0, + sxfer, LIBUSB_TRANSFER_CANCELLED); libusb20_tr_stop(pxfer0); /* make sure the queue doesn't stall */ libusb10_submit_transfer_sub( uxfer->dev_handle, endpoint); } else if (libusb20_tr_get_priv_sc1(pxfer1) == sxfer) { - libusb10_complete_transfer(pxfer1, sxfer, LIBUSB_TRANSFER_CANCELLED); + libusb10_complete_transfer(pxfer1, + sxfer, LIBUSB_TRANSFER_CANCELLED); libusb20_tr_stop(pxfer1); /* make sure the queue doesn't stall */ libusb10_submit_transfer_sub( uxfer->dev_handle, endpoint); } else { /* not started */ + retval = LIBUSB_ERROR_NOT_FOUND; } CTX_UNLOCK(dev->ctx); DPRINTF(dev->ctx, LIBUSB_DEBUG_FUNCTION, "libusb_cancel_transfer leave"); - return (0); + return (retval); } UNEXPORTED void Modified: stable/8/lib/libusb/libusb10.h ============================================================================== --- stable/8/lib/libusb/libusb10.h Wed Dec 9 21:18:56 2009 (r200311) +++ stable/8/lib/libusb/libusb10.h Wed Dec 9 21:34:38 2009 (r200312) @@ -65,7 +65,9 @@ struct libusb_super_transfer { uint8_t *curr_data; uint32_t rem_len; uint32_t last_len; - uint8_t flags; + uint8_t state; +#define LIBUSB_SUPER_XFER_ST_NONE 0 +#define LIBUSB_SUPER_XFER_ST_PEND 1 }; struct libusb_context { Modified: stable/8/lib/libusb/libusb20.3 ============================================================================== --- stable/8/lib/libusb/libusb20.3 Wed Dec 9 21:18:56 2009 (r200311) +++ stable/8/lib/libusb/libusb20.3 Wed Dec 9 21:34:38 2009 (r200312) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2009 +.Dd November 18, 2009 .Dt LIBUSB20 3 .Os .Sh NAME @@ -98,6 +98,8 @@ USB access library (libusb -lusb) .Fn libusb20_tr_setup_intr "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t timeout" .Ft void .Fn libusb20_tr_setup_isoc "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint61_t fr_index" +.Ft uint8_t +.Fn libusb20_tr_bulk_intr_sync "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t *pactlen" "uint32_t timeout" .Ft void .Fn libusb20_tr_start "struct libusb20_transfer *xfer" .Ft void @@ -451,6 +453,29 @@ is a helper function for setting up a mu . .Pp . +.Fn libusb20_tr_bulk_intr_sync +will perform a synchronous BULK or INTERRUPT transfer having length given by the +.Fa length +argument and buffer pointer given by the +.Fa pbuf +argument on the USB transfer given by the +.Fa xfer +argument. +. +If the +.Fa pactlen +argument is non-NULL the actual transfer length will be stored at the given pointer destination. +. +If the +.Fa timeout +argument is non-zero the transfer will timeout after the given value in milliseconds. +. +This function does not change the transfer flags, like short packet not ok. +. +This function returns zero on success else a LIBUSB20_TRANSFER_XXX value is returned. +. +.Pp +. .Fn libusb20_tr_start will get the USB transfer started, if not already started. Modified: stable/8/lib/libusb/libusb20.c ============================================================================== --- stable/8/lib/libusb/libusb20.c Wed Dec 9 21:18:56 2009 (r200311) +++ stable/8/lib/libusb/libusb20.c Wed Dec 9 21:34:38 2009 (r200312) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2009 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 @@ -263,6 +263,10 @@ libusb20_tr_get_priv_sc1(struct libusb20 void libusb20_tr_stop(struct libusb20_transfer *xfer) { + if (!xfer->is_opened) { + /* transfer is not opened */ + return; + } if (!xfer->is_pending) { /* transfer not pending */ return; @@ -280,6 +284,10 @@ libusb20_tr_stop(struct libusb20_transfe void libusb20_tr_drain(struct libusb20_transfer *xfer) { + if (!xfer->is_opened) { + /* transfer is not opened */ + return; + } /* make sure that we are cancelling */ libusb20_tr_stop(xfer); @@ -415,9 +423,79 @@ libusb20_tr_setup_isoc(struct libusb20_t return; } +uint8_t +libusb20_tr_bulk_intr_sync(struct libusb20_transfer *xfer, + void *pbuf, uint32_t length, uint32_t *pactlen, + uint32_t timeout) +{ + struct libusb20_device *pdev = xfer->pdev; + uint32_t transfer_max; + uint32_t transfer_act; + uint8_t retval; + + /* set some sensible default value */ + if (pactlen != NULL) + *pactlen = 0; + + /* check for error condition */ + if (libusb20_tr_pending(xfer)) + return (LIBUSB20_ERROR_OTHER); + + do { + /* compute maximum transfer length */ + transfer_max = + libusb20_tr_get_max_total_length(xfer); + + if (transfer_max > length) + transfer_max = length; + + /* setup bulk or interrupt transfer */ + libusb20_tr_setup_bulk(xfer, pbuf, + transfer_max, timeout); + + /* start the transfer */ + libusb20_tr_start(xfer); + + /* wait for transfer completion */ + while (libusb20_dev_process(pdev) == 0) { + + if (libusb20_tr_pending(xfer) == 0) + break; + + libusb20_dev_wait_process(pdev, -1); + } + + transfer_act = libusb20_tr_get_actual_length(xfer); + + /* update actual length, if any */ + if (pactlen != NULL) + pactlen[0] += transfer_act; + + /* check transfer status */ + retval = libusb20_tr_get_status(xfer); + if (retval) + break; + + /* check for short transfer */ + if (transfer_act != transfer_max) + break; + + /* update buffer pointer and length */ + pbuf = ((uint8_t *)pbuf) + transfer_max; + length = length - transfer_max; + + } while (length != 0); + + return (retval); +} + void libusb20_tr_submit(struct libusb20_transfer *xfer) { + if (!xfer->is_opened) { + /* transfer is not opened */ + return; + } if (xfer->is_pending) { /* should not happen */ return; @@ -433,6 +511,10 @@ libusb20_tr_submit(struct libusb20_trans void libusb20_tr_start(struct libusb20_transfer *xfer) { + if (!xfer->is_opened) { + /* transfer is not opened */ + return; + } if (xfer->is_pending) { if (xfer->is_cancel) { /* cancelling - restart */ @@ -461,7 +543,14 @@ libusb20_dev_close(struct libusb20_devic for (x = 0; x != pdev->nTransfer; x++) { xfer = pdev->pTransfer + x; + if (!xfer->is_opened) { + /* transfer is not opened */ + continue; + } + libusb20_tr_drain(xfer); + + libusb20_tr_close(xfer); } if (pdev->pTransfer != NULL) { Modified: stable/8/lib/libusb/libusb20.h ============================================================================== --- stable/8/lib/libusb/libusb20.h Wed Dec 9 21:18:56 2009 (r200311) +++ stable/8/lib/libusb/libusb20.h Wed Dec 9 21:34:38 2009 (r200312) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2009 Hans Petter Selasky. All rights reserved. * Copyright (c) 2007-2008 Daniel Drake. All rights reserved. * Copyright (c) 2001 Johannes Erdfelt. All rights reserved. * @@ -226,6 +226,7 @@ void libusb20_tr_setup_bulk(struct libus void libusb20_tr_setup_control(struct libusb20_transfer *xfer, void *psetup, void *pbuf, uint32_t timeout); void libusb20_tr_setup_intr(struct libusb20_transfer *xfer, void *pbuf, uint32_t length, uint32_t timeout); void libusb20_tr_setup_isoc(struct libusb20_transfer *xfer, void *pbuf, uint32_t length, uint16_t fr_index); +uint8_t libusb20_tr_bulk_intr_sync(struct libusb20_transfer *xfer, void *pbuf, uint32_t length, uint32_t *pactlen, uint32_t timeout); void libusb20_tr_start(struct libusb20_transfer *xfer); void libusb20_tr_stop(struct libusb20_transfer *xfer); void libusb20_tr_submit(struct libusb20_transfer *xfer); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:39:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCD02106566B; Wed, 9 Dec 2009 21:39:43 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB63A8FC19; Wed, 9 Dec 2009 21:39: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 nB9LdhAl039282; Wed, 9 Dec 2009 21:39:43 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9LdhwY039280; Wed, 9 Dec 2009 21:39:43 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912092139.nB9LdhwY039280@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 9 Dec 2009 21:39: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: r200313 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:39:43 -0000 Author: gavin Date: Wed Dec 9 21:39:43 2009 New Revision: 200313 URL: http://svn.freebsd.org/changeset/base/200313 Log: Add myself, and show ed@ as my mentor. Approved by: ed (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Wed Dec 9 21:34:38 2009 (r200312) +++ head/share/misc/committers-src.dot Wed Dec 9 21:39:43 2009 (r200313) @@ -94,6 +94,7 @@ fjoe [label="Max Khon\nfjoe@FreeBSD.org\ flz [label="Florent Thoumie\nflz@FreeBSD.org\n2006/03/30"] gad [label="Garance A. Drosehn\ngad@FreeBSD.org\n2000/10/27"] gallatin [label="Andrew Gallatin\ngallatin@FreeBSD.org\n????/??/??"] +gavin [label="Gavin Atkinson\ngavin@FreeBSD.org\n2009/12/07"] gibbs [label="Justin T. Gibbs\ngibbs@FreeBSD.org\n????/??/??"] glebius [label="Gleb Smirnoff\nglebius@FreeBSD.org\n2004/07/14"] gnn [label="George V. Neville-Neil\ngnn@FreeBSD.org\n2004/10/11"] @@ -254,6 +255,7 @@ dwmalone -> fanf dwmalone -> peadar dwmalone -> snb +ed -> gavin ed -> jilles eivind -> des From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:47:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E391065670; Wed, 9 Dec 2009 21:47:43 +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 E09DC8FC17; Wed, 9 Dec 2009 21:47: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 nB9Llgu6039545; Wed, 9 Dec 2009 21:47:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9LlgLX039541; Wed, 9 Dec 2009 21:47:42 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092147.nB9LlgLX039541@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 21:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200314 - in stable/8/sys: conf dev/usb/input modules/usb modules/usb/atp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:47:43 -0000 Author: thompsa Date: Wed Dec 9 21:47:42 2009 New Revision: 200314 URL: http://svn.freebsd.org/changeset/base/200314 Log: MFC r199086,199151,199680,199948,200241 Driver for the Apple Touchpad present on MacBook (non-Pro & Pro). Submitted by: Rohit Grover Added: stable/8/sys/dev/usb/input/atp.c - copied, changed from r199086, head/sys/dev/usb/input/atp.c stable/8/sys/modules/usb/atp/ - copied from r199086, head/sys/modules/usb/atp/ Modified: stable/8/sys/conf/files stable/8/sys/modules/usb/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Wed Dec 9 21:39:43 2009 (r200313) +++ stable/8/sys/conf/files Wed Dec 9 21:47:42 2009 (r200314) @@ -1669,6 +1669,7 @@ dev/usb/misc/udbp.c optional udbp # # USB input drivers # +dev/usb/input/atp.c optional atp dev/usb/input/uhid.c optional uhid dev/usb/input/ukbd.c optional ukbd dev/usb/input/ums.c optional ums Copied and modified: stable/8/sys/dev/usb/input/atp.c (from r199086, head/sys/dev/usb/input/atp.c) ============================================================================== --- head/sys/dev/usb/input/atp.c Mon Nov 9 15:59:09 2009 (r199086, copy source) +++ stable/8/sys/dev/usb/input/atp.c Wed Dec 9 21:47:42 2009 (r200314) @@ -193,21 +193,50 @@ SYSCTL_UINT(_hw_usb_atp, OID_AUTO, pspan &atp_pspan_max_width, 4, "maximum allowed width (in sensors) for pressure-spans"); +/* We support three payload protocols */ +typedef enum { + ATP_PROT_GEYSER1, + ATP_PROT_GEYSER2, + ATP_PROT_GEYSER3, +} atp_protocol; /* Define the various flavours of devices supported by this driver. */ enum { ATP_DEV_PARAMS_0, + ATP_DEV_PARAMS_PBOOK, + ATP_DEV_PARAMS_PBOOK_15A, + ATP_DEV_PARAMS_PBOOK_17, ATP_N_DEV_PARAMS }; struct atp_dev_params { u_int data_len; /* for sensor data */ u_int n_xsensors; u_int n_ysensors; + atp_protocol prot; } atp_dev_params[ATP_N_DEV_PARAMS] = { [ATP_DEV_PARAMS_0] = { .data_len = 64, .n_xsensors = 20, - .n_ysensors = 10 + .n_ysensors = 10, + .prot = ATP_PROT_GEYSER3 + }, + [ATP_DEV_PARAMS_PBOOK] = { + .data_len = 81, + .n_xsensors = 16, + .n_ysensors = 16, + .prot = ATP_PROT_GEYSER1 + }, + [ATP_DEV_PARAMS_PBOOK_15A] = { + .data_len = 64, + .n_xsensors = 15, + .n_ysensors = 9, + .prot = ATP_PROT_GEYSER2 + }, + [ATP_DEV_PARAMS_PBOOK_17] = { + .data_len = 81, + .n_xsensors = 26, + .n_ysensors = 16, + .prot = ATP_PROT_GEYSER1 }, }; @@ -226,6 +255,19 @@ static const struct usb_device_id atp_de { USB_VPI(USB_VENDOR_APPLE, 0x0229, ATP_DEV_PARAMS_0) }, { USB_VPI(USB_VENDOR_APPLE, 0x022a, ATP_DEV_PARAMS_0) }, { USB_VPI(USB_VENDOR_APPLE, 0x022b, ATP_DEV_PARAMS_0) }, + + /* 12 inch PowerBook and iBook */ + { USB_VPI(USB_VENDOR_APPLE, 0x030a, ATP_DEV_PARAMS_PBOOK) }, + { USB_VPI(USB_VENDOR_APPLE, 0x030b, ATP_DEV_PARAMS_PBOOK) }, + + /* 15 inch PowerBook */ + { USB_VPI(USB_VENDOR_APPLE, 0x020e, ATP_DEV_PARAMS_PBOOK) }, + { USB_VPI(USB_VENDOR_APPLE, 0x020f, ATP_DEV_PARAMS_PBOOK) }, + { USB_VPI(USB_VENDOR_APPLE, 0x0215, ATP_DEV_PARAMS_PBOOK_15A) }, + + /* 17 inch PowerBook */ + { USB_VPI(USB_VENDOR_APPLE, 0x020d, ATP_DEV_PARAMS_PBOOK_17) }, + }; /* @@ -299,6 +341,7 @@ typedef struct atp_stroke { enum { ATP_INTR_DT, + ATP_RESET, ATP_N_TRANSFER, }; @@ -321,6 +364,7 @@ struct atp_softc { #define ATP_ENABLED 0x01 #define ATP_ZOMBIES_EXIST 0x02 #define ATP_DOUBLE_TAP_DRAG 0x04 +#define ATP_VALID 0x08 u_int sc_left_margin; u_int sc_right_margin; @@ -378,21 +422,22 @@ static struct usb_fifo_methods atp_fifo_ /* device initialization and shutdown */ static usb_error_t atp_req_get_report(struct usb_device *udev, void *data); static int atp_set_device_mode(device_t dev, interface_mode mode); +static void atp_reset_callback(struct usb_xfer *, usb_error_t); static int atp_enable(struct atp_softc *sc); static void atp_disable(struct atp_softc *sc); static int atp_softc_populate(struct atp_softc *); static void atp_softc_unpopulate(struct atp_softc *); /* sensor interpretation */ -static __inline void atp_interpret_sensor_data(const int8_t *, u_int, u_int, - int *); +static __inline void atp_interpret_sensor_data(const int8_t *, u_int, atp_axis, + int *, atp_protocol); static __inline void atp_get_pressures(int *, const int *, const int *, int); static void atp_detect_pspans(int *, u_int, u_int, atp_pspan *, u_int *); /* movement detection */ static boolean_t atp_match_stroke_component(atp_stroke_component *, - const atp_pspan *); + const atp_pspan *, atp_stroke_type); static void atp_match_strokes_against_pspans(struct atp_softc *, atp_axis, atp_pspan *, u_int, u_int); static boolean_t atp_update_strokes(struct atp_softc *, @@ -413,6 +458,7 @@ static boolean_t atp_compute_stroke_ /* tap detection */ static __inline void atp_setup_reap_time(struct atp_softc *, struct timeval *); static void atp_reap_zombies(struct atp_softc *, u_int *, u_int *); +static void atp_convert_to_slide(struct atp_softc *, atp_stroke *); /* updating fifo */ static void atp_reset_buf(struct atp_softc *sc); @@ -458,6 +504,40 @@ atp_set_device_mode(device_t dev, interf return (0); } +void +atp_reset_callback(struct usb_xfer *xfer, usb_error_t error) +{ + usb_device_request_t req; + struct usb_page_cache *pc; + struct atp_softc *sc = usbd_xfer_softc(xfer); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_SETUP: + sc->sc_mode_bytes[0] = RAW_SENSOR_MODE; + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UR_SET_REPORT; + USETW2(req.wValue, + (uint8_t)0x03 /* type */, (uint8_t)0x00 /* id */); + USETW(req.wIndex, 0); + USETW(req.wLength, MODE_LENGTH); + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_in(pc, 0, &req, sizeof(req)); + pc = usbd_xfer_get_frame(xfer, 1); + usbd_copy_in(pc, 0, sc->sc_mode_bytes, MODE_LENGTH); + + usbd_xfer_set_frame_len(xfer, 0, sizeof(req)); + usbd_xfer_set_frame_len(xfer, 1, MODE_LENGTH); + usbd_xfer_set_frames(xfer, 2); + usbd_transfer_submit(xfer); + break; + + case USB_ST_TRANSFERRED: + default: + break; + } +} + static int atp_enable(struct atp_softc *sc) { @@ -483,7 +563,7 @@ atp_disable(struct atp_softc *sc) { atp_softc_unpopulate(sc); - sc->sc_state &= ~ATP_ENABLED; + sc->sc_state &= ~(ATP_ENABLED | ATP_VALID); DPRINTFN(ATP_LLEVEL_INFO, "disabled atp\n"); } @@ -623,25 +703,42 @@ atp_softc_unpopulate(struct atp_softc *s * raw sensor data from the USB packet. * num * The number of elements in the array 'arr'. - * di_start - * The index of the first data element to be interpreted for - * this sensor array--i.e. when called to interpret the Y - * sensors, di_start passed in as 2, which is the index of Y1 in - * the raw data. + * axis + * Axis of data to fetch * arr * The array to be initialized with the readings. + * prot + * The protocol to use to interpret the data */ static __inline void -atp_interpret_sensor_data(const int8_t *sensor_data, u_int num, u_int di_start, - int *arr) +atp_interpret_sensor_data(const int8_t *sensor_data, u_int num, atp_axis axis, + int *arr, atp_protocol prot) { u_int i; u_int di; /* index into sensor data */ - for (i = 0, di = di_start; i < num; /* empty */ ) { - arr[i++] = sensor_data[di++]; - arr[i++] = sensor_data[di++]; - di++; + switch (prot) { + case ATP_PROT_GEYSER1: + /* + * For Geyser 1, the sensors are laid out in pairs + * every 5 bytes. + */ + for (i = 0, di = (axis == Y) ? 1 : 2; i < 8; di += 5, i++) { + arr[i] = sensor_data[di]; + arr[i+8] = sensor_data[di+2]; + if (axis == X && num > 16) + arr[i+16] = sensor_data[di+40]; + } + + break; + case ATP_PROT_GEYSER2: + case ATP_PROT_GEYSER3: + for (i = 0, di = (axis == Y) ? 2 : 20; i < num; /* empty */ ) { + arr[i++] = sensor_data[di++]; + arr[i++] = sensor_data[di++]; + di++; + } + break; } } @@ -783,23 +880,43 @@ atp_detect_pspans(int *p, u_int num_sens */ static boolean_t atp_match_stroke_component(atp_stroke_component *component, - const atp_pspan *pspan) + const atp_pspan *pspan, atp_stroke_type stroke_type) { - int delta_mickeys = pspan->loc - component->loc; + int delta_mickeys; + u_int min_pressure; + + delta_mickeys = pspan->loc - component->loc; if (abs(delta_mickeys) > atp_max_delta_mickeys) return (FALSE); /* the finger span is too far out; no match */ component->loc = pspan->loc; + + /* + * A sudden and significant increase in a pspan's cumulative + * pressure indicates the incidence of a new finger + * contact. This usually revises the pspan's + * centre-of-gravity, and hence the location of any/all + * matching stroke component(s). But such a change should + * *not* be interpreted as a movement. + */ + if (pspan->cum > ((3 * component->cum_pressure) >> 1)) + delta_mickeys = 0; + component->cum_pressure = pspan->cum; if (pspan->cum > component->max_cum_pressure) component->max_cum_pressure = pspan->cum; /* - * If the cumulative pressure drops below a quarter of the max, - * then disregard the component's movement. + * Disregard the component's movement if its cumulative + * pressure drops below a fraction of the maximum; this + * fraction is determined based on the stroke's type. */ - if (component->cum_pressure < (component->max_cum_pressure >> 2)) + if (stroke_type == ATP_STROKE_TOUCH) + min_pressure = (3 * component->max_cum_pressure) >> 2; + else + min_pressure = component->max_cum_pressure >> 2; + if (component->cum_pressure < min_pressure) delta_mickeys = 0; component->delta_mickeys = delta_mickeys; @@ -834,7 +951,8 @@ atp_match_strokes_against_pspans(struct continue; /* skip matched pspans */ if (atp_match_stroke_component( - &stroke->components[axis], &pspans[j])) { + &stroke->components[axis], &pspans[j], + stroke->type)) { /* There is a match. */ stroke->components[axis].matched = TRUE; @@ -969,19 +1087,23 @@ atp_update_strokes(struct atp_softc *sc, for (i = 0; i < sc->sc_n_strokes; i++) { atp_stroke *stroke = &sc->sc_strokes[i]; - printf(" %s%clc:%u,dm:%d,pnd:%d,mv:%d%c" - ",%clc:%u,dm:%d,pnd:%d,mv:%d%c", + printf(" %s%clc:%u,dm:%d,pnd:%d,cum:%d,max:%d,mv:%d%c" + ",%clc:%u,dm:%d,pnd:%d,cum:%d,max:%d,mv:%d%c", (stroke->flags & ATSF_ZOMBIE) ? "zomb:" : "", (stroke->type == ATP_STROKE_TOUCH) ? '[' : '<', stroke->components[X].loc, stroke->components[X].delta_mickeys, stroke->components[X].pending, + stroke->components[X].cum_pressure, + stroke->components[X].max_cum_pressure, stroke->components[X].movement, (stroke->type == ATP_STROKE_TOUCH) ? ']' : '>', (stroke->type == ATP_STROKE_TOUCH) ? '[' : '<', stroke->components[Y].loc, stroke->components[Y].delta_mickeys, stroke->components[Y].pending, + stroke->components[Y].cum_pressure, + stroke->components[Y].max_cum_pressure, stroke->components[Y].movement, (stroke->type == ATP_STROKE_TOUCH) ? ']' : '>'); } @@ -1122,51 +1244,94 @@ atp_advance_stroke_state(struct atp_soft if (atp_compute_stroke_movement(stroke)) *movement = TRUE; + if (stroke->type != ATP_STROKE_TOUCH) + return; + /* Convert touch strokes to slides upon detecting movement or age. */ - if (stroke->type == ATP_STROKE_TOUCH) { - struct timeval tdiff; + if (stroke->cum_movement >= atp_slide_min_movement) { + atp_convert_to_slide(sc, stroke); + } else { + /* If a touch stroke is found to be older than the + * touch-timeout threshold, it should be converted to + * a slide; except if there is a co-incident sibling + * with a later creation time. + * + * When multiple fingers make contact with the + * touchpad, they are likely to be separated in their + * times of incidence. During a multi-finger tap, + * therefore, the last finger to make + * contact--i.e. the one with the latest + * 'ctime'--should be used to determine how the + * touch-siblings get treated; otherwise older + * siblings may lapse the touch-timeout and get + * converted into slides prematurely. The following + * loop determines if there exists another touch + * stroke with a larger 'ctime' than the current + * stroke (NOTE: zombies with a larger 'ctime' are + * also considered) . + */ - /* Compute the stroke's age. */ - getmicrotime(&tdiff); - if (timevalcmp(&tdiff, &stroke->ctime, >)) - timevalsub(&tdiff, &stroke->ctime); - else { - /* - * If we are here, it is because getmicrotime - * reported the current time as being behind - * the stroke's start time; getmicrotime can - * be imprecise. - */ - tdiff.tv_sec = 0; - tdiff.tv_usec = 0; - } + u_int i; + for (i = 0; i < sc->sc_n_strokes; i++) { + if ((&sc->sc_strokes[i] == stroke) || + (sc->sc_strokes[i].type != ATP_STROKE_TOUCH)) + continue; - if ((tdiff.tv_sec > (atp_touch_timeout / 1000000)) || - ((tdiff.tv_sec == (atp_touch_timeout / 1000000)) && - (tdiff.tv_usec > atp_touch_timeout)) || - (stroke->cum_movement >= atp_slide_min_movement)) { - /* Switch this stroke to being a slide. */ - stroke->type = ATP_STROKE_SLIDE; - - /* Are we at the beginning of a double-click-n-drag? */ - if ((sc->sc_n_strokes == 1) && - ((sc->sc_state & ATP_ZOMBIES_EXIST) == 0) && - timevalcmp(&stroke->ctime, &sc->sc_reap_time, >)) { - struct timeval delta; - struct timeval window = { - atp_double_tap_threshold / 1000000, - atp_double_tap_threshold % 1000000 - }; - - delta = stroke->ctime; - timevalsub(&delta, &sc->sc_reap_time); - if (timevalcmp(&delta, &window, <=)) - sc->sc_state |= ATP_DOUBLE_TAP_DRAG; + if (timevalcmp(&sc->sc_strokes[i].ctime, + &stroke->ctime, >)) + break; + } + if (i == sc->sc_n_strokes) { + /* Found no other touch stroke with a larger 'ctime'. */ + struct timeval tdiff; + + /* Compute the stroke's age. */ + getmicrotime(&tdiff); + if (timevalcmp(&tdiff, &stroke->ctime, >)) + timevalsub(&tdiff, &stroke->ctime); + else { + /* + * If we are here, it is because getmicrotime + * reported the current time as being behind + * the stroke's start time; getmicrotime can + * be imprecise. + */ + tdiff.tv_sec = 0; + tdiff.tv_usec = 0; } + + if ((tdiff.tv_sec > (atp_touch_timeout / 1000000)) || + ((tdiff.tv_sec == (atp_touch_timeout / 1000000)) && + (tdiff.tv_usec >= + (atp_touch_timeout % 1000000)))) + atp_convert_to_slide(sc, stroke); } } } +/* Switch a given touch stroke to being a slide. */ +void +atp_convert_to_slide(struct atp_softc *sc, atp_stroke *stroke) +{ + stroke->type = ATP_STROKE_SLIDE; + + /* Are we at the beginning of a double-click-n-drag? */ + if ((sc->sc_n_strokes == 1) && + ((sc->sc_state & ATP_ZOMBIES_EXIST) == 0) && + timevalcmp(&stroke->ctime, &sc->sc_reap_time, >)) { + struct timeval delta; + struct timeval window = { + atp_double_tap_threshold / 1000000, + atp_double_tap_threshold % 1000000 + }; + + delta = stroke->ctime; + timevalsub(&delta, &sc->sc_reap_time); + if (timevalcmp(&delta, &window, <=)) + sc->sc_state |= ATP_DOUBLE_TAP_DRAG; + } +} + /* * Terminate a stroke. While SLIDE strokes are dropped, TOUCH strokes * are retained as zombies so as to reap all their siblings together; @@ -1455,6 +1620,14 @@ static const struct usb_config atp_confi .bufsize = 0, /* use wMaxPacketSize */ .callback = &atp_intr, }, + [ATP_RESET] = { + .type = UE_CONTROL, + .endpoint = 0, /* Control pipe */ + .direction = UE_DIR_ANY, + .bufsize = sizeof(struct usb_device_request) + MODE_LENGTH, + .callback = &atp_reset_callback, + .interval = 0, /* no pre-delay */ + }, }; static int @@ -1469,10 +1642,7 @@ atp_probe(device_t self) (uaa->info.bInterfaceProtocol != UIPROTO_MOUSE)) return (ENXIO); - if (usbd_lookup_id_by_uaa(atp_devs, sizeof(atp_devs), uaa) == 0) - return BUS_PROBE_SPECIFIC; - else - return ENXIO; + return (usbd_lookup_id_by_uaa(atp_devs, sizeof(atp_devs), uaa)); } static int @@ -1482,12 +1652,6 @@ atp_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); usb_error_t err; - /* ensure that the probe was successful */ - if (uaa->driver_info >= ATP_N_DEV_PARAMS) { - DPRINTF("device probe returned bad id: %lu\n", - uaa->driver_info); - return (ENXIO); - } DPRINTFN(ATP_LLEVEL_INFO, "sc=%p\n", sc); sc->sc_dev = dev; @@ -1566,7 +1730,6 @@ static int atp_detach(device_t dev) { struct atp_softc *sc; - int err; sc = device_get_softc(dev); if (sc->sc_state & ATP_ENABLED) { @@ -1581,12 +1744,6 @@ atp_detach(device_t dev) mtx_destroy(&sc->sc_mutex); - err = atp_set_device_mode(dev, HID_MODE); - if (err != 0) { - DPRINTF("failed to reset mode to 'HID' (%d)\n", err); - return (err); - } - return (0); } @@ -1613,7 +1770,7 @@ atp_intr(struct usb_xfer *xfer, usb_erro len, sc->sc_params->data_len); len = sc->sc_params->data_len; } - if (len == 0) + if (len < sc->sc_params->data_len) goto tr_setup; pc = usbd_xfer_get_frame(xfer, 0); @@ -1621,9 +1778,11 @@ atp_intr(struct usb_xfer *xfer, usb_erro /* Interpret sensor data */ atp_interpret_sensor_data(sc->sensor_data, - sc->sc_params->n_xsensors, 20, sc->cur_x); + sc->sc_params->n_xsensors, X, sc->cur_x, + sc->sc_params->prot); atp_interpret_sensor_data(sc->sensor_data, - sc->sc_params->n_ysensors, 2, sc->cur_y); + sc->sc_params->n_ysensors, Y, sc->cur_y, + sc->sc_params->prot); /* * If this is the initial update (from an untouched @@ -1632,11 +1791,14 @@ atp_intr(struct usb_xfer *xfer, usb_erro * be used as pressure readings subsequently. */ status_bits = sc->sensor_data[sc->sc_params->data_len - 1]; - if (status_bits & ATP_STATUS_BASE_UPDATE) { + if ((sc->sc_params->prot == ATP_PROT_GEYSER3 && + (status_bits & ATP_STATUS_BASE_UPDATE)) || + !(sc->sc_state & ATP_VALID)) { memcpy(sc->base_x, sc->cur_x, sc->sc_params->n_xsensors * sizeof(*(sc->base_x))); memcpy(sc->base_y, sc->cur_y, sc->sc_params->n_ysensors * sizeof(*(sc->base_y))); + sc->sc_state |= ATP_VALID; goto tr_setup; } @@ -1757,8 +1919,23 @@ atp_intr(struct usb_xfer *xfer, usb_erro sc->sc_idlecount++; if (sc->sc_idlecount >= ATP_IDLENESS_THRESHOLD) { DPRINTFN(ATP_LLEVEL_INFO, "idle\n"); - atp_set_device_mode(sc->sc_dev,RAW_SENSOR_MODE); + + /* + * Use the last frame before we go idle for + * calibration on pads which do not send + * calibration frames. + */ + if (sc->sc_params->prot < ATP_PROT_GEYSER3) { + memcpy(sc->base_x, sc->cur_x, + sc->sc_params->n_xsensors * + sizeof(*(sc->base_x))); + memcpy(sc->base_y, sc->cur_y, + sc->sc_params->n_ysensors * + sizeof(*(sc->base_y))); + } + sc->sc_idlecount = 0; + usbd_transfer_start(sc->sc_xfer[ATP_RESET]); } } else { sc->sc_idlecount = 0; @@ -1770,7 +1947,7 @@ atp_intr(struct usb_xfer *xfer, usb_erro if (usb_fifo_put_bytes_max( sc->sc_fifo.fp[USB_FIFO_RX]) != 0) { usbd_xfer_set_frame_len(xfer, 0, - usbd_xfer_max_len(xfer)); + sc->sc_params->data_len); usbd_transfer_submit(xfer); } break; Modified: stable/8/sys/modules/usb/Makefile ============================================================================== --- stable/8/sys/modules/usb/Makefile Wed Dec 9 21:39:43 2009 (r200313) +++ stable/8/sys/modules/usb/Makefile Wed Dec 9 21:47:42 2009 (r200314) @@ -28,7 +28,7 @@ SUBDIR = usb SUBDIR += ehci musb ohci uhci uss820dci ${_at91dci} ${_atmegadci} SUBDIR += rum uath upgt ural zyd ${_urtw} -SUBDIR += uhid ukbd ums udbp ufm +SUBDIR += atp uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umodem umoscom uplcom uslcom uvisor uvscom SUBDIR += uether aue axe cdce cue kue rue udav From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:52:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87C3F106566C; Wed, 9 Dec 2009 21:52:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74BF68FC0A; Wed, 9 Dec 2009 21:52: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 nB9LqrMD039741; Wed, 9 Dec 2009 21:52:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Lqrgw039737; Wed, 9 Dec 2009 21:52:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912092152.nB9Lqrgw039737@svn.freebsd.org> From: John Baldwin Date: Wed, 9 Dec 2009 21:52: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: r200315 - in head/sys: dev/pci kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:52:53 -0000 Author: jhb Date: Wed Dec 9 21:52:53 2009 New Revision: 200315 URL: http://svn.freebsd.org/changeset/base/200315 Log: For some buses, devices may have active resources assigned even though they are not allocated by the device driver. These resources should still appear allocated from the system's perspective so that their assigned ranges are not reused by other resource requests. The PCI bus driver has used a hack to effect this for a while now where it uses rman_set_device() to assign devices to the PCI bus when they are first encountered and later assigns them to the actual device when a driver allocates a BAR. A few downsides of this approach is that it results in somewhat confusing devinfo -r output as well as not being very easily portable to other bus drivers. This commit adds generic support for "reserved" resources to the resource list API used by many bus drivers to manage the resources of child devices. A resource may be reserved via resource_list_reserve(). This will allocate the resource from the bus' parent without activating it. resource_list_alloc() recognizes an attempt to allocate a reserved resource. When this happens it activates the resource (if requested) and then returns the reserved resource. Similarly, when a reserved resource is released via resource_list_release(), it is deactivated (if it is active) and the resource is then marked reserved again, but is left allocated from the bus' parent. To completely remove a reserved resource, a bus driver may use resource_list_unreserve(). A bus driver may use resource_list_busy() to determine if a reserved resource is allocated by a child device or if it can be unreserved. The PCI bus driver has been changed to use this framework instead of abusing rman_set_device() to keep track of reserved vs allocated resources. Submitted by: imp (an older version many moons ago) MFC after: 1 month Modified: head/sys/dev/pci/pci.c head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Dec 9 21:47:42 2009 (r200314) +++ head/sys/dev/pci/pci.c Wed Dec 9 21:52:53 2009 (r200315) @@ -2451,7 +2451,7 @@ pci_add_map(device_t bus, device_t dev, * driver for this device will later inherit this resource in * pci_alloc_resource(). */ - res = resource_list_alloc(rl, bus, dev, type, ®, start, end, count, + res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, prefetch ? RF_PREFETCHABLE : 0); if (res == NULL) { /* @@ -2462,10 +2462,8 @@ pci_add_map(device_t bus, device_t dev, */ resource_list_delete(rl, type, reg); start = 0; - } else { + } else start = rman_get_start(res); - rman_set_device(res, bus); - } pci_write_bar(dev, reg, start); return (barlen); } @@ -2504,14 +2502,12 @@ pci_ata_maps(device_t bus, device_t dev, } else { rid = PCIR_BAR(0); resource_list_add(rl, type, rid, 0x1f0, 0x1f7, 8); - r = resource_list_alloc(rl, bus, dev, type, &rid, 0x1f0, 0x1f7, - 8, 0); - rman_set_device(r, bus); + r = resource_list_reserve(rl, bus, dev, type, &rid, 0x1f0, + 0x1f7, 8, 0); rid = PCIR_BAR(1); resource_list_add(rl, type, rid, 0x3f6, 0x3f6, 1); - r = resource_list_alloc(rl, bus, dev, type, &rid, 0x3f6, 0x3f6, - 1, 0); - rman_set_device(r, bus); + r = resource_list_reserve(rl, bus, dev, type, &rid, 0x3f6, + 0x3f6, 1, 0); } if (progif & PCIP_STORAGE_IDE_MODESEC) { pci_add_map(bus, dev, PCIR_BAR(2), rl, force, @@ -2521,14 +2517,12 @@ pci_ata_maps(device_t bus, device_t dev, } else { rid = PCIR_BAR(2); resource_list_add(rl, type, rid, 0x170, 0x177, 8); - r = resource_list_alloc(rl, bus, dev, type, &rid, 0x170, 0x177, - 8, 0); - rman_set_device(r, bus); + r = resource_list_reserve(rl, bus, dev, type, &rid, 0x170, + 0x177, 8, 0); rid = PCIR_BAR(3); resource_list_add(rl, type, rid, 0x376, 0x376, 1); - r = resource_list_alloc(rl, bus, dev, type, &rid, 0x376, 0x376, - 1, 0); - rman_set_device(r, bus); + r = resource_list_reserve(rl, bus, dev, type, &rid, 0x376, + 0x376, 1, 0); } pci_add_map(bus, dev, PCIR_BAR(4), rl, force, prefetchmask & (1 << 4)); @@ -3564,7 +3558,7 @@ DB_SHOW_COMMAND(pciregs, db_pci_dump) #endif /* DDB */ static struct resource * -pci_alloc_map(device_t dev, device_t child, int type, int *rid, +pci_reserve_map(device_t dev, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) { struct pci_devinfo *dinfo = device_get_ivars(child); @@ -3634,15 +3628,15 @@ pci_alloc_map(device_t dev, device_t chi count, *rid, type, start, end); goto out; } - rman_set_device(res, dev); resource_list_add(rl, type, *rid, start, end, count); rle = resource_list_find(rl, type, *rid); if (rle == NULL) - panic("pci_alloc_map: unexpectedly can't find resource."); + panic("pci_reserve_map: unexpectedly can't find resource."); rle->res = res; rle->start = rman_get_start(res); rle->end = rman_get_end(res); rle->count = count; + rle->flags = RLE_RESERVED; if (bootverbose) device_printf(child, "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", @@ -3692,34 +3686,13 @@ pci_alloc_resource(device_t dev, device_ break; case SYS_RES_IOPORT: case SYS_RES_MEMORY: - /* Allocate resources for this BAR if needed. */ + /* Reserve resources for this BAR if needed. */ rle = resource_list_find(rl, type, *rid); if (rle == NULL) { - res = pci_alloc_map(dev, child, type, rid, start, end, + res = pci_reserve_map(dev, child, type, rid, start, end, count, flags); if (res == NULL) return (NULL); - rle = resource_list_find(rl, type, *rid); - } - - /* - * If the resource belongs to the bus, then give it to - * the child. We need to activate it if requested - * since the bus always allocates inactive resources. - */ - if (rle != NULL && rle->res != NULL && - rman_get_device(rle->res) == dev) { - if (bootverbose) - device_printf(child, - "Reserved %#lx bytes for rid %#x type %d at %#lx\n", - rman_get_size(rle->res), *rid, type, - rman_get_start(rle->res)); - rman_set_device(rle->res, child); - if ((flags & RF_ACTIVE) && - bus_activate_resource(child, type, *rid, - rle->res) != 0) - return (NULL); - return (rle->res); } } return (resource_list_alloc(rl, dev, child, type, rid, @@ -3730,7 +3703,6 @@ int pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r) { - int error; if (device_get_parent(child) != dev) return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, @@ -3739,21 +3711,10 @@ pci_release_resource(device_t dev, devic /* * For BARs we don't actually want to release the resource. * Instead, we deactivate the resource if needed and then give - * ownership of the BAR back to the bus. + * ownership of the BAR back to the bus. This is handled for us + * in resource_list_release() since we use resource_list_reserve() + * for BARs. */ - switch (type) { - case SYS_RES_IOPORT: - case SYS_RES_MEMORY: - if (rman_get_device(r) != child) - return (EINVAL); - if (rman_get_flags(r) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); - } - rman_set_device(r, dev); - return (0); - } return (bus_generic_rl_release_resource(dev, child, type, rid, r)); } @@ -3796,13 +3757,12 @@ pci_delete_resource(device_t dev, device return; if (rle->res) { - if (rman_get_device(rle->res) != dev || - rman_get_flags(rle->res) & RF_ACTIVE) { + if (rman_get_flags(rle->res) & RF_ACTIVE || + resource_list_busy(rl, type, rid)) { device_printf(dev, "delete_resource: " "Resource still owned by child, oops. " "(type=%d, rid=%d, addr=%lx)\n", - rle->type, rle->rid, - rman_get_start(rle->res)); + type, rid, rman_get_start(rle->res)); return; } @@ -3818,7 +3778,7 @@ pci_delete_resource(device_t dev, device break; } #endif - bus_release_resource(dev, type, rid, rle->res); + resource_list_unreserve(rl, dev, child, type, rid); } resource_list_delete(rl, type, rid); } Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Dec 9 21:47:42 2009 (r200314) +++ head/sys/kern/subr_bus.c Wed Dec 9 21:52:53 2009 (r200315) @@ -2866,6 +2866,7 @@ resource_list_add(struct resource_list * rle->type = type; rle->rid = rid; rle->res = NULL; + rle->flags = 0; } if (rle->res) @@ -2878,6 +2879,31 @@ resource_list_add(struct resource_list * } /** + * @brief Determine if a resource entry is busy. + * + * Returns true if a resource entry is busy meaning that it has an + * associated resource that is not an unallocated "reserved" resource. + * + * @param rl the resource list to search + * @param type the resource entry type (e.g. SYS_RES_MEMORY) + * @param rid the resource identifier + * + * @returns Non-zero if the entry is busy, zero otherwise. + */ +int +resource_list_busy(struct resource_list *rl, int type, int rid) +{ + struct resource_list_entry *rle; + + rle = resource_list_find(rl, type, rid); + if (rle == NULL || rle->res == NULL) + return (0); + if ((rle->flags & (RLE_RESERVED | RLE_ALLOCATED)) == RLE_RESERVED) + return (0); + return (1); +} + +/** * @brief Find a resource entry by type and rid. * * @param rl the resource list to search @@ -2920,6 +2946,66 @@ resource_list_delete(struct resource_lis } /** + * @brief Allocate a reserved resource + * + * This can be used by busses to force the allocation of resources + * that are always active in the system even if they are not allocated + * by a driver (e.g. PCI BARs). This function is usually called when + * adding a new child to the bus. The resource is allocated from the + * parent bus when it is reserved. The resource list entry is marked + * with RLE_RESERVED to note that it is a reserved resource. + * + * Subsequent attempts to allocate the resource with + * resource_list_alloc() will succeed the first time and will set + * RLE_ALLOCATED to note that it has been allocated. When a reserved + * resource that has been allocated is released with + * resource_list_release() the resource RLE_ALLOCATED is cleared, but + * the actual resource remains allocated. The resource can be released to + * the parent bus by calling resource_list_unreserve(). + * + * @param rl the resource list to allocate from + * @param bus the parent device of @p child + * @param child the device for which the resource is being reserved + * @param type the type of resource to allocate + * @param rid a pointer to the resource identifier + * @param start hint at the start of the resource range - pass + * @c 0UL for any start address + * @param end hint at the end of the resource range - pass + * @c ~0UL for any end address + * @param count hint at the size of range required - pass @c 1 + * for any size + * @param flags any extra flags to control the resource + * allocation - see @c RF_XXX flags in + * for details + * + * @returns the resource which was allocated or @c NULL if no + * resource could be allocated + */ +struct resource * +resource_list_reserve(struct resource_list *rl, device_t bus, device_t child, + int type, int *rid, u_long start, u_long end, u_long count, u_int flags) +{ + struct resource_list_entry *rle = NULL; + int passthrough = (device_get_parent(child) != bus); + struct resource *r; + + if (passthrough) + panic( + "resource_list_reserve() should only be called for direct children"); + if (flags & RF_ACTIVE) + panic( + "resource_list_reserve() should only reserve inactive resources"); + + r = resource_list_alloc(rl, bus, child, type, rid, start, end, count, + flags); + if (r != NULL) { + rle = resource_list_find(rl, type, *rid); + rle->flags |= RLE_RESERVED; + } + return (r); +} + +/** * @brief Helper function for implementing BUS_ALLOC_RESOURCE() * * Implement BUS_ALLOC_RESOURCE() by looking up a resource from the list @@ -2970,8 +3056,19 @@ resource_list_alloc(struct resource_list if (!rle) return (NULL); /* no resource of that type/rid */ - if (rle->res) + if (rle->res) { + if (rle->flags & RLE_RESERVED) { + if (rle->flags & RLE_ALLOCATED) + return (NULL); + else if ((flags & RF_ACTIVE) && + bus_activate_resource(child, type, *rid, + rle->res) != 0) + return (NULL); + else + return (rle->res); + } panic("resource_list_alloc: resource entry is busy"); + } if (isdefault) { start = rle->start; @@ -3003,7 +3100,7 @@ resource_list_alloc(struct resource_list * @param rl the resource list which was allocated from * @param bus the parent device of @p child * @param child the device which is requesting a release - * @param type the type of resource to allocate + * @param type the type of resource to release * @param rid the resource identifier * @param res the resource to release * @@ -3030,6 +3127,19 @@ resource_list_release(struct resource_li panic("resource_list_release: can't find resource"); if (!rle->res) panic("resource_list_release: resource entry is not busy"); + if (rle->flags & RLE_RESERVED) { + if (rle->flags & RLE_ALLOCATED) { + if (rman_get_flags(res) & RF_ACTIVE) { + error = bus_deactivate_resource(child, type, + rid, res); + if (error) + return (error); + } + rle->flags &= ~RLE_ALLOCATED; + return (0); + } + return (EINVAL); + } error = BUS_RELEASE_RESOURCE(device_get_parent(bus), child, type, rid, res); @@ -3041,6 +3151,45 @@ resource_list_release(struct resource_li } /** + * @brief Fully release a reserved resource + * + * Fully releases a resouce reserved via resource_list_reserve(). + * + * @param rl the resource list which was allocated from + * @param bus the parent device of @p child + * @param child the device whose reserved resource is being released + * @param type the type of resource to release + * @param rid the resource identifier + * @param res the resource to release + * + * @retval 0 success + * @retval non-zero a standard unix error code indicating what + * error condition prevented the operation + */ +int +resource_list_unreserve(struct resource_list *rl, device_t bus, device_t child, + int type, int rid) +{ + struct resource_list_entry *rle = NULL; + int passthrough = (device_get_parent(child) != bus); + + if (passthrough) + panic( + "resource_list_unreserve() should only be called for direct children"); + + rle = resource_list_find(rl, type, rid); + + if (!rle) + panic("resource_list_unreserve: can't find resource"); + if (!(rle->flags & RLE_RESERVED)) + return (EINVAL); + if (rle->flags & RLE_ALLOCATED) + return (EBUSY); + rle->flags &= ~RLE_RESERVED; + return (resource_list_release(rl, bus, child, type, rid, rle->res)); +} + +/** * @brief Print a description of resources in a resource list * * Print all resources of a specified type, for use in BUS_PRINT_CHILD(). Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Dec 9 21:47:42 2009 (r200314) +++ head/sys/sys/bus.h Wed Dec 9 21:52:53 2009 (r200315) @@ -231,6 +231,7 @@ struct resource_list_entry { STAILQ_ENTRY(resource_list_entry) link; int type; /**< @brief type argument to alloc_resource */ int rid; /**< @brief resource identifier */ + int flags; /**< @brief resource flags */ struct resource *res; /**< @brief the real resource when allocated */ u_long start; /**< @brief start of resource range */ u_long end; /**< @brief end of resource range */ @@ -238,6 +239,9 @@ struct resource_list_entry { }; STAILQ_HEAD(resource_list, resource_list_entry); +#define RLE_RESERVED 0x0001 /* Reserved by the parent bus. */ +#define RLE_ALLOCATED 0x0002 /* Reserved resource is allocated. */ + void resource_list_init(struct resource_list *rl); void resource_list_free(struct resource_list *rl); struct resource_list_entry * @@ -247,6 +251,8 @@ struct resource_list_entry * int resource_list_add_next(struct resource_list *rl, int type, u_long start, u_long end, u_long count); +int resource_list_busy(struct resource_list *rl, + int type, int rid); struct resource_list_entry* resource_list_find(struct resource_list *rl, int type, int rid); @@ -261,6 +267,15 @@ struct resource * int resource_list_release(struct resource_list *rl, device_t bus, device_t child, int type, int rid, struct resource *res); +struct resource * + resource_list_reserve(struct resource_list *rl, + device_t bus, device_t child, + int type, int *rid, + u_long start, u_long end, + u_long count, u_int flags); +int resource_list_unreserve(struct resource_list *rl, + device_t bus, device_t child, + int type, int rid); void resource_list_purge(struct resource_list *rl); int resource_list_print_type(struct resource_list *rl, const char *name, int type, From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:56:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F451065676; Wed, 9 Dec 2009 21:56:55 +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 B83208FC08; Wed, 9 Dec 2009 21:56: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 nB9Lut78039971; Wed, 9 Dec 2009 21:56:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Luti6039967; Wed, 9 Dec 2009 21:56:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912092156.nB9Luti6039967@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 9 Dec 2009 21:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200316 - stable/8/sys/dev/usb/input X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:56:56 -0000 Author: nwhitehorn Date: Wed Dec 9 21:56:55 2009 New Revision: 200316 URL: http://svn.freebsd.org/changeset/base/200316 Log: MFC r199169: Reduce probe priority of USB input devices to BUS_PROBE_GENERIC from BUS_PROBE_SPECIFIC. This allows device-specific drivers like atp to attach reliably. Modified: stable/8/sys/dev/usb/input/uhid.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/input/ums.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Wed Dec 9 21:52:53 2009 (r200315) +++ stable/8/sys/dev/usb/input/uhid.c Wed Dec 9 21:56:55 2009 (r200316) @@ -633,7 +633,7 @@ uhid_probe(device_t dev) if (usb_test_quirk(uaa, UQ_HID_IGNORE)) { return (ENXIO); } - return (0); + return (BUS_PROBE_GENERIC); } static int Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Wed Dec 9 21:52:53 2009 (r200315) +++ stable/8/sys/dev/usb/input/ukbd.c Wed Dec 9 21:56:55 2009 (r200316) @@ -749,7 +749,7 @@ ukbd_probe(device_t dev) if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) return (ENXIO); else - return (0); + return (BUS_PROBE_GENERIC); } error = usbd_req_get_hid_desc(uaa->device, NULL, @@ -771,7 +771,7 @@ ukbd_probe(device_t dev) if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) error = ENXIO; else - error = 0; + error = BUS_PROBE_GENERIC; } else error = ENXIO; Modified: stable/8/sys/dev/usb/input/ums.c ============================================================================== --- stable/8/sys/dev/usb/input/ums.c Wed Dec 9 21:52:53 2009 (r200315) +++ stable/8/sys/dev/usb/input/ums.c Wed Dec 9 21:56:55 2009 (r200316) @@ -375,7 +375,7 @@ ums_probe(device_t dev) if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE)) - return (0); + return (BUS_PROBE_GENERIC); error = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); @@ -385,7 +385,7 @@ ums_probe(device_t dev) if (hid_is_collection(d_ptr, d_len, HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) - error = 0; + error = BUS_PROBE_GENERIC; else error = ENXIO; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 21:58:39 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625081065679; Wed, 9 Dec 2009 21:58:39 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 500F88FC0C; Wed, 9 Dec 2009 21:58: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 nB9LwdpF040111; Wed, 9 Dec 2009 21:58:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9LwdHh040109; Wed, 9 Dec 2009 21:58:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912092158.nB9LwdHh040109@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 9 Dec 2009 21:58:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200317 - stable/8/sys/powerpc/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 21:58:39 -0000 Author: nwhitehorn Date: Wed Dec 9 21:58:39 2009 New Revision: 200317 URL: http://svn.freebsd.org/changeset/base/200317 Log: MFC r199949: Add atp(4) to powerpc GENERIC. Most late-generation Apple PowerPC laptops have trackpads that do not work at all without this driver. Modified: stable/8/sys/powerpc/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/conf/GENERIC ============================================================================== --- stable/8/sys/powerpc/conf/GENERIC Wed Dec 9 21:56:55 2009 (r200316) +++ stable/8/sys/powerpc/conf/GENERIC Wed Dec 9 21:58:39 2009 (r200317) @@ -147,6 +147,7 @@ options KBD_INSTALL_CDEV # install a CD device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da0 device ums # Mouse +device atp # Apple USB touchpad device urio # Diamond Rio 500 MP3 player # USB Ethernet device aue # ADMtek USB Ethernet From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:03:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA94E106566C; Wed, 9 Dec 2009 22:03:57 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8CEE8FC14; Wed, 9 Dec 2009 22:03: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 nB9M3vna040401; Wed, 9 Dec 2009 22:03:57 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9M3v1o040399; Wed, 9 Dec 2009 22:03:57 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <200912092203.nB9M3v1o040399@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 9 Dec 2009 22:03: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: r200318 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:03:58 -0000 Author: gavin Date: Wed Dec 9 22:03:57 2009 New Revision: 200318 URL: http://svn.freebsd.org/changeset/base/200318 Log: Add my birthday. Approved by: ed (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Dec 9 21:58:39 2009 (r200317) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Dec 9 22:03:57 2009 (r200318) @@ -284,6 +284,7 @@ 11/18 Thomas Quinot born in Paris, France, 1977 11/19 Konstantin Belousov born in Kiev, USSR, 1972 11/20 Dmitry Morozovsky born in Moscow, USSR, 1968 +11/20 Gavin Atkinson born in Middlesbrough, United Kingdom, 1979 11/23 Josef Lawrence Karthauser born in Pembury, Kent, United Kingdom, 1972 11/24 Andrey Zakhvatov born in Chelyabinsk, Russian Federation, 1974 11/24 Daniel Gerzo born in Bratislava, Slovakia, 1986 From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:10:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B72D106568D; Wed, 9 Dec 2009 22:10:45 +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 576948FC1A; Wed, 9 Dec 2009 22:10: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 nB9MAj2b040674; Wed, 9 Dec 2009 22:10:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MAjx7040670; Wed, 9 Dec 2009 22:10:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092210.nB9MAjx7040670@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200319 - in stable/8/sys/dev/usb: . wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:10:45 -0000 Author: thompsa Date: Wed Dec 9 22:10:45 2009 New Revision: 200319 URL: http://svn.freebsd.org/changeset/base/200319 Log: MFC r197761,r198194,r198862 updates device entries supported with the product name not magic numbers and sorts entries. WUSB54GCV2 is added. overhauls urtw(4) for supporting RTL8187B devices properly that there was major changes to initialize RF chipset and set H/W registers and removed a lot of magic numbers on code. Modified: stable/8/sys/dev/usb/usbdevs stable/8/sys/dev/usb/wlan/if_urtw.c stable/8/sys/dev/usb/wlan/if_urtwreg.h stable/8/sys/dev/usb/wlan/if_urtwvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Wed Dec 9 22:03:57 2009 (r200318) +++ stable/8/sys/dev/usb/usbdevs Wed Dec 9 22:10:45 2009 (r200319) @@ -909,6 +909,7 @@ product ASIX AX88772 0x7720 AX88772 product ASUS WL167G 0x1707 WL-167g Wireless Adapter product ASUS WL159G 0x170c WL-159g product ASUS A9T_WIFI 0x171b A9T wireless +product ASUS P5B_WIFI 0x171d P5B wireless product ASUS RT2573_1 0x1723 RT2573 product ASUS RT2573_2 0x1724 RT2573 product ASUS LCM 0x1726 LCM display @@ -976,6 +977,7 @@ product BELKIN F5D7051 0x7051 F5D7051 5 product BELKIN F5D7050A 0x705a F5D7050A Wireless Adapter /* Also sold as 'Ativa 802.11g wireless card' */ product BELKIN F5D7050_V4000 0x705c F5D7050 v4000 Wireless Adapter +product BELKIN F5D7050E 0x705e F5D7050E Wireless Adapter product BELKIN F5D9050V3 0x905b F5D9050 ver 3 Wireless Adapter product BELKIN2 F5U002 0x0002 F5U002 Parallel printer @@ -1657,6 +1659,7 @@ product LINKSYS2 WUSB11 0x2219 WUSB11 W product LINKSYS2 USB200M 0x2226 USB 2.0 10/100 Ethernet product LINKSYS3 WUSB11v28 0x2233 WUSB11 v2.8 Wireless Adapter product LINKSYS4 USB1000 0x0039 USB1000 +product LINKSYS4 WUSB54GCV2 0x0073 WUSB54GC v2 /* Logitech products */ product LOGITECH M2452 0x0203 M2452 keyboard @@ -1877,6 +1880,7 @@ product NETGEAR EA101X 0x1002 Ethernet product NETGEAR FA101 0x1020 Ethernet 10/100, USB1.1 product NETGEAR FA120 0x1040 USB 2.0 Ethernet product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN +product NETGEAR WG111V3 0x4260 WG111v3 product NETGEAR WG111U 0x4300 WG111U product NETGEAR WG111U_NF 0x4301 WG111U (no firmware) product NETGEAR WG111V2 0x6a00 WG111V2 @@ -2102,6 +2106,9 @@ product RALINK RT2573_2 0x9021 RT2501US /* Green House and CompUSA OEM this part */ product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter +product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter +product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter +product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter /* Ricoh products */ product RICOH VGPVCC2 0x1830 VGP-VCC2 Camera @@ -2271,6 +2278,8 @@ product SITECOM SERIAL 0x2068 USB to se product SITECOM2 WL022 0x182d WL-022 /* Sitecom Europe products */ +product SITECOMEU WL168V1 0x000d WL-168 v1 +product SITECOMEU WL168V4 0x0028 WL-168 v4 product SITECOMEU LN028 0x061c LN-028 product SITECOMEU WL113 0x9071 WL-113 product SITECOMEU ZD1211B 0x9075 ZD1211B @@ -2376,6 +2385,7 @@ product DIAMOND2 RIO600USB 0x5001 Rio 60 product DIAMOND2 RIO800USB 0x5002 Rio 800 USB /* Surecom Technology products */ +product SURECOM EP9001G2A 0x11f2 EP-9001-G rev 2A product SURECOM RT2570 0x11f3 RT2570 product SURECOM RT2573 0x31f3 RT2573 Modified: stable/8/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_urtw.c Wed Dec 9 22:03:57 2009 (r200318) +++ stable/8/sys/dev/usb/wlan/if_urtw.c Wed Dec 9 22:10:45 2009 (r200319) @@ -76,6 +76,7 @@ enum { URTW_DEBUG_STATE = 0x00000020, /* 802.11 state transitions */ URTW_DEBUG_STAT = 0x00000040, /* statistic */ URTW_DEBUG_INIT = 0x00000080, /* initialization of dev */ + URTW_DEBUG_TXSTATUS = 0x00000100, /* tx status */ URTW_DEBUG_ANY = 0xffffffff }; #define DPRINTF(sc, m, fmt, ...) do { \ @@ -102,23 +103,24 @@ TUNABLE_INT("hw.usb.urtw.preamble_mode", #define URTW_REV_RTL8187B 0 #define URTW_REV_RTL8187L 1 static const struct usb_device_id urtw_devs[] = { - { USB_VPI(USB_VENDOR_BELKIN, 0x705e, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_REALTEK, 0x8189, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_REALTEK, 0x8197, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_REALTEK, 0x8198, URTW_REV_RTL8187B) }, - { USB_VPI(USB_VENDOR_NETGEAR, 0x4260, URTW_REV_RTL8187B) }, + URTW_DEV_B(NETGEAR, WG111V3), + URTW_DEV_B(REALTEK, RTL8187B_0), + URTW_DEV_B(REALTEK, RTL8187B_1), + URTW_DEV_B(REALTEK, RTL8187B_2), + URTW_DEV_B(SITECOMEU, WL168V4), + URTW_DEV_L(ASUS, P5B_WIFI), + URTW_DEV_L(BELKIN, F5D7050E), + URTW_DEV_L(LINKSYS4, WUSB54GCV2), + URTW_DEV_L(NETGEAR, WG111V2), + URTW_DEV_L(REALTEK, RTL8187), + URTW_DEV_L(SITECOMEU, WL168V1), + URTW_DEV_L(SURECOM, EP9001G2A), { USB_VPI(0x1b75, 0x8187, URTW_REV_RTL8187L) }, - { USB_VPI(USB_VENDOR_ASUS, 0x171d, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_DICKSMITH, 0x9401, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_HP, 0xca02, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_LOGITEC, 0x010c, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_NETGEAR, 0x6100, URTW_REV_RTL8187L) }, - URTW_DEV_L(NETGEAR, WG111V2), - URTW_DEV_L(REALTEK, RTL8187), - { USB_VPI(USB_VENDOR_SITECOMEU, 0x000d, URTW_REV_RTL8187L) }, - { USB_VPI(USB_VENDOR_SITECOMEU, 0x0028, URTW_REV_RTL8187B) }, { USB_VPI(USB_VENDOR_SPHAIRON, 0x0150, URTW_REV_RTL8187L) }, - { USB_VPI(USB_VENDOR_SURECOM, 0x11f2, URTW_REV_RTL8187L) }, { USB_VPI(USB_VENDOR_QCOM, 0x6232, URTW_REV_RTL8187L) }, #undef URTW_DEV_L #undef URTW_DEV_B @@ -325,13 +327,47 @@ static struct urtw_pair urtw_8225v2_rf_p { 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 } }; -static struct urtw_pair urtw_8225v2b_rf_part1[] = { +static struct urtw_pair urtw_8225v2b_rf_part0[] = { { 0x00, 0x00b7 }, { 0x01, 0x0ee0 }, { 0x02, 0x044d }, { 0x03, 0x0441 }, { 0x04, 0x08c3 }, { 0x05, 0x0c72 }, { 0x06, 0x00e6 }, { 0x07, 0x082a }, { 0x08, 0x003f }, { 0x09, 0x0335 }, { 0x0a, 0x09d4 }, { 0x0b, 0x07bb }, { 0x0c, 0x0850 }, { 0x0d, 0x0cdf }, { 0x0e, 0x002b }, { 0x0f, 0x0114 } }; +static struct urtw_pair urtw_8225v2b_rf_part1[] = { + {0x0f0, 0x32}, {0x0f1, 0x32}, {0x0f2, 0x00}, + {0x0f3, 0x00}, {0x0f4, 0x32}, {0x0f5, 0x43}, + {0x0f6, 0x00}, {0x0f7, 0x00}, {0x0f8, 0x46}, + {0x0f9, 0xa4}, {0x0fa, 0x00}, {0x0fb, 0x00}, + {0x0fc, 0x96}, {0x0fd, 0xa4}, {0x0fe, 0x00}, + {0x0ff, 0x00}, {0x158, 0x4b}, {0x159, 0x00}, + {0x15a, 0x4b}, {0x15b, 0x00}, {0x160, 0x4b}, + {0x161, 0x09}, {0x162, 0x4b}, {0x163, 0x09}, + {0x1ce, 0x0f}, {0x1cf, 0x00}, {0x1e0, 0xff}, + {0x1e1, 0x0f}, {0x1e2, 0x00}, {0x1f0, 0x4e}, + {0x1f1, 0x01}, {0x1f2, 0x02}, {0x1f3, 0x03}, + {0x1f4, 0x04}, {0x1f5, 0x05}, {0x1f6, 0x06}, + {0x1f7, 0x07}, {0x1f8, 0x08}, {0x24e, 0x00}, + {0x20c, 0x04}, {0x221, 0x61}, {0x222, 0x68}, + {0x223, 0x6f}, {0x224, 0x76}, {0x225, 0x7d}, + {0x226, 0x84}, {0x227, 0x8d}, {0x24d, 0x08}, + {0x250, 0x05}, {0x251, 0xf5}, {0x252, 0x04}, + {0x253, 0xa0}, {0x254, 0x1f}, {0x255, 0x23}, + {0x256, 0x45}, {0x257, 0x67}, {0x258, 0x08}, + {0x259, 0x08}, {0x25a, 0x08}, {0x25b, 0x08}, + {0x260, 0x08}, {0x261, 0x08}, {0x262, 0x08}, + {0x263, 0x08}, {0x264, 0xcf}, {0x272, 0x56}, + {0x273, 0x9a}, {0x034, 0xf0}, {0x035, 0x0f}, + {0x05b, 0x40}, {0x084, 0x88}, {0x085, 0x24}, + {0x088, 0x54}, {0x08b, 0xb8}, {0x08c, 0x07}, + {0x08d, 0x00}, {0x094, 0x1b}, {0x095, 0x12}, + {0x096, 0x00}, {0x097, 0x06}, {0x09d, 0x1a}, + {0x09f, 0x10}, {0x0b4, 0x22}, {0x0be, 0x80}, + {0x0db, 0x00}, {0x0ee, 0x00}, {0x091, 0x03}, + {0x24c, 0x00}, {0x39f, 0x00}, {0x08c, 0x01}, + {0x08d, 0x10}, {0x08e, 0x08}, {0x08f, 0x00} +}; + static struct urtw_pair urtw_8225v2_rf_part2[] = { { 0x00, 0x01 }, { 0x01, 0x02 }, { 0x02, 0x42 }, { 0x03, 0x00 }, { 0x04, 0x00 }, { 0x05, 0x00 }, { 0x06, 0x40 }, { 0x07, 0x00 }, @@ -477,6 +513,7 @@ static const uint8_t urtw_8187b_reg_tabl static usb_callback_t urtw_bulk_rx_callback; static usb_callback_t urtw_bulk_tx_callback; +static usb_callback_t urtw_bulk_tx_status_callback; static const struct usb_config urtw_8187b_usbconfig[URTW_8187B_N_XFERS] = { [URTW_8187B_BULK_RX] = { @@ -491,6 +528,18 @@ static const struct usb_config urtw_8187 }, .callback = urtw_bulk_rx_callback }, + [URTW_8187B_BULK_TX_STATUS] = { + .type = UE_BULK, + .endpoint = 0x89, + .direction = UE_DIR_IN, + .bufsize = MCLBYTES, + .flags = { + .ext_buffer = 1, + .pipe_bof = 1, + .short_xfer_ok = 1 + }, + .callback = urtw_bulk_tx_status_callback + }, [URTW_8187B_BULK_TX_BE] = { .type = UE_BULK, .endpoint = URTW_8187B_TXPIPE_BE, @@ -702,9 +751,6 @@ static usb_error_t urtw_adapter_start(st static usb_error_t urtw_adapter_start_b(struct urtw_softc *); static usb_error_t urtw_set_mode(struct urtw_softc *, uint32_t); static usb_error_t urtw_8187b_cmd_reset(struct urtw_softc *); -static usb_error_t urtw_write16_i(struct urtw_softc *, int, uint16_t, int); -static usb_error_t urtw_write8_i(struct urtw_softc *, int, uint8_t, int); -static usb_error_t urtw_write32_i(struct urtw_softc *, int, uint32_t, int); static usb_error_t urtw_do_request(struct urtw_softc *, struct usb_device_request *, void *); static usb_error_t urtw_8225v2b_set_txpwrlvl(struct urtw_softc *, int); @@ -712,6 +758,10 @@ static usb_error_t urtw_led_off(struct u static void urtw_abort_xfers(struct urtw_softc *); static struct urtw_data * urtw_getbuf(struct urtw_softc *sc); +static int urtw_compute_txtime(uint16_t, uint16_t, uint8_t, + uint8_t); +static void urtw_updateslot(struct ifnet *); +static void urtw_updateslottask(void *, int); static int urtw_match(device_t dev) @@ -756,6 +806,7 @@ urtw_attach(device_t dev) MTX_DEF); usb_callout_init_mtx(&sc->sc_led_ch, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_led_task, 0, urtw_ledtask, sc); + TASK_INIT(&sc->sc_updateslot_task, 0, urtw_updateslottask, sc); callout_init(&sc->sc_watchdog_ch, 0); if (sc->sc_flags & URTW_RTL8187B) { @@ -844,7 +895,7 @@ urtw_attach(device_t dev) ic->ic_scan_start = urtw_scan_start; ic->ic_scan_end = urtw_scan_end; ic->ic_set_channel = urtw_set_channel; - + ic->ic_updateslot = urtw_updateslot; ic->ic_vap_create = urtw_vap_create; ic->ic_vap_delete = urtw_vap_delete; ic->ic_update_mcast = urtw_update_mcast; @@ -877,6 +928,7 @@ urtw_detach(device_t dev) return (0); urtw_stop(ifp, 1); + ieee80211_draintask(ic, &sc->sc_updateslot_task); ieee80211_draintask(ic, &sc->sc_led_task); usb_callout_drain(&sc->sc_led_ch); @@ -1013,6 +1065,9 @@ urtw_init_locked(void *arg) if (error != 0) goto fail; + if (sc->sc_flags & URTW_RTL8187B) + usbd_transfer_start(sc->sc_xfer[URTW_8187B_BULK_TX_STATUS]); + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -1035,7 +1090,6 @@ static usb_error_t urtw_adapter_start_b(struct urtw_softc *sc) { #define N(a) (sizeof(a) / sizeof((a)[0])) - int i; uint8_t data8; usb_error_t error; @@ -1067,81 +1121,12 @@ urtw_adapter_start_b(struct urtw_softc * if (error) goto fail; - urtw_write16_m(sc, 0x2d, 0xfff); - urtw_read8_m(sc, URTW_CW_CONF, &data8); - urtw_write8_m(sc, URTW_CW_CONF, data8 | URTW_CW_CONF_PERPACKET_RETRY); - urtw_read8_m(sc, URTW_TX_AGC_CTL, &data8); - data8 |= URTW_TX_AGC_CTL_PERPACKET_GAIN | - URTW_TX_AGC_CTL_PERPACKET_ANTSEL; - urtw_write8_m(sc, URTW_TX_AGC_CTL, data8); - - error = urtw_write16_i(sc, 0xe0, 0xfff, 1); - if (error) - goto fail; - - urtw_read8_m(sc, URTW_RATE_FALLBACK, &data8); - urtw_write8_m(sc, URTW_RATE_FALLBACK, data8 | URTW_RATE_FALLBACK_ENABLE); - - urtw_write16_m(sc, URTW_ATIM_WND, 2); - urtw_write16_m(sc, URTW_BEACON_INTERVAL, 100); - error = urtw_write16_i(sc, 0xd4, 0xffff, 1); - if (error) - goto fail; - - error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); - if (error) - goto fail; - urtw_read8_m(sc, URTW_CONFIG1, &data8); - urtw_write8_m(sc, URTW_CONFIG1, (data8 & 0x3f) | 0x80); - error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); - if (error) - goto fail; - - urtw_write8_m(sc, URTW_WPA_CONFIG, 0); - for (i = 0; i < N(urtw_8187b_reg_table); i++) { - error = urtw_write8_i(sc, urtw_8187b_reg_table[i][0], - urtw_8187b_reg_table[i][1], urtw_8187b_reg_table[i][2]); - if (error) - goto fail; - } - - urtw_write16_m(sc, URTW_TID_AC_MAP, 0xfa50); - urtw_write16_m(sc, URTW_INT_MIG, 0); - - error = urtw_write32_i(sc, 0xf0, 0, 1); - if (error) - goto fail; - error = urtw_write32_i(sc, 0xf4, 0, 1); - if (error) - goto fail; - error = urtw_write8_i(sc, 0xf8, 0, 1); - if (error) - goto fail; - - urtw_write32_m(sc, URTW_RF_TIMING, 0x00004001); - - error = urtw_write16_i(sc, 0x72, 0x569a, 2); - if (error) - goto fail; - - error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); - if (error) - goto fail; - urtw_read8_m(sc, URTW_CONFIG3, &data8); - urtw_write8_m(sc, URTW_CONFIG3, data8 | URTW_CONFIG3_ANAPARAM_WRITE); - error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); - if (error) - goto fail; - - urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, 0x0480); - urtw_write16_m(sc, URTW_RF_PINS_SELECT, 0x2488); - urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x1fff); - usb_pause_mtx(&sc->sc_mtx, 100); - error = sc->sc_rf_init(sc); if (error != 0) goto fail; + urtw_write8_m(sc, URTW_CMD, URTW_CMD_RX_ENABLE | URTW_CMD_TX_ENABLE); + /* fix RTL8187B RX stall */ error = urtw_intr_enable(sc); if (error) goto fail; @@ -1170,42 +1155,21 @@ urtw_adapter_start_b(struct urtw_softc * urtw_read8_m(sc, 0xdb, &data8); urtw_write8_m(sc, 0xdb, data8 | (1 << 2)); - error = urtw_write16_i(sc, 0x72, 0x59fa, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x74, 0x59d2, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x76, 0x59d2, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x78, 0x19fa, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x7a, 0x19fa, 3); - if (error) - goto fail; - error = urtw_write16_i(sc, 0x7c, 0x00d0, 3); - if (error) - goto fail; + urtw_write16_m(sc, 0x372, 0x59fa); + urtw_write16_m(sc, 0x374, 0x59d2); + urtw_write16_m(sc, 0x376, 0x59d2); + urtw_write16_m(sc, 0x378, 0x19fa); + urtw_write16_m(sc, 0x37a, 0x19fa); + urtw_write16_m(sc, 0x37c, 0x00d0); urtw_write8_m(sc, 0x61, 0); - error = urtw_write8_i(sc, 0x80, 0x0f, 1); - if (error) - goto fail; - error = urtw_write8_i(sc, 0x83, 0x03, 1); - if (error) - goto fail; - urtw_write8_m(sc, 0xda, 0x10); - error = urtw_write8_i(sc, 0x4d, 0x08, 2); - if (error) - goto fail; - - urtw_write32_m(sc, URTW_HSSI_PARA, 0x0600321B); - error = urtw_write16_i(sc, 0xec, 0x800, 1); - if (error) - goto fail; + urtw_write8_m(sc, 0x180, 0x0f); + urtw_write8_m(sc, 0x183, 0x03); + urtw_write8_m(sc, 0xda, 0x10); + urtw_write8_m(sc, 0x24d, 0x08); + urtw_write32_m(sc, URTW_HSSI_PARA, 0x0600321b); + urtw_write16_m(sc, 0x1ec, 0x800); /* RX MAX SIZE */ fail: return (error); #undef N @@ -1309,41 +1273,11 @@ urtw_8187b_cmd_reset(struct urtw_softc * device_printf(sc->sc_dev, "reset timeout\n"); goto fail; } - - error = urtw_set_mode(sc, URTW_EPROM_CMD_LOAD); - if (error) - goto fail; - - for (i = 0; i < 20; i++) { - usb_pause_mtx(&sc->sc_mtx, 4); - urtw_read8_m(sc, URTW_EPROM_CMD, &data8); - if (!(data8 & URTW_EPROM_CMD_CONFIG)) - break; - } - if (i >= 20) { - device_printf(sc->sc_dev, "eeprom reset timeout\n"); - goto fail; - } - fail: return (error); } static usb_error_t -urtw_write16_i(struct urtw_softc *sc, int val, uint16_t data, int idx) -{ - struct usb_device_request req; - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, idx & 0x3); - USETW(req.wLength, sizeof(uint16_t)); - - return (urtw_do_request(sc, &req, &data)); -} - -static usb_error_t urtw_do_request(struct urtw_softc *sc, struct usb_device_request *req, void *data) { @@ -1366,34 +1300,6 @@ urtw_do_request(struct urtw_softc *sc, return (err); } -static usb_error_t -urtw_write8_i(struct urtw_softc *sc, int val, uint8_t data, int idx) -{ - struct usb_device_request req; - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, idx & 0x3); - USETW(req.wLength, sizeof(uint8_t)); - - return (urtw_do_request(sc, &req, &data)); -} - -static usb_error_t -urtw_write32_i(struct urtw_softc *sc, int val, uint32_t data, int idx) -{ - struct usb_device_request req; - - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; - req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, idx & 0x3); - USETW(req.wLength, sizeof(uint32_t)); - - return (urtw_do_request(sc, &req, &data)); -} - static void urtw_stop_locked(struct ifnet *ifp, int disable) { @@ -1533,6 +1439,7 @@ urtw_start(struct ifnet *ifp) } sc->sc_txtimer = 5; + callout_reset(&sc->sc_watchdog_ch, hz, urtw_watchdog, sc); } URTW_UNLOCK(sc); } @@ -1732,14 +1639,12 @@ static int urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, struct urtw_data *data, int prior) { - int xferlen; struct ifnet *ifp = sc->sc_ifp; struct ieee80211_frame *wh = mtod(m0, struct ieee80211_frame *); struct ieee80211_key *k; const struct ieee80211_txparam *tp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211vap *vap = ni->ni_vap; - struct urtw_8187b_txhdr *hdr; struct usb_xfer *rtl8187b_pipes[URTW_8187B_TXPIPE_MAX] = { sc->sc_xfer[URTW_8187B_BULK_TX_BE], sc->sc_xfer[URTW_8187B_BULK_TX_BK], @@ -1747,6 +1652,10 @@ urtw_tx_start(struct urtw_softc *sc, str sc->sc_xfer[URTW_8187B_BULK_TX_VO] }; struct usb_xfer *xfer; + int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, + pkttime = 0, txdur = 0, isshort = 0, xferlen; + uint16_t acktime, rtstime, ctstime; + uint32_t flags; usb_error_t error; URTW_ASSERT_LOCKED(sc); @@ -1779,60 +1688,107 @@ urtw_tx_start(struct urtw_softc *sc, str ieee80211_radiotap_tx(vap, m0); } + if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT || + (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) { + tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; + rate = tp->mgmtrate; + } else { + tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)]; + /* for data frames */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + rate = tp->mcastrate; + else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rate = tp->ucastrate; + else + rate = urtw_rtl2rate(sc->sc_currate); + } + + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + txdur = pkttime = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, 0); + else { + acktime = urtw_compute_txtime(14, 2,0, 0); + if ((m0->m_pkthdr.len + 4) > vap->iv_rtsthreshold) { + rtsenable = 1; + ctsenable = 0; + rtstime = urtw_compute_txtime(URTW_ACKCTS_LEN, 2, 0, 0); + ctstime = urtw_compute_txtime(14, 2, 0, 0); + pkttime = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, isshort); + rtsdur = ctstime + pkttime + acktime + + 3 * URTW_ASIFS_TIME; + txdur = rtstime + rtsdur; + } else { + rtsenable = ctsenable = rtsdur = 0; + pkttime = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, isshort); + txdur = pkttime + URTW_ASIFS_TIME + acktime; + } + + if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) + dur = urtw_compute_txtime(m0->m_pkthdr.len + + IEEE80211_CRC_LEN, rate, 0, isshort) + + 3 * URTW_ASIFS_TIME + + 2 * acktime; + else + dur = URTW_ASIFS_TIME + acktime; + } + *(uint16_t *)wh->i_dur = htole16(dur); + xferlen = m0->m_pkthdr.len; xferlen += (sc->sc_flags & URTW_RTL8187B) ? (4 * 8) : (4 * 3); if ((0 == xferlen % 64) || (0 == xferlen % 512)) xferlen += 1; bzero(data->buf, URTW_TX_MAXSIZE); - data->buf[0] = m0->m_pkthdr.len & 0xff; - data->buf[1] = (m0->m_pkthdr.len & 0x0f00) >> 8; - data->buf[1] |= (1 << 7); - + flags = m0->m_pkthdr.len & 0xfff; + flags |= URTW_TX_FLAG_NO_ENC; if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE) && (sc->sc_preamble_mode == URTW_PREAMBLE_MODE_SHORT) && (sc->sc_currate != 0)) - data->buf[2] |= 1; - if ((m0->m_pkthdr.len > vap->iv_rtsthreshold) && - prior == URTW_PRIORITY_LOW) { - device_printf(sc->sc_dev, "TODO tx.\n"); - return (EIO); - } + flags |= URTW_TX_FLAG_SPLCP; if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) - data->buf[2] |= (1 << 1); - /* RTS rate - 10 means we use a basic rate. */ - data->buf[2] |= (urtw_rate2rtl(2) << 3); - /* - * XXX currently TX rate control depends on the rate value of - * RX descriptor because I don't know how to we can control TX rate - * in more smart way. Please fix me you find a thing. - */ - data->buf[3] = sc->sc_currate; - if (prior == URTW_PRIORITY_NORMAL) { - tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)]; - if (IEEE80211_IS_MULTICAST(wh->i_addr1)) - data->buf[3] = urtw_rate2rtl(tp->mcastrate); - else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) - data->buf[3] = urtw_rate2rtl(tp->ucastrate); - } + flags |= URTW_TX_FLAG_MOREFRAG; + + flags |= (sc->sc_currate & 0xf) << URTW_TX_FLAG_TXRATE_SHIFT; if (sc->sc_flags & URTW_RTL8187B) { - hdr = (struct urtw_8187b_txhdr *)data->buf; - hdr->rts_duration = 0; - hdr->len = 0; - hdr->retry = 3 | (7 << 4) | 11; - hdr->tx_duration = ieee80211_compute_duration(ic->ic_rt, - m0->m_pkthdr.len + IEEE80211_CRC_LEN, - urtw_rtl2rate(data->buf[3]), - (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0); - /* XXX MUST fill another variables like rts_duration, tx_.. */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[32]); + struct urtw_8187b_txhdr *tx; + + tx = (struct urtw_8187b_txhdr *)data->buf; + if (ctsenable) + flags |= URTW_TX_FLAG_CTS; + if (rtsenable) { + flags |= URTW_TX_FLAG_RTS; + flags |= (urtw_rate2rtl(11) & 0xf) << + URTW_TX_FLAG_RTSRATE_SHIFT; + tx->rtsdur = rtsdur; + } + tx->flag = htole32(flags); + tx->txdur = txdur; + if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == + IEEE80211_FC0_TYPE_MGT && + (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == + IEEE80211_FC0_SUBTYPE_PROBE_RESP) + tx->retry = 1; + else + tx->retry = URTW_TX_MAXRETRY; + m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1)); } else { - data->buf[8] = 3; /* CW minimum */ - data->buf[8] |= (7 << 4); /* CW maximum */ - data->buf[9] |= 11; /* retry limitation */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[12]); + struct urtw_8187l_txhdr *tx; + + tx = (struct urtw_8187l_txhdr *)data->buf; + if (rtsenable) { + flags |= URTW_TX_FLAG_RTS; + tx->rtsdur = rtsdur; + } + flags |= (urtw_rate2rtl(11) & 0xf) << URTW_TX_FLAG_RTSRATE_SHIFT; + tx->flag = htole32(flags); + tx->retry = 3; /* CW minimum */ + tx->retry = 7 << 4; /* CW maximum */ + tx->retry = URTW_TX_MAXRETRY << 8; /* retry limitation */ + m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(tx + 1)); } data->buflen = xferlen; @@ -2053,8 +2009,8 @@ urtw_read8_c(struct urtw_softc *sc, int req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = URTW_8187_GETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint8_t)); error = urtw_do_request(sc, &req, data); @@ -2071,8 +2027,8 @@ urtw_read16_c(struct urtw_softc *sc, int req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = URTW_8187_GETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint16_t)); error = urtw_do_request(sc, &req, data); @@ -2089,8 +2045,8 @@ urtw_read32_c(struct urtw_softc *sc, int req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = URTW_8187_GETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint32_t)); error = urtw_do_request(sc, &req, data); @@ -2106,8 +2062,8 @@ urtw_write8_c(struct urtw_softc *sc, int req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint8_t)); return (urtw_do_request(sc, &req, &data)); @@ -2122,8 +2078,8 @@ urtw_write16_c(struct urtw_softc *sc, in req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint16_t)); return (urtw_do_request(sc, &req, &data)); @@ -2138,8 +2094,8 @@ urtw_write32_c(struct urtw_softc *sc, in req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = URTW_8187_SETREGS_REQ; - USETW(req.wValue, val | 0xff00); - USETW(req.wIndex, 0); + USETW(req.wValue, (val & 0xff) | 0xff00); + USETW(req.wIndex, (val >> 8) & 0x3); USETW(req.wLength, sizeof(uint32_t)); return (urtw_do_request(sc, &req, &data)); @@ -2403,6 +2359,38 @@ urtw_get_rfchip(struct urtw_softc *sc) uint32_t data; usb_error_t error; + if (sc->sc_flags & URTW_RTL8187B) { + urtw_read8_m(sc, 0xe1, &data8); + switch (data8) { + case 0: + sc->sc_flags |= URTW_RTL8187B_REV_B; + break; + case 1: + sc->sc_flags |= URTW_RTL8187B_REV_D; + break; + case 2: + sc->sc_flags |= URTW_RTL8187B_REV_E; + break; + default: + device_printf(sc->sc_dev, "unknown type: %#x\n", data8); + sc->sc_flags |= URTW_RTL8187B_REV_B; + break; + } + } else { + urtw_read32_m(sc, URTW_TX_CONF, &data); + switch (data & URTW_TX_HWMASK) { + case URTW_TX_R8187vD_B: + sc->sc_flags |= URTW_RTL8187B; + break; + case URTW_TX_R8187vD: + break; + default: + device_printf(sc->sc_dev, "unknown RTL8187L type: %#x\n", + data & URTW_TX_HWMASK); + break; + } + } + error = urtw_eprom_read32(sc, URTW_EPROM_RFCHIPID, &data); if (error != 0) goto fail; @@ -2436,12 +2424,6 @@ urtw_get_rfchip(struct urtw_softc *sc) /* never reach */ } - if (sc->sc_flags & URTW_RTL8187B) { - urtw_read8_m(sc, 0xe1, &data8); - sc->sc_flags |= (data8 == 0) ? URTW_RTL8187B_REV_B : - (data8 == 1) ? URTW_RTL8187B_REV_D : URTW_RTL8187B_REV_E; - } - device_printf(sc->sc_dev, "%s rf %s hwrev %s\n", (sc->sc_flags & URTW_RTL8187B) ? "rtl8187b" : "rtl8187l", ((data & 0xff) == URTW_EPROM_RFCHIPID_RTL8225U) ? "rtl8225u" : @@ -2761,8 +2743,6 @@ fail0: return (error); static usb_error_t urtw_8225_rf_set_chan(struct urtw_softc *sc, int chan) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ieee80211_channel *c = ic->ic_curchan; usb_error_t error; error = urtw_8225_set_txpwrlvl(sc, chan); @@ -2770,27 +2750,6 @@ urtw_8225_rf_set_chan(struct urtw_softc goto fail; urtw_8225_write(sc, URTW_8225_ADDR_7_MAGIC, urtw_8225_channel[chan]); usb_pause_mtx(&sc->sc_mtx, 10); - - urtw_write8_m(sc, URTW_SIFS, 0x22); - - if (sc->sc_state == IEEE80211_S_ASSOC && - ic->ic_flags & IEEE80211_F_SHSLOT) - urtw_write8_m(sc, URTW_SLOT, 0x9); - else - urtw_write8_m(sc, URTW_SLOT, 0x14); - - if (IEEE80211_IS_CHAN_G(c)) { - /* for G */ - urtw_write8_m(sc, URTW_DIFS, 0x14); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14); - urtw_write8_m(sc, URTW_CW_VAL, 0x73); - } else { - /* for B */ - urtw_write8_m(sc, URTW_DIFS, 0x24); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x24); - urtw_write8_m(sc, URTW_CW_VAL, 0xa5); - } - fail: return (error); } @@ -3038,8 +2997,6 @@ fail: static usb_error_t urtw_8225v2_rf_set_chan(struct urtw_softc *sc, int chan) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ieee80211_channel *c = ic->ic_curchan; usb_error_t error; error = urtw_8225v2_set_txpwrlvl(sc, chan); @@ -3048,27 +3005,6 @@ urtw_8225v2_rf_set_chan(struct urtw_soft urtw_8225_write(sc, URTW_8225_ADDR_7_MAGIC, urtw_8225_channel[chan]); usb_pause_mtx(&sc->sc_mtx, 10); - - urtw_write8_m(sc, URTW_SIFS, 0x22); - - if(sc->sc_state == IEEE80211_S_ASSOC && - ic->ic_flags & IEEE80211_F_SHSLOT) - urtw_write8_m(sc, URTW_SLOT, 0x9); - else - urtw_write8_m(sc, URTW_SLOT, 0x14); - - if (IEEE80211_IS_CHAN_G(c)) { - /* for G */ - urtw_write8_m(sc, URTW_DIFS, 0x14); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x14); - urtw_write8_m(sc, URTW_CW_VAL, 0x73); - } else { - /* for B */ - urtw_write8_m(sc, URTW_DIFS, 0x24); - urtw_write8_m(sc, URTW_EIFS, 0x5b - 0x24); - urtw_write8_m(sc, URTW_CW_VAL, 0xa5); - } - fail: return (error); } @@ -3271,53 +3207,156 @@ urtw_8225v2b_rf_init(struct urtw_softc * { #define N(a) (sizeof(a) / sizeof((a)[0])) int i; + uint8_t data8; usb_error_t error; + error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); + if (error) + goto fail; + + /* + * initialize extra registers on 8187 + */ + urtw_write16_m(sc, URTW_BRSR_8187B, 0xfff); + + /* retry limit */ + urtw_read8_m(sc, URTW_CW_CONF, &data8); + data8 |= URTW_CW_CONF_PERPACKET_RETRY; + urtw_write8_m(sc, URTW_CW_CONF, data8); + + /* TX AGC */ + urtw_read8_m(sc, URTW_TX_AGC_CTL, &data8); + data8 |= URTW_TX_AGC_CTL_PERPACKET_GAIN; + urtw_write8_m(sc, URTW_TX_AGC_CTL, data8); + + /* Auto Rate Fallback Control */ +#define URTW_ARFR 0x1e0 + urtw_write16_m(sc, URTW_ARFR, 0xfff); + urtw_read8_m(sc, URTW_RATE_FALLBACK, &data8); + urtw_write8_m(sc, URTW_RATE_FALLBACK, + data8 | URTW_RATE_FALLBACK_ENABLE); + + urtw_read8_m(sc, URTW_MSR, &data8); + urtw_write8_m(sc, URTW_MSR, data8 & 0xf3); + urtw_read8_m(sc, URTW_MSR, &data8); + urtw_write8_m(sc, URTW_MSR, data8 | URTW_MSR_LINK_ENEDCA); + urtw_write8_m(sc, URTW_ACM_CONTROL, sc->sc_acmctl); + + urtw_write16_m(sc, URTW_ATIM_WND, 2); + urtw_write16_m(sc, URTW_BEACON_INTERVAL, 100); +#define URTW_FEMR_FOR_8187B 0x1d4 + urtw_write16_m(sc, URTW_FEMR_FOR_8187B, 0xffff); + + /* led type */ + urtw_read8_m(sc, URTW_CONFIG1, &data8); + data8 = (data8 & 0x3f) | 0x80; + urtw_write8_m(sc, URTW_CONFIG1, data8); + + /* applying MAC address again. */ + urtw_write32_m(sc, URTW_MAC0, ((uint32_t *)sc->sc_bssid)[0]); + urtw_write16_m(sc, URTW_MAC4, ((uint32_t *)sc->sc_bssid)[1] & 0xffff); + + error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); + if (error) + goto fail; + + urtw_write8_m(sc, URTW_WPA_CONFIG, 0); + + /* + * MAC configuration + */ for (i = 0; i < N(urtw_8225v2b_rf_part1); i++) - urtw_8225_write(sc, urtw_8225v2b_rf_part1[i].reg, + urtw_write8_m(sc, urtw_8225v2b_rf_part1[i].reg, urtw_8225v2b_rf_part1[i].val); + urtw_write16_m(sc, URTW_TID_AC_MAP, 0xfa50); + urtw_write16_m(sc, URTW_INT_MIG, 0x0000); + urtw_write32_m(sc, 0x1f0, 0); + urtw_write32_m(sc, 0x1f4, 0); + urtw_write8_m(sc, 0x1f8, 0); + urtw_write32_m(sc, URTW_RF_TIMING, 0x4001); - urtw_8225_write(sc, - URTW_8225_ADDR_0_MAGIC, URTW_8225_ADDR_0_DATA_MAGIC1); +#define URTW_RFSW_CTRL 0x272 + urtw_write16_m(sc, URTW_RFSW_CTRL, 0x569a); + + /* + * initialize PHY + */ + error = urtw_set_mode(sc, URTW_EPROM_CMD_CONFIG); + if (error) + goto fail; + urtw_read8_m(sc, URTW_CONFIG3, &data8); + urtw_write8_m(sc, URTW_CONFIG3, + data8 | URTW_CONFIG3_ANAPARAM_WRITE); - for (i = 0; i < N(urtw_8225v2b_rxgain); i++) { + error = urtw_set_mode(sc, URTW_EPROM_CMD_NORMAL); + if (error) + goto fail; + + /* setup RFE initial timing */ + urtw_write16_m(sc, URTW_RF_PINS_OUTPUT, 0x0480); + urtw_write16_m(sc, URTW_RF_PINS_SELECT, 0x2488); + urtw_write16_m(sc, URTW_RF_PINS_ENABLE, 0x1fff); + usb_pause_mtx(&sc->sc_mtx, 1100); + + for (i = 0; i < N(urtw_8225v2b_rf_part0); i++) { + urtw_8225_write(sc, urtw_8225v2b_rf_part0[i].reg, + urtw_8225v2b_rf_part0[i].val); + usb_pause_mtx(&sc->sc_mtx, 1); + } + urtw_8225_write(sc, 0x00, 0x01b7); + + for (i = 0; i < 95; i++) { urtw_8225_write(sc, URTW_8225_ADDR_1_MAGIC, (uint8_t)(i + 1)); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, urtw_8225v2b_rxgain[i]); + usb_pause_mtx(&sc->sc_mtx, 1); } urtw_8225_write(sc, URTW_8225_ADDR_3_MAGIC, 0x080); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_5_MAGIC, 0x004); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_0_MAGIC, 0x0b7); + usb_pause_mtx(&sc->sc_mtx, 1); + usb_pause_mtx(&sc->sc_mtx, 3000); urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, 0xc4d); + usb_pause_mtx(&sc->sc_mtx, 2000); urtw_8225_write(sc, URTW_8225_ADDR_2_MAGIC, 0x44d); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_8225_write(sc, URTW_8225_ADDR_0_MAGIC, 0x2bf); + usb_pause_mtx(&sc->sc_mtx, 1); urtw_write8_m(sc, URTW_TX_GAIN_CCK, 0x03); urtw_write8_m(sc, URTW_TX_GAIN_OFDM, 0x07); urtw_write8_m(sc, URTW_TX_ANTENNA, 0x03); urtw_8187_write_phy_ofdm(sc, 0x80, 0x12); - for (i = 0; i < N(urtw_8225z2_agc); i++) { - urtw_8187_write_phy_ofdm(sc, 0xf, urtw_8225z2_agc[i]); - urtw_8187_write_phy_ofdm(sc, 0xe, 0x80 + i); - urtw_8187_write_phy_ofdm(sc, 0xe, 0); + for (i = 0; i < 128; i++) { + uint32_t addr, data; + + data = (urtw_8225z2_agc[i] << 8) | 0x0000008f; + addr = ((i + 0x80) << 8) | 0x0000008e; + + urtw_8187_write_phy_ofdm(sc, data & 0x7f, (data >> 8) & 0xff); + urtw_8187_write_phy_ofdm(sc, addr & 0x7f, (addr >> 8) & 0xff); + urtw_8187_write_phy_ofdm(sc, 0x0e, 0x00); } urtw_8187_write_phy_ofdm(sc, 0x80, 0x10); for (i = 0; i < N(urtw_8225v2b_rf_part2); i++) urtw_8187_write_phy_ofdm(sc, i, urtw_8225v2b_rf_part2[i].val); - urtw_write32_m(sc, 0xf0, (7 << 12) | (3 << 8) | 0x1c); - urtw_write32_m(sc, 0xf4, (7 << 12) | (3 << 8) | 0x1c); - urtw_write32_m(sc, 0xf8, (7 << 12) | (3 << 8) | 0x1c); - urtw_write32_m(sc, 0xfc, (7 << 12) | (3 << 8) | 0x1c); - urtw_write8_m(sc, URTW_ACM_CONTROL, 0); + urtw_write32_m(sc, URTW_8187B_AC_VO, (7 << 12) | (3 << 8) | 0x1c); + urtw_write32_m(sc, URTW_8187B_AC_VI, (7 << 12) | (3 << 8) | 0x1c); + urtw_write32_m(sc, URTW_8187B_AC_BE, (7 << 12) | (3 << 8) | 0x1c); + urtw_write32_m(sc, URTW_8187B_AC_BK, (7 << 12) | (3 << 8) | 0x1c); urtw_8187_write_phy_ofdm(sc, 0x97, 0x46); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:31:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8F8B106566C; Wed, 9 Dec 2009 22:31:45 +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 D6AFC8FC17; Wed, 9 Dec 2009 22:31: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 nB9MVjgY041535; Wed, 9 Dec 2009 22:31:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MVjmJ041533; Wed, 9 Dec 2009 22:31:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092231.nB9MVjmJ041533@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200322 - stable/8/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:31:46 -0000 Author: thompsa Date: Wed Dec 9 22:31:45 2009 New Revision: 200322 URL: http://svn.freebsd.org/changeset/base/200322 Log: MFC r198774 Check unit number and provide string name for consdev. Submitted by: HPS Modified: stable/8/sys/dev/usb/serial/usb_serial.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.c Wed Dec 9 22:28:08 2009 (r200321) +++ stable/8/sys/dev/usb/serial/usb_serial.c Wed Dec 9 22:31:45 2009 (r200322) @@ -1300,7 +1300,12 @@ CONSOLE_DRIVER(ucom); static void ucom_cnprobe(struct consdev *cp) { - cp->cn_pri = CN_NORMAL; + if (ucom_cons_unit != -1) + cp->cn_pri = CN_NORMAL; + else + cp->cn_pri = CN_DEAD; + + strlcpy(cp->cn_name, "ucom", sizeof(cp->cn_name)); } static void From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:32:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FB5A1065695; Wed, 9 Dec 2009 22:32:37 +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 1D5298FC16; Wed, 9 Dec 2009 22:32: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 nB9MWbNk041603; Wed, 9 Dec 2009 22:32:37 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MWaNB041600; Wed, 9 Dec 2009 22:32:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092232.nB9MWaNB041600@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200323 - stable/8/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:32:37 -0000 Author: thompsa Date: Wed Dec 9 22:32:36 2009 New Revision: 200323 URL: http://svn.freebsd.org/changeset/base/200323 Log: MFC r198776 - Add usb_fill_bulk_urb() and usb_bulk_msg() linux compat functions [1] - Don't write actual length if the actual length pointer is NULL [2] - correct Linux Compatibility error codes for short isochronous IN transfers and make status field signed. Submitted by: Leunam Elebek [1], Manuel Gebele [2] Modified: stable/8/sys/dev/usb/usb_compat_linux.c stable/8/sys/dev/usb/usb_compat_linux.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/usb_compat_linux.c ============================================================================== --- stable/8/sys/dev/usb/usb_compat_linux.c Wed Dec 9 22:31:45 2009 (r200322) +++ stable/8/sys/dev/usb/usb_compat_linux.c Wed Dec 9 22:32:36 2009 (r200323) @@ -624,10 +624,11 @@ usb_start_wait_urb(struct urb *urb, usb_ done: if (do_unlock) mtx_unlock(&Giant); - if (err) { - *p_actlen = 0; - } else { - *p_actlen = urb->actual_length; + if (p_actlen != NULL) { + if (err) + *p_actlen = 0; + else + *p_actlen = urb->actual_length; } return (err); } @@ -1362,8 +1363,17 @@ usb_linux_isoc_callback(struct usb_xfer for (x = 0; x < urb->number_of_packets; x++) { uipd = urb->iso_frame_desc + x; + if (uipd->length > xfer->frlengths[x]) { + if (urb->transfer_flags & URB_SHORT_NOT_OK) { + /* XXX should be EREMOTEIO */ + uipd->status = -EPIPE; + } else { + uipd->status = 0; + } + } else { + uipd->status = 0; + } uipd->actual_length = xfer->frlengths[x]; - uipd->status = 0; if (!xfer->flags.ext_buffer) { usbd_copy_out(xfer->frbuffers, offset, USB_ADD_BYTES(urb->transfer_buffer, @@ -1385,8 +1395,8 @@ usb_linux_isoc_callback(struct usb_xfer if (xfer->actlen < xfer->sumlen) { /* short transfer */ if (urb->transfer_flags & URB_SHORT_NOT_OK) { - urb->status = -EPIPE; /* XXX should be - * EREMOTEIO */ + /* XXX should be EREMOTEIO */ + urb->status = -EPIPE; } else { urb->status = 0; } @@ -1482,6 +1492,7 @@ tr_setup: /* Set zero for "actual_length" */ for (x = 0; x < urb->number_of_packets; x++) { urb->iso_frame_desc[x].actual_length = 0; + urb->iso_frame_desc[x].status = urb->status; } /* call callback */ @@ -1663,3 +1674,58 @@ setup_bulk: goto tr_setup; } } + +/*------------------------------------------------------------------------* + * usb_fill_bulk_urb + *------------------------------------------------------------------------*/ +void +usb_fill_bulk_urb(struct urb *urb, struct usb_device *udev, + struct usb_host_endpoint *uhe, void *buf, + int length, usb_complete_t callback, void *arg) +{ + urb->dev = udev; + urb->endpoint = uhe; + urb->transfer_buffer = buf; + urb->transfer_buffer_length = length; + urb->complete = callback; + urb->context = arg; +} + +/*------------------------------------------------------------------------* + * usb_bulk_msg + * + * NOTE: This function can also be used for interrupt endpoints! + * + * Return values: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +int +usb_bulk_msg(struct usb_device *udev, struct usb_host_endpoint *uhe, + void *data, int len, uint16_t *pactlen, usb_timeout_t timeout) +{ + struct urb *urb; + int err; + + if (uhe == NULL) + return (-EINVAL); + if (len < 0) + return (-EINVAL); + + err = usb_setup_endpoint(udev, uhe, 4096 /* bytes */); + if (err) + return (err); + + urb = usb_alloc_urb(0, 0); + if (urb == NULL) + return (-ENOMEM); + + usb_fill_bulk_urb(urb, udev, uhe, data, len, + usb_linux_wait_complete, NULL); + + err = usb_start_wait_urb(urb, timeout, pactlen); + + usb_free_urb(urb); + + return (err); +} Modified: stable/8/sys/dev/usb/usb_compat_linux.h ============================================================================== --- stable/8/sys/dev/usb/usb_compat_linux.h Wed Dec 9 22:31:45 2009 (r200322) +++ stable/8/sys/dev/usb/usb_compat_linux.h Wed Dec 9 22:32:36 2009 (r200323) @@ -217,7 +217,7 @@ struct usb_iso_packet_descriptor { * packets are usually back to back) */ uint16_t length; /* expected length */ uint16_t actual_length; - uint16_t status; + int16_t status; /* transfer status */ }; /* @@ -299,6 +299,11 @@ void usb_set_intfdata(struct usb_interfa void usb_linux_register(void *arg); void usb_linux_deregister(void *arg); +void usb_fill_bulk_urb(struct urb *, struct usb_device *, + struct usb_host_endpoint *, void *, int, usb_complete_t, void *); +int usb_bulk_msg(struct usb_device *, struct usb_host_endpoint *, + void *, int, uint16_t *, usb_timeout_t); + #define interface_to_usbdev(intf) (intf)->linux_udev #define interface_to_bsddev(intf) (intf)->linux_udev From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:33:22 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C82FF10656C0; Wed, 9 Dec 2009 22:33:22 +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 B5B978FC0A; Wed, 9 Dec 2009 22:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB9MXMrZ041688; Wed, 9 Dec 2009 22:33:22 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MXM3l041684; Wed, 9 Dec 2009 22:33:22 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092233.nB9MXM3l041684@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200324 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:33:22 -0000 Author: thompsa Date: Wed Dec 9 22:33:22 2009 New Revision: 200324 URL: http://svn.freebsd.org/changeset/base/200324 Log: MFC r199057 ehci_init() will do reset and set the usbrev flag. Fix problem where ehci_reset() was called before ehci_init(). PR: usb/140242 Submitted by: Sebastian Huber Modified: stable/8/sys/dev/usb/controller/ehci_ixp4xx.c stable/8/sys/dev/usb/controller/ehci_mbus.c stable/8/sys/dev/usb/controller/ehci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci_ixp4xx.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci_ixp4xx.c Wed Dec 9 22:32:36 2009 (r200323) +++ stable/8/sys/dev/usb/controller/ehci_ixp4xx.c Wed Dec 9 22:33:22 2009 (r200324) @@ -157,8 +157,6 @@ ehci_ixp_attach(device_t self) return (ENOMEM); } - sc->sc_bus.usbrev = USB_REV_2_0; - /* NB: hints fix the memory location and irq */ rid = 0; @@ -230,7 +228,6 @@ ehci_ixp_attach(device_t self) | EHCI_SCFLG_BIGEMMIO | EHCI_SCFLG_NORESTERM ; - (void) ehci_reset(sc); err = ehci_init(sc); if (!err) { Modified: stable/8/sys/dev/usb/controller/ehci_mbus.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci_mbus.c Wed Dec 9 22:32:36 2009 (r200323) +++ stable/8/sys/dev/usb/controller/ehci_mbus.c Wed Dec 9 22:33:22 2009 (r200324) @@ -166,8 +166,6 @@ ehci_mbus_attach(device_t self) return (ENOMEM); } - sc->sc_bus.usbrev = USB_REV_2_0; - rid = 0; sc->sc_io_res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (!sc->sc_io_res) { Modified: stable/8/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci_pci.c Wed Dec 9 22:32:36 2009 (r200323) +++ stable/8/sys/dev/usb/controller/ehci_pci.c Wed Dec 9 22:33:22 2009 (r200324) @@ -318,13 +318,11 @@ ehci_pci_attach(device_t self) device_printf(self, "pre-2.0 USB revision (ignored)\n"); /* fallthrough */ case PCI_USB_REV_2_0: - sc->sc_bus.usbrev = USB_REV_2_0; break; default: /* Quirk for Parallels Desktop 4.0 */ device_printf(self, "USB revision is unknown. Assuming v2.0.\n"); - sc->sc_bus.usbrev = USB_REV_2_0; - break; + break; } rid = PCI_CBMEM; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:34:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BDA7106568B; Wed, 9 Dec 2009 22:34:12 +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 ED4268FC1E; Wed, 9 Dec 2009 22:34: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 nB9MYBUW041757; Wed, 9 Dec 2009 22:34:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MYBqS041752; Wed, 9 Dec 2009 22:34:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092234.nB9MYBqS041752@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200325 - in stable/8/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:34:12 -0000 Author: thompsa Date: Wed Dec 9 22:34:11 2009 New Revision: 200325 URL: http://svn.freebsd.org/changeset/base/200325 Log: MFC r199059 improve support for high speed isochronous endpoints which does not run 1:1, but needs intervalling 1:2, 1:4 or 1:8 Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/usb_core.h stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usbdi.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:33:22 2009 (r200324) +++ stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:34:11 2009 (r200325) @@ -2140,7 +2140,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru DPRINTFN(13, "xfer=%p endpoint=%p transfer done\n", xfer, xfer->endpoint); - while (nframes--) { + while (nframes) { if (td == NULL) { panic("%s:%d: out of TD's\n", __FUNCTION__, __LINE__); @@ -2162,21 +2162,26 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru DPRINTFN(2, "status=0x%08x, len=%u\n", status, len); - if (*plen >= len) { - /* - * The length is valid. NOTE: The complete - * length is written back into the status - * field, and not the remainder like with - * other transfer descriptor types. - */ - } else { - /* Invalid length - truncate */ - len = 0; - } + if (xfer->usb_smask & (1 << td_no)) { - *plen = len; + if (*plen >= len) { + /* + * The length is valid. NOTE: The + * complete length is written back + * into the status field, and not the + * remainder like with other transfer + * descriptor types. + */ + } else { + /* Invalid length - truncate */ + len = 0; + } + + *plen = len; + plen++; + nframes--; + } - plen++; td_no++; if ((td_no == 8) || (nframes == 0)) { @@ -2393,10 +2398,9 @@ static void ehci_device_intr_close(struct usb_xfer *xfer) { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - uint8_t slot; - slot = usb_intr_schedule_adjust - (xfer->xroot->udev, -(xfer->max_frame_size), xfer->usb_uframe); + usb_intr_schedule_adjust(xfer->xroot->udev, + -(xfer->max_frame_size), xfer->usb_uframe); sc->sc_intr_stat[xfer->qh_pos]--; @@ -2722,6 +2726,28 @@ ehci_device_isoc_hs_open(struct usb_xfer ehci_itd_t *td; uint32_t temp; uint8_t ds; + uint8_t slot; + + slot = usb_intr_schedule_adjust(xfer->xroot->udev, xfer->max_frame_size, + USB_HS_MICRO_FRAMES_MAX); + + xfer->usb_uframe = slot; + xfer->usb_cmask = 0; + + switch (usbd_xfer_get_fps_shift(xfer)) { + case 0: + xfer->usb_smask = 0xFF; + break; + case 1: + xfer->usb_smask = 0x55 << (slot & 1); + break; + case 2: + xfer->usb_smask = 0x11 << (slot & 3); + break; + default: + xfer->usb_smask = 0x01 << (slot & 7); + break; + } /* initialize all TD's */ @@ -2765,6 +2791,10 @@ ehci_device_isoc_hs_open(struct usb_xfer static void ehci_device_isoc_hs_close(struct usb_xfer *xfer) { + + usb_intr_schedule_adjust(xfer->xroot->udev, + -(xfer->max_frame_size), xfer->usb_uframe); + ehci_device_done(xfer, USB_ERR_CANCELLED); } @@ -2854,7 +2884,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe xfer->qh_pos = xfer->endpoint->isoc_next; - while (nframes--) { + while (nframes) { if (td == NULL) { panic("%s:%d: out of TD's\n", __FUNCTION__, __LINE__); @@ -2874,13 +2904,21 @@ ehci_device_isoc_hs_enter(struct usb_xfe #endif *plen = xfer->max_frame_size; } - status = (EHCI_ITD_SET_LEN(*plen) | - EHCI_ITD_ACTIVE | - EHCI_ITD_SET_PG(0)); - td->itd_status[td_no] = htohc32(sc, status); - itd_offset[td_no] = buf_offset; - buf_offset += *plen; - plen++; + + if (xfer->usb_smask & (1 << td_no)) { + status = (EHCI_ITD_SET_LEN(*plen) | + EHCI_ITD_ACTIVE | + EHCI_ITD_SET_PG(0)); + td->itd_status[td_no] = htohc32(sc, status); + itd_offset[td_no] = buf_offset; + buf_offset += *plen; + plen++; + nframes --; + } else { + td->itd_status[td_no] = 0; /* not active */ + itd_offset[td_no] = buf_offset; + } + td_no++; if ((td_no == 8) || (nframes == 0)) { @@ -2937,7 +2975,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe } /* set IOC bit if we are complete */ if (nframes == 0) { - td->itd_status[7] |= htohc32(sc, EHCI_ITD_IOC); + td->itd_status[td_no - 1] |= htohc32(sc, EHCI_ITD_IOC); } usb_pc_cpu_flush(td->page_cache); #if USB_DEBUG @@ -3583,7 +3621,8 @@ ehci_xfer_setup(struct usb_setup_params usbd_transfer_setup_sub(parm); - nitd = (xfer->nframes + 7) / 8; + nitd = ((xfer->nframes + 7) / 8) << + usbd_xfer_get_fps_shift(xfer); } else { Modified: stable/8/sys/dev/usb/usb_core.h ============================================================================== --- stable/8/sys/dev/usb/usb_core.h Wed Dec 9 22:33:22 2009 (r200324) +++ stable/8/sys/dev/usb/usb_core.h Wed Dec 9 22:34:11 2009 (r200325) @@ -165,6 +165,7 @@ struct usb_xfer { uint8_t usb_cmask; uint8_t usb_uframe; uint8_t usb_state; + uint8_t fps_shift; /* down shift of FPS, 0..3 */ usb_error_t error; Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Wed Dec 9 22:33:22 2009 (r200324) +++ stable/8/sys/dev/usb/usb_transfer.c Wed Dec 9 22:34:11 2009 (r200325) @@ -416,9 +416,15 @@ usbd_transfer_setup_sub(struct usb_setup case USB_SPEED_LOW: case USB_SPEED_FULL: frame_limit = USB_MAX_FS_ISOC_FRAMES_PER_XFER; + xfer->fps_shift = 0; break; default: frame_limit = USB_MAX_HS_ISOC_FRAMES_PER_XFER; + xfer->fps_shift = edesc->bInterval; + if (xfer->fps_shift > 0) + xfer->fps_shift--; + if (xfer->fps_shift > 3) + xfer->fps_shift = 3; break; } @@ -1826,6 +1832,23 @@ usbd_xfer_get_frame(struct usb_xfer *xfe return (&xfer->frbuffers[frindex]); } +/*------------------------------------------------------------------------* + * usbd_xfer_get_fps_shift + * + * The following function is only useful for isochronous transfers. It + * returns how many times the frame execution rate has been shifted + * down. + * + * Return value: + * Success: 0..3 + * Failure: 0 + *------------------------------------------------------------------------*/ +uint8_t +usbd_xfer_get_fps_shift(struct usb_xfer *xfer) +{ + return (xfer->fps_shift); +} + usb_frlength_t usbd_xfer_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex) { Modified: stable/8/sys/dev/usb/usbdi.h ============================================================================== --- stable/8/sys/dev/usb/usbdi.h Wed Dec 9 22:33:22 2009 (r200324) +++ stable/8/sys/dev/usb/usbdi.h Wed Dec 9 22:34:11 2009 (r200325) @@ -478,6 +478,7 @@ void usbd_xfer_set_frame_offset(struct u usb_frlength_t usbd_xfer_max_len(struct usb_xfer *xfer); usb_frlength_t usbd_xfer_max_framelen(struct usb_xfer *xfer); usb_frcount_t usbd_xfer_max_frames(struct usb_xfer *xfer); +uint8_t usbd_xfer_get_fps_shift(struct usb_xfer *xfer); usb_frlength_t usbd_xfer_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex); void usbd_xfer_set_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex, From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:35:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 633EB10656A4; Wed, 9 Dec 2009 22:35: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 515D88FC14; Wed, 9 Dec 2009 22:35: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 nB9MZ8PR041830; Wed, 9 Dec 2009 22:35:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MZ84B041828; Wed, 9 Dec 2009 22:35:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092235.nB9MZ84B041828@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200326 - stable/8/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:35:08 -0000 Author: thompsa Date: Wed Dec 9 22:35:08 2009 New Revision: 200326 URL: http://svn.freebsd.org/changeset/base/200326 Log: MFC r199061 Add missing mtx_destroy(). Submitted by: Sebastian Huber Modified: stable/8/sys/dev/usb/storage/umass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:34:11 2009 (r200325) +++ stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:35:08 2009 (r200326) @@ -1669,6 +1669,7 @@ umass_detach(device_t dev) #if (__FreeBSD_version >= 700037) mtx_unlock(&sc->sc_mtx); #endif + mtx_destroy(&sc->sc_mtx); return (0); /* success */ } From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:36:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA2C1065670; Wed, 9 Dec 2009 22:36:16 +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 58B248FC0A; Wed, 9 Dec 2009 22:36: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 nB9MaGJo041898; Wed, 9 Dec 2009 22:36:16 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MaGCn041896; Wed, 9 Dec 2009 22:36:16 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092236.nB9MaGCn041896@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200327 - stable/8/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:36:16 -0000 Author: thompsa Date: Wed Dec 9 22:36:16 2009 New Revision: 200327 URL: http://svn.freebsd.org/changeset/base/200327 Log: MFC r199062 Correct Olympus quirk. Submitted by: Pavel Gubin Modified: stable/8/sys/dev/usb/storage/umass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:35:08 2009 (r200326) +++ stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:36:16 2009 (r200327) @@ -679,7 +679,7 @@ static const struct umass_devdescr umass WRONG_CSWSIG }, {USB_VENDOR_OLYMPUS, USB_PRODUCT_OLYMPUS_C700, RID_WILDCARD, - UMASS_PROTO_SCSI, + UMASS_PROTO_DEFAULT, NO_GETMAXLUN }, {USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_SDS_HOTFIND_D, RID_WILDCARD, From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:37:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 655721065692; Wed, 9 Dec 2009 22:37:06 +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 5245A8FC08; Wed, 9 Dec 2009 22:37: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 nB9Mb6qM041976; Wed, 9 Dec 2009 22:37:06 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Mb61k041968; Wed, 9 Dec 2009 22:37:06 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092237.nB9Mb61k041968@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:37:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200328 - in stable/8/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:37:06 -0000 Author: thompsa Date: Wed Dec 9 22:37:06 2009 New Revision: 200328 URL: http://svn.freebsd.org/changeset/base/200328 Log: MFC r199672 Improve High Speed slot allocation mechanism by moving the computation to the endpoint rather than per xfer and provide functions around get/free of resources. Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/usb_core.h stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_hub.h stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/usbdi.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:37:06 2009 (r200328) @@ -2016,8 +2016,8 @@ ehci_setup_standard_chain(struct usb_xfe qh_endphub = (EHCI_QH_SET_MULT(xfer->max_packet_count & 3) | - EHCI_QH_SET_CMASK(xfer->usb_cmask) | - EHCI_QH_SET_SMASK(xfer->usb_smask) | + EHCI_QH_SET_CMASK(xfer->endpoint->usb_cmask) | + EHCI_QH_SET_SMASK(xfer->endpoint->usb_smask) | EHCI_QH_SET_HUBA(xfer->xroot->udev->hs_hub_addr) | EHCI_QH_SET_PORT(xfer->xroot->udev->hs_port_no)); @@ -2162,7 +2162,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru DPRINTFN(2, "status=0x%08x, len=%u\n", status, len); - if (xfer->usb_smask & (1 << td_no)) { + if (xfer->endpoint->usb_smask & (1 << td_no)) { if (*plen >= len) { /* @@ -2348,22 +2348,8 @@ ehci_device_intr_open(struct usb_xfer *x uint16_t best; uint16_t bit; uint16_t x; - uint8_t slot; - /* Allocate a microframe slot first: */ - - slot = usb_intr_schedule_adjust - (xfer->xroot->udev, xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX); - - if (usbd_get_speed(xfer->xroot->udev) == USB_SPEED_HIGH) { - xfer->usb_uframe = slot; - xfer->usb_smask = (1 << slot) & 0xFF; - xfer->usb_cmask = 0; - } else { - xfer->usb_uframe = slot; - xfer->usb_smask = (1 << slot) & 0x3F; - xfer->usb_cmask = (-(4 << slot)) & 0xFE; - } + usb_hs_bandwidth_alloc(xfer); /* * Find the best QH position corresponding to the given interval: @@ -2399,12 +2385,12 @@ ehci_device_intr_close(struct usb_xfer * { ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); - usb_intr_schedule_adjust(xfer->xroot->udev, - -(xfer->max_frame_size), xfer->usb_uframe); - sc->sc_intr_stat[xfer->qh_pos]--; ehci_device_done(xfer, USB_ERR_CANCELLED); + + /* bandwidth must be freed after device done */ + usb_hs_bandwidth_free(xfer); } static void @@ -2726,28 +2712,8 @@ ehci_device_isoc_hs_open(struct usb_xfer ehci_itd_t *td; uint32_t temp; uint8_t ds; - uint8_t slot; - - slot = usb_intr_schedule_adjust(xfer->xroot->udev, xfer->max_frame_size, - USB_HS_MICRO_FRAMES_MAX); - xfer->usb_uframe = slot; - xfer->usb_cmask = 0; - - switch (usbd_xfer_get_fps_shift(xfer)) { - case 0: - xfer->usb_smask = 0xFF; - break; - case 1: - xfer->usb_smask = 0x55 << (slot & 1); - break; - case 2: - xfer->usb_smask = 0x11 << (slot & 3); - break; - default: - xfer->usb_smask = 0x01 << (slot & 7); - break; - } + usb_hs_bandwidth_alloc(xfer); /* initialize all TD's */ @@ -2791,11 +2757,10 @@ ehci_device_isoc_hs_open(struct usb_xfer static void ehci_device_isoc_hs_close(struct usb_xfer *xfer) { - - usb_intr_schedule_adjust(xfer->xroot->udev, - -(xfer->max_frame_size), xfer->usb_uframe); - ehci_device_done(xfer, USB_ERR_CANCELLED); + + /* bandwidth must be freed after device done */ + usb_hs_bandwidth_free(xfer); } static void @@ -2905,7 +2870,7 @@ ehci_device_isoc_hs_enter(struct usb_xfe *plen = xfer->max_frame_size; } - if (xfer->usb_smask & (1 << td_no)) { + if (xfer->endpoint->usb_smask & (1 << td_no)) { status = (EHCI_ITD_SET_LEN(*plen) | EHCI_ITD_ACTIVE | EHCI_ITD_SET_PG(0)); Modified: stable/8/sys/dev/usb/usb_core.h ============================================================================== --- stable/8/sys/dev/usb/usb_core.h Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/usb_core.h Wed Dec 9 22:37:06 2009 (r200328) @@ -161,9 +161,6 @@ struct usb_xfer { uint8_t address; /* physical USB address */ uint8_t endpointno; /* physical USB endpoint */ uint8_t max_packet_count; - uint8_t usb_smask; - uint8_t usb_cmask; - uint8_t usb_uframe; uint8_t usb_state; uint8_t fps_shift; /* down shift of FPS, 0..3 */ Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/usb_device.c Wed Dec 9 22:37:06 2009 (r200328) @@ -665,7 +665,7 @@ usb_config_parse(struct usb_device *udev /* look for matching endpoints */ if ((iface_index == USB_IFACE_INDEX_ANY) || (iface_index == ep->iface_index)) { - if (ep->refcount != 0) { + if (ep->refcount_alloc != 0) { /* * This typically indicates a * more serious error. Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/usb_hub.c Wed Dec 9 22:37:06 2009 (r200328) @@ -1106,43 +1106,62 @@ done: * The best Transaction Translation slot for an interrupt endpoint. *------------------------------------------------------------------------*/ static uint8_t -usb_intr_find_best_slot(usb_size_t *ptr, uint8_t start, uint8_t end) +usb_intr_find_best_slot(usb_size_t *ptr, uint8_t start, + uint8_t end, uint8_t mask) { - usb_size_t max = 0 - 1; + usb_size_t min = 0 - 1; + usb_size_t sum; uint8_t x; uint8_t y; + uint8_t z; y = 0; /* find the last slot with lesser used bandwidth */ for (x = start; x < end; x++) { - if (max >= ptr[x]) { - max = ptr[x]; + + sum = 0; + + /* compute sum of bandwidth */ + for (z = x; z < end; z++) { + if (mask & (1U << (z - x))) + sum += ptr[z]; + } + + /* check if the current multi-slot is more optimal */ + if (min >= sum) { + min = sum; y = x; } + + /* check if the mask is about to be shifted out */ + if (mask & (1U << (end - 1 - x))) + break; } return (y); } /*------------------------------------------------------------------------* - * usb_intr_schedule_adjust + * usb_hs_bandwidth_adjust * * This function will update the bandwith usage for the microframe * having index "slot" by "len" bytes. "len" can be negative. If the * "slot" argument is greater or equal to "USB_HS_MICRO_FRAMES_MAX" * the "slot" argument will be replaced by the slot having least used - * bandwidth. + * bandwidth. The "mask" argument is used for multi-slot allocations. * * Returns: - * The slot on which the bandwidth update was done. + * The slot in which the bandwidth update was done: 0..7 *------------------------------------------------------------------------*/ -uint8_t -usb_intr_schedule_adjust(struct usb_device *udev, int16_t len, uint8_t slot) +static uint8_t +usb_hs_bandwidth_adjust(struct usb_device *udev, int16_t len, + uint8_t slot, uint8_t mask) { struct usb_bus *bus = udev->bus; struct usb_hub *hub; enum usb_dev_speed speed; + uint8_t x; USB_BUS_LOCK_ASSERT(bus, MA_OWNED); @@ -1164,23 +1183,157 @@ usb_intr_schedule_adjust(struct usb_devi hub = udev->parent_hs_hub->hub; if (slot >= USB_HS_MICRO_FRAMES_MAX) { slot = usb_intr_find_best_slot(hub->uframe_usage, - USB_FS_ISOC_UFRAME_MAX, 6); + USB_FS_ISOC_UFRAME_MAX, 6, mask); + } + for (x = slot; x < 8; x++) { + if (mask & (1U << (x - slot))) { + hub->uframe_usage[x] += len; + bus->uframe_usage[x] += len; + } } - hub->uframe_usage[slot] += len; - bus->uframe_usage[slot] += len; break; default: if (slot >= USB_HS_MICRO_FRAMES_MAX) { slot = usb_intr_find_best_slot(bus->uframe_usage, 0, - USB_HS_MICRO_FRAMES_MAX); + USB_HS_MICRO_FRAMES_MAX, mask); + } + for (x = slot; x < 8; x++) { + if (mask & (1U << (x - slot))) { + bus->uframe_usage[x] += len; + } } - bus->uframe_usage[slot] += len; break; } return (slot); } /*------------------------------------------------------------------------* + * usb_hs_bandwidth_alloc + * + * This function is a wrapper function for "usb_hs_bandwidth_adjust()". + *------------------------------------------------------------------------*/ +void +usb_hs_bandwidth_alloc(struct usb_xfer *xfer) +{ + struct usb_device *udev; + uint8_t slot; + uint8_t mask; + uint8_t speed; + + udev = xfer->xroot->udev; + + if (udev->flags.usb_mode != USB_MODE_HOST) + return; /* not supported */ + + xfer->endpoint->refcount_bw++; + if (xfer->endpoint->refcount_bw != 1) + return; /* already allocated */ + + speed = usbd_get_speed(udev); + + switch (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) { + case UE_INTERRUPT: + /* allocate a microframe slot */ + + mask = 0x01; + slot = usb_hs_bandwidth_adjust(udev, + xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX, mask); + + xfer->endpoint->usb_uframe = slot; + xfer->endpoint->usb_smask = mask << slot; + + if ((speed != USB_SPEED_FULL) && + (speed != USB_SPEED_LOW)) { + xfer->endpoint->usb_cmask = 0x00 ; + } else { + xfer->endpoint->usb_cmask = (-(0x04 << slot)) & 0xFE; + } + break; + + case UE_ISOCHRONOUS: + switch (usbd_xfer_get_fps_shift(xfer)) { + case 0: + mask = 0xFF; + break; + case 1: + mask = 0x55; + break; + case 2: + mask = 0x11; + break; + default: + mask = 0x01; + break; + } + + /* allocate a microframe multi-slot */ + + slot = usb_hs_bandwidth_adjust(udev, + xfer->max_frame_size, USB_HS_MICRO_FRAMES_MAX, mask); + + xfer->endpoint->usb_uframe = slot; + xfer->endpoint->usb_cmask = 0; + xfer->endpoint->usb_smask = mask << slot; + break; + + default: + xfer->endpoint->usb_uframe = 0; + xfer->endpoint->usb_cmask = 0; + xfer->endpoint->usb_smask = 0; + break; + } + + DPRINTFN(11, "slot=%d, mask=0x%02x\n", + xfer->endpoint->usb_uframe, + xfer->endpoint->usb_smask >> xfer->endpoint->usb_uframe); +} + +/*------------------------------------------------------------------------* + * usb_hs_bandwidth_free + * + * This function is a wrapper function for "usb_hs_bandwidth_adjust()". + *------------------------------------------------------------------------*/ +void +usb_hs_bandwidth_free(struct usb_xfer *xfer) +{ + struct usb_device *udev; + uint8_t slot; + uint8_t mask; + + udev = xfer->xroot->udev; + + if (udev->flags.usb_mode != USB_MODE_HOST) + return; /* not supported */ + + xfer->endpoint->refcount_bw--; + if (xfer->endpoint->refcount_bw != 0) + return; /* still allocated */ + + switch (xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE) { + case UE_INTERRUPT: + case UE_ISOCHRONOUS: + + slot = xfer->endpoint->usb_uframe; + mask = xfer->endpoint->usb_smask; + + /* free microframe slot(s): */ + usb_hs_bandwidth_adjust(udev, + -xfer->max_frame_size, slot, mask >> slot); + + DPRINTFN(11, "slot=%d, mask=0x%02x\n", + slot, mask >> slot); + + xfer->endpoint->usb_uframe = 0; + xfer->endpoint->usb_cmask = 0; + xfer->endpoint->usb_smask = 0; + break; + + default: + break; + } +} + +/*------------------------------------------------------------------------* * usbd_fs_isoc_schedule_init_sub * * This function initialises an USB FULL speed isochronous schedule Modified: stable/8/sys/dev/usb/usb_hub.h ============================================================================== --- stable/8/sys/dev/usb/usb_hub.h Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/usb_hub.h Wed Dec 9 22:37:06 2009 (r200328) @@ -66,8 +66,8 @@ struct usb_hub { /* function prototypes */ -uint8_t usb_intr_schedule_adjust(struct usb_device *udev, int16_t len, - uint8_t slot); +void usb_hs_bandwidth_alloc(struct usb_xfer *xfer); +void usb_hs_bandwidth_free(struct usb_xfer *xfer); void usbd_fs_isoc_schedule_init_all(struct usb_fs_isoc_schedule *fss); void usb_bus_port_set_device(struct usb_bus *bus, struct usb_port *up, struct usb_device *udev, uint8_t device_index); Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/usb_transfer.c Wed Dec 9 22:37:06 2009 (r200328) @@ -942,10 +942,18 @@ usbd_transfer_setup(struct usb_device *u * configuration and alternate setting * when USB transfers are in use on * the given interface. Search the USB - * code for "endpoint->refcount" if you + * code for "endpoint->refcount_alloc" if you * want more information. */ - xfer->endpoint->refcount++; + USB_BUS_LOCK(info->bus); + if (xfer->endpoint->refcount_alloc >= USB_EP_REF_MAX) + parm.err = USB_ERR_INVAL; + + xfer->endpoint->refcount_alloc++; + + if (xfer->endpoint->refcount_alloc == 0) + panic("usbd_transfer_setup(): Refcount wrapped to zero\n"); + USB_BUS_UNLOCK(info->bus); /* * Whenever we set ppxfer[] then we @@ -960,6 +968,10 @@ usbd_transfer_setup(struct usb_device *u */ ppxfer[n] = xfer; } + + /* check for error */ + if (parm.err) + goto done; } if (buf || parm.err) { @@ -1179,7 +1191,9 @@ usbd_transfer_unsetup(struct usb_xfer ** * NOTE: default endpoint does not have an * interface, even if endpoint->iface_index == 0 */ - xfer->endpoint->refcount--; + USB_BUS_LOCK(info->bus); + xfer->endpoint->refcount_alloc--; + USB_BUS_UNLOCK(info->bus); usb_callout_drain(&xfer->timeout_handle); Modified: stable/8/sys/dev/usb/usbdi.h ============================================================================== --- stable/8/sys/dev/usb/usbdi.h Wed Dec 9 22:36:16 2009 (r200327) +++ stable/8/sys/dev/usb/usbdi.h Wed Dec 9 22:37:06 2009 (r200328) @@ -130,13 +130,22 @@ struct usb_endpoint { struct usb_pipe_methods *methods; /* set by HC driver */ uint16_t isoc_next; - uint16_t refcount; uint8_t toggle_next:1; /* next data toggle value */ uint8_t is_stalled:1; /* set if endpoint is stalled */ uint8_t is_synced:1; /* set if we a synchronised */ uint8_t unused:5; uint8_t iface_index; /* not used by "default endpoint" */ + + uint8_t refcount_alloc; /* allocation refcount */ + uint8_t refcount_bw; /* bandwidth refcount */ +#define USB_EP_REF_MAX 0x3f + + /* High-Speed resource allocation (valid if "refcount_bw" > 0) */ + + uint8_t usb_smask; /* USB start mask */ + uint8_t usb_cmask; /* USB complete mask */ + uint8_t usb_uframe; /* USB microframe */ }; /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:38:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CAA106568F; Wed, 9 Dec 2009 22:38:03 +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 3D5738FC15; Wed, 9 Dec 2009 22:38: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 nB9Mc37C042045; Wed, 9 Dec 2009 22:38:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Mc3vO042039; Wed, 9 Dec 2009 22:38:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092238.nB9Mc3vO042039@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200329 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:38:03 -0000 Author: thompsa Date: Wed Dec 9 22:38:02 2009 New Revision: 200329 URL: http://svn.freebsd.org/changeset/base/200329 Log: MFC r199673 Initialise variable before use. Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/usb/controller/at91dci.c stable/8/sys/dev/usb/controller/atmegadci.c stable/8/sys/dev/usb/controller/avr32dci.c stable/8/sys/dev/usb/controller/musb_otg.c stable/8/sys/dev/usb/controller/uss820dci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/at91dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/at91dci.c Wed Dec 9 22:37:06 2009 (r200328) +++ stable/8/sys/dev/usb/controller/at91dci.c Wed Dec 9 22:38:02 2009 (r200329) @@ -894,6 +894,7 @@ at91dci_setup_standard_chain(struct usb_ /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: stable/8/sys/dev/usb/controller/atmegadci.c ============================================================================== --- stable/8/sys/dev/usb/controller/atmegadci.c Wed Dec 9 22:37:06 2009 (r200328) +++ stable/8/sys/dev/usb/controller/atmegadci.c Wed Dec 9 22:38:02 2009 (r200329) @@ -797,6 +797,7 @@ atmegadci_setup_standard_chain(struct us /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: stable/8/sys/dev/usb/controller/avr32dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/avr32dci.c Wed Dec 9 22:37:06 2009 (r200328) +++ stable/8/sys/dev/usb/controller/avr32dci.c Wed Dec 9 22:38:02 2009 (r200329) @@ -767,6 +767,7 @@ avr32dci_setup_standard_chain(struct usb /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: stable/8/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/8/sys/dev/usb/controller/musb_otg.c Wed Dec 9 22:37:06 2009 (r200328) +++ stable/8/sys/dev/usb/controller/musb_otg.c Wed Dec 9 22:38:02 2009 (r200329) @@ -1144,6 +1144,7 @@ musbotg_setup_standard_chain(struct usb_ /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; Modified: stable/8/sys/dev/usb/controller/uss820dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uss820dci.c Wed Dec 9 22:37:06 2009 (r200328) +++ stable/8/sys/dev/usb/controller/uss820dci.c Wed Dec 9 22:38:02 2009 (r200329) @@ -858,6 +858,7 @@ uss820dci_setup_standard_chain(struct us /* setup temp */ + temp.pc = NULL; temp.td = NULL; temp.td_next = xfer->td_start[0]; temp.offset = 0; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:39:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B97F6106566B; Wed, 9 Dec 2009 22:39:09 +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 A603E8FC15; Wed, 9 Dec 2009 22:39: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 nB9Md9xR042127; Wed, 9 Dec 2009 22:39:09 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Md9qR042116; Wed, 9 Dec 2009 22:39:09 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092239.nB9Md9qR042116@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200330 - in stable/8/sys/dev/usb: . controller input storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:39:09 -0000 Author: thompsa Date: Wed Dec 9 22:39:09 2009 New Revision: 200330 URL: http://svn.freebsd.org/changeset/base/200330 Log: MFC r199675 Provide tunables for some of the usb sysctls that affect boot behaviour. Submitted by: Andriy Gapon Modified: stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/controller/ohci.c stable/8/sys/dev/usb/controller/uhci.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/usb_debug.c stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_process.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:39:09 2009 (r200330) @@ -99,6 +99,9 @@ SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, &ehcinohighspeed, 0, "Disable High Speed USB"); +TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); +TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); + static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); Modified: stable/8/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ohci.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/controller/ohci.c Wed Dec 9 22:39:09 2009 (r200330) @@ -84,6 +84,9 @@ static int ohcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, &ohcidebug, 0, "ohci debug level"); + +TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); + static void ohci_dumpregs(ohci_softc_t *); static void ohci_dump_tds(ohci_td_t *); static uint8_t ohci_dump_td(ohci_td_t *); Modified: stable/8/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/controller/uhci.c Wed Dec 9 22:39:09 2009 (r200330) @@ -91,6 +91,10 @@ SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug &uhcidebug, 0, "uhci debug level"); SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, &uhcinoloop, 0, "uhci noloop"); + +TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); +TUNABLE_INT("hw.usb.uhci.loop", &uhcinoloop); + static void uhci_dumpregs(uhci_softc_t *sc); static void uhci_dump_tds(uhci_td_t *td); Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/input/ukbd.c Wed Dec 9 22:39:09 2009 (r200330) @@ -105,6 +105,8 @@ SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW, &ukbd_no_leds, 0, "Disables setting of keyboard leds"); +TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); +TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); #endif #define UPROTO_BOOT_KEYBOARD 1 Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:39:09 2009 (r200330) @@ -175,6 +175,8 @@ static int umass_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, &umass_debug, 0, "umass debug level"); + +TUNABLE_INT("hw.usb.umass.debug", &umass_debug); #else #define DIF(...) do { } while (0) #define DPRINTF(...) do { } while (0) Modified: stable/8/sys/dev/usb/usb_debug.c ============================================================================== --- stable/8/sys/dev/usb/usb_debug.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/usb_debug.c Wed Dec 9 22:39:09 2009 (r200330) @@ -67,6 +67,8 @@ SYSCTL_NODE(_hw, OID_AUTO, usb, CTLFLAG_ SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW, &usb_debug, 0, "Debug level"); +TUNABLE_INT("hw.usb.debug", &usb_debug); + /*------------------------------------------------------------------------* * usb_dump_iface * Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/usb_dev.c Wed Dec 9 22:39:09 2009 (r200330) @@ -85,6 +85,8 @@ static int usb_fifo_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, dev, CTLFLAG_RW, 0, "USB device"); SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW, &usb_fifo_debug, 0, "Debug Level"); + +TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); #endif #if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \ Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/usb_generic.c Wed Dec 9 22:39:09 2009 (r200330) @@ -130,6 +130,8 @@ static int ugen_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB generic"); SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW, &ugen_debug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/usb_hub.c Wed Dec 9 22:39:09 2009 (r200330) @@ -79,6 +79,8 @@ static int uhub_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB HUB"); SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW, &uhub_debug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.uhub.debug", &uhub_debug); #endif #if USB_HAVE_POWERD Modified: stable/8/sys/dev/usb/usb_process.c ============================================================================== --- stable/8/sys/dev/usb/usb_process.c Wed Dec 9 22:38:02 2009 (r200329) +++ stable/8/sys/dev/usb/usb_process.c Wed Dec 9 22:39:09 2009 (r200330) @@ -83,6 +83,8 @@ static int usb_proc_debug; SYSCTL_NODE(_hw_usb, OID_AUTO, proc, CTLFLAG_RW, 0, "USB process"); SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW, &usb_proc_debug, 0, "Debug level"); + +TUNABLE_INT("hw.usb.proc.debug", &usb_proc_debug); #endif /*------------------------------------------------------------------------* From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:40:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F6AC106566B; Wed, 9 Dec 2009 22:40:27 +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 4C9098FC17; Wed, 9 Dec 2009 22:40: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 nB9MeRZ5042227; Wed, 9 Dec 2009 22:40:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MeR3W042224; Wed, 9 Dec 2009 22:40:27 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092240.nB9MeR3W042224@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200331 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:40:27 -0000 Author: thompsa Date: Wed Dec 9 22:40:27 2009 New Revision: 200331 URL: http://svn.freebsd.org/changeset/base/200331 Log: MFC r199676 Correct register access for USB device side operation on the musb controller. Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/usb/controller/musb_otg.c stable/8/sys/dev/usb/controller/musb_otg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/8/sys/dev/usb/controller/musb_otg.c Wed Dec 9 22:39:09 2009 (r200330) +++ stable/8/sys/dev/usb/controller/musb_otg.c Wed Dec 9 22:40:27 2009 (r200331) @@ -1539,18 +1539,18 @@ musbotg_clear_stall_sub(struct musbotg_s /* Configure endpoint */ switch (ep_type) { case UE_INTERRUPT: - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, MUSB2_MASK_CSRH_TXMODE | temp); break; case UE_ISOCHRONOUS: - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, MUSB2_MASK_CSRH_TXMODE | MUSB2_MASK_CSRH_TXISO | temp); break; case UE_BULK: - MUSB2_WRITE_1(sc, MUSB2_REG_TXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_TXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_TXCSRH, MUSB2_MASK_CSRH_TXMODE | temp); break; @@ -1600,18 +1600,18 @@ musbotg_clear_stall_sub(struct musbotg_s /* Configure endpoint */ switch (ep_type) { case UE_INTERRUPT: - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, MUSB2_MASK_CSRH_RXNYET | temp); break; case UE_ISOCHRONOUS: - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, MUSB2_MASK_CSRH_RXNYET | MUSB2_MASK_CSRH_RXISO | temp); break; case UE_BULK: - MUSB2_WRITE_1(sc, MUSB2_REG_RXMAXP, wMaxPacket); + MUSB2_WRITE_2(sc, MUSB2_REG_RXMAXP, wMaxPacket); MUSB2_WRITE_1(sc, MUSB2_REG_RXCSRH, temp); break; default: @@ -1688,12 +1688,14 @@ usb_error_t musbotg_init(struct musbotg_softc *sc) { struct usb_hw_ep_profile *pf; + uint16_t offset; uint8_t nrx; uint8_t ntx; uint8_t temp; uint8_t fsize; uint8_t frx; uint8_t ftx; + uint8_t dynfifo; DPRINTFN(1, "start\n"); @@ -1776,11 +1778,20 @@ musbotg_init(struct musbotg_softc *sc) DPRINTFN(2, "Config Data: 0x%02x\n", sc->sc_conf_data); + dynfifo = (sc->sc_conf_data & MUSB2_MASK_CD_DYNFIFOSZ) ? 1 : 0; + + if (dynfifo) { + DPRINTFN(0, "Dynamic FIFO sizing detected! " + "Assuming 16Kbytes of FIFO RAM\n"); + } + DPRINTFN(2, "HW version: 0x%04x\n", MUSB2_READ_1(sc, MUSB2_REG_HWVERS)); /* initialise endpoint profiles */ + offset = 0; + for (temp = 1; temp <= sc->sc_ep_max; temp++) { pf = sc->sc_hw_ep_profile + temp; @@ -1791,9 +1802,45 @@ musbotg_init(struct musbotg_softc *sc) frx = (fsize & MUSB2_MASK_RX_FSIZE) / 16;; ftx = (fsize & MUSB2_MASK_TX_FSIZE); - DPRINTF("Endpoint %u FIFO size: IN=%u, OUT=%u\n", - temp, pf->max_in_frame_size, - pf->max_out_frame_size); + DPRINTF("Endpoint %u FIFO size: IN=%u, OUT=%u, DYN=%d\n", + temp, ftx, frx, dynfifo); + + if (dynfifo) { + if (frx && (temp <= nrx)) { + if (temp < 8) { + frx = 10; /* 1K */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXFIFOSZ, + MUSB2_VAL_FIFOSZ_512 | + MUSB2_MASK_FIFODB); + } else { + frx = 7; /* 128 bytes */ + MUSB2_WRITE_1(sc, MUSB2_REG_RXFIFOSZ, + MUSB2_VAL_FIFOSZ_128); + } + + MUSB2_WRITE_2(sc, MUSB2_REG_RXFIFOADD, + offset >> 3); + + offset += (1 << frx); + } + if (ftx && (temp <= ntx)) { + if (temp < 8) { + ftx = 10; /* 1K */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFIFOSZ, + MUSB2_VAL_FIFOSZ_512 | + MUSB2_MASK_FIFODB); + } else { + ftx = 7; /* 128 bytes */ + MUSB2_WRITE_1(sc, MUSB2_REG_TXFIFOSZ, + MUSB2_VAL_FIFOSZ_128); + } + + MUSB2_WRITE_2(sc, MUSB2_REG_TXFIFOADD, + offset >> 3); + + offset += (1 << ftx); + } + } if (frx && ftx && (temp <= nrx) && (temp <= ntx)) { pf->max_in_frame_size = 1 << ftx; @@ -1824,6 +1871,8 @@ musbotg_init(struct musbotg_softc *sc) } } + DPRINTFN(2, "Dynamic FIFO size = %d bytes\n", offset); + /* turn on default interrupts */ MUSB2_WRITE_1(sc, MUSB2_REG_INTUSBE, Modified: stable/8/sys/dev/usb/controller/musb_otg.h ============================================================================== --- stable/8/sys/dev/usb/controller/musb_otg.h Wed Dec 9 22:39:09 2009 (r200330) +++ stable/8/sys/dev/usb/controller/musb_otg.h Wed Dec 9 22:40:27 2009 (r200331) @@ -191,7 +191,7 @@ #define MUSB2_REG_EPFIFO(n) (0x0020 + (4*(n))) -#define MUSB2_REG_CONFDATA 0x000F /* EPN=0 */ +#define MUSB2_REG_CONFDATA (0x000F + MUSB2_REG_INDEXED_CSR) /* EPN=0 */ #define MUSB2_MASK_CD_UTMI_DW 0x01 #define MUSB2_MASK_CD_SOFTCONE 0x02 #define MUSB2_MASK_CD_DYNFIFOSZ 0x04 From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:41:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A508106566C; Wed, 9 Dec 2009 22:41:11 +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 484318FC0A; Wed, 9 Dec 2009 22:41: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 nB9MfBuZ042294; Wed, 9 Dec 2009 22:41:11 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MfB6v042292; Wed, 9 Dec 2009 22:41:11 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092241.nB9MfB6v042292@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200332 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:41:11 -0000 Author: thompsa Date: Wed Dec 9 22:41:11 2009 New Revision: 200332 URL: http://svn.freebsd.org/changeset/base/200332 Log: MFC r199718 Actually disable interrupts in ehci_detach(). Modified: stable/8/sys/dev/usb/controller/ehci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:40:27 2009 (r200331) +++ stable/8/sys/dev/usb/controller/ehci.c Wed Dec 9 22:41:11 2009 (r200332) @@ -528,7 +528,7 @@ ehci_detach(ehci_softc_t *sc) usb_callout_stop(&sc->sc_tmo_pcd); usb_callout_stop(&sc->sc_tmo_poll); - EOWRITE4(sc, EHCI_USBINTR, sc->sc_eintrs); + EOWRITE4(sc, EHCI_USBINTR, 0); USB_BUS_UNLOCK(&sc->sc_bus); if (ehci_hcreset(sc)) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:41:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68F71065692; Wed, 9 Dec 2009 22:41:50 +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 D43A28FC23; Wed, 9 Dec 2009 22:41: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 nB9Mfoct042357; Wed, 9 Dec 2009 22:41:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9MfoM5042353; Wed, 9 Dec 2009 22:41:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092241.nB9MfoM5042353@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200333 - in stable/8/sys/dev: pci usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:41:51 -0000 Author: thompsa Date: Wed Dec 9 22:41:50 2009 New Revision: 200333 URL: http://svn.freebsd.org/changeset/base/200333 Log: MFC r199814 Disable interrupts after doing early takeover of the usb controller in case usb isnt actually compiled in (or kldloaded) as the controller could cause spurious interrupts. Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/usb/controller/uhci_pci.c stable/8/sys/dev/usb/controller/uhcireg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Wed Dec 9 22:41:11 2009 (r200332) +++ stable/8/sys/dev/pci/pci.c Wed Dec 9 22:41:50 2009 (r200333) @@ -2610,6 +2610,8 @@ ohci_early_takeover(device_t self) "SMM does not respond, resetting\n"); bus_write_4(res, OHCI_CONTROL, OHCI_HCFS_RESET); } + /* Disable interrupts */ + bus_write_4(res, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); @@ -2619,6 +2621,9 @@ ohci_early_takeover(device_t self) static void uhci_early_takeover(device_t self) { + struct resource *res; + int rid; + /* * Set the PIRQD enable bit and switch off all the others. We don't * want legacy support to interfere with us XXX Does this also mean @@ -2626,6 +2631,14 @@ uhci_early_takeover(device_t self) * to the ports of the root hub? */ pci_write_config(self, PCI_LEGSUP, PCI_LEGSUP_USBPIRQDEN, 2); + + /* Disable interrupts */ + rid = PCI_UHCI_BASE_REG; + res = bus_alloc_resource_any(self, SYS_RES_IOPORT, &rid, RF_ACTIVE); + if (res != NULL) { + bus_write_2(res, UHCI_INTR, 0); + bus_release_resource(self, SYS_RES_IOPORT, rid, res); + } } /* Perform early EHCI takeover from SMM. */ @@ -2637,6 +2650,7 @@ ehci_early_takeover(device_t self) uint32_t eec; uint8_t eecp; uint8_t bios_sem; + uint8_t offs; int rid; int i; @@ -2676,6 +2690,9 @@ ehci_early_takeover(device_t self) printf("ehci early: " "SMM does not respond\n"); } + /* Disable interrupts */ + offs = bus_read_1(res, EHCI_CAPLENGTH); + bus_write_4(res, offs + EHCI_USBINTR, 0); } bus_release_resource(self, SYS_RES_MEMORY, rid, res); } Modified: stable/8/sys/dev/usb/controller/uhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci_pci.c Wed Dec 9 22:41:11 2009 (r200332) +++ stable/8/sys/dev/usb/controller/uhci_pci.c Wed Dec 9 22:41:50 2009 (r200333) @@ -88,8 +88,6 @@ __FBSDID("$FreeBSD$"); /* PIIX4E has no separate stepping */ -#define PCI_UHCI_BASE_REG 0x20 - static device_probe_t uhci_pci_probe; static device_attach_t uhci_pci_attach; static device_detach_t uhci_pci_detach; Modified: stable/8/sys/dev/usb/controller/uhcireg.h ============================================================================== --- stable/8/sys/dev/usb/controller/uhcireg.h Wed Dec 9 22:41:11 2009 (r200332) +++ stable/8/sys/dev/usb/controller/uhcireg.h Wed Dec 9 22:41:50 2009 (r200333) @@ -39,6 +39,8 @@ #ifndef _UHCIREG_H_ #define _UHCIREG_H_ +#define PCI_UHCI_BASE_REG 0x20 + /* PCI config registers */ #define PCI_USBREV 0x60 /* USB protocol revision */ #define PCI_USB_REV_MASK 0xff From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 22:42:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 908DD1065679; Wed, 9 Dec 2009 22:42:41 +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 7C03E8FC20; Wed, 9 Dec 2009 22:42: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 nB9MgfWh042461; Wed, 9 Dec 2009 22:42:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9Mgf5h042425; Wed, 9 Dec 2009 22:42:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092242.nB9Mgf5h042425@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 22:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200334 - in stable/8/sys/dev/usb: . controller input net serial storage template wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 22:42:41 -0000 Author: thompsa Date: Wed Dec 9 22:42:40 2009 New Revision: 200334 URL: http://svn.freebsd.org/changeset/base/200334 Log: MFC r199816 Remove overuse of exclamation marks in kernel printfs, there mere fact a message has been printed is enough to get someones attention. Also remove the line number for DPRINTF/DPRINTFN, it already prints the funtion name and a unique message. Modified: stable/8/sys/dev/usb/controller/atmegadci.c stable/8/sys/dev/usb/controller/avr32dci.c stable/8/sys/dev/usb/controller/musb_otg.c stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/net/if_aue.c stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/net/if_cdce.c stable/8/sys/dev/usb/net/if_cue.c stable/8/sys/dev/usb/net/if_kue.c stable/8/sys/dev/usb/net/if_rue.c stable/8/sys/dev/usb/net/if_udav.c stable/8/sys/dev/usb/serial/u3g.c stable/8/sys/dev/usb/serial/uark.c stable/8/sys/dev/usb/serial/ubser.c stable/8/sys/dev/usb/serial/ucycom.c stable/8/sys/dev/usb/serial/ufoma.c stable/8/sys/dev/usb/serial/uftdi.c stable/8/sys/dev/usb/serial/ugensa.c stable/8/sys/dev/usb/serial/umct.c stable/8/sys/dev/usb/serial/umodem.c stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/template/usb_template.c stable/8/sys/dev/usb/usb_busdma.c stable/8/sys/dev/usb/usb_debug.h stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_hid.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_msctest.c stable/8/sys/dev/usb/usb_process.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_transfer.c stable/8/sys/dev/usb/wlan/if_upgt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/controller/atmegadci.c ============================================================================== --- stable/8/sys/dev/usb/controller/atmegadci.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/controller/atmegadci.c Wed Dec 9 22:42:40 2009 (r200334) @@ -1192,7 +1192,8 @@ atmegadci_clear_stall_sub(struct atmegad temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); if (!(temp & ATMEGA_UESTA0X_CFGOK)) { - DPRINTFN(0, "Chip rejected configuration\n"); + device_printf(sc->sc_bus.bdev, + "Chip rejected configuration\n"); } } while (0); } @@ -1914,7 +1915,8 @@ tr_handle_clear_port_feature: /* check valid config */ temp = ATMEGA_READ_1(sc, ATMEGA_UESTA0X); if (!(temp & ATMEGA_UESTA0X_CFGOK)) { - DPRINTFN(0, "Chip rejected EP0 configuration\n"); + device_printf(sc->sc_bus.bdev, + "Chip rejected EP0 configuration\n"); } break; case UHF_C_PORT_SUSPEND: Modified: stable/8/sys/dev/usb/controller/avr32dci.c ============================================================================== --- stable/8/sys/dev/usb/controller/avr32dci.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/controller/avr32dci.c Wed Dec 9 22:42:40 2009 (r200334) @@ -1160,7 +1160,7 @@ avr32dci_clear_stall_sub(struct avr32dci temp = AVR32_READ_4(sc, AVR32_EPTCFG(ep_no)); if (!(temp & AVR32_EPTCFG_EPT_MAPD)) { - DPRINTFN(0, "Chip rejected configuration\n"); + device_printf(sc->sc_bus.bdev, "Chip rejected configuration\n"); } else { AVR32_WRITE_4(sc, AVR32_EPTCTLENB(ep_no), AVR32_EPTCTL_EPT_ENABL); @@ -1840,7 +1840,8 @@ tr_handle_clear_port_feature: temp = AVR32_READ_4(sc, AVR32_EPTCFG(0)); if (!(temp & AVR32_EPTCFG_EPT_MAPD)) { - DPRINTFN(0, "Chip rejected configuration\n"); + device_printf(sc->sc_bus.bdev, + "Chip rejected configuration\n"); } else { AVR32_WRITE_4(sc, AVR32_EPTCTLENB(0), AVR32_EPTCTL_EPT_ENABL); Modified: stable/8/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/8/sys/dev/usb/controller/musb_otg.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/controller/musb_otg.c Wed Dec 9 22:42:40 2009 (r200334) @@ -1781,8 +1781,8 @@ musbotg_init(struct musbotg_softc *sc) dynfifo = (sc->sc_conf_data & MUSB2_MASK_CD_DYNFIFOSZ) ? 1 : 0; if (dynfifo) { - DPRINTFN(0, "Dynamic FIFO sizing detected! " - "Assuming 16Kbytes of FIFO RAM\n"); + device_printf(sc->sc_bus.bdev, "Dynamic FIFO sizing detected, " + "assuming 16Kbytes of FIFO RAM\n"); } DPRINTFN(2, "HW version: 0x%04x\n", Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/controller/usb_controller.c Wed Dec 9 22:42:40 2009 (r200334) @@ -130,7 +130,7 @@ usb_attach(device_t dev) DPRINTF("\n"); if (bus == NULL) { - DPRINTFN(0, "USB device has no ivars\n"); + device_printf(dev, "USB device has no ivars\n"); return (ENXIO); } @@ -343,7 +343,7 @@ usb_bus_attach(struct usb_proc_msg *pm) break; default: - device_printf(bus->bdev, "Unsupported USB revision!\n"); + device_printf(bus->bdev, "Unsupported USB revision\n"); return; } @@ -530,7 +530,7 @@ usb_bus_mem_alloc_all(struct usb_bus *bu (bus->devices_max < USB_MIN_DEVICES) || (bus->devices == NULL)) { DPRINTFN(0, "Devices field has not been " - "initialised properly!\n"); + "initialised properly\n"); bus->alloc_failed = 1; /* failure */ } #if USB_HAVE_BUSDMA Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/input/ukbd.c Wed Dec 9 22:42:40 2009 (r200334) @@ -926,7 +926,7 @@ ukbd_detach(device_t dev) DPRINTF("\n"); if (sc->sc_flags & UKBD_FLAG_POLLING) { - panic("cannot detach polled keyboard!\n"); + panic("cannot detach polled keyboard\n"); } sc->sc_flags |= UKBD_FLAG_GONE; Modified: stable/8/sys/dev/usb/net/if_aue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_aue.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_aue.c Wed Dec 9 22:42:40 2009 (r200334) @@ -692,7 +692,7 @@ aue_attach(device_t dev) sc->sc_xfer, aue_config, AUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_axe.c Wed Dec 9 22:42:40 2009 (r200334) @@ -706,7 +706,7 @@ axe_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, axe_config, AXE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: stable/8/sys/dev/usb/net/if_cdce.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cdce.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_cdce.c Wed Dec 9 22:42:40 2009 (r200334) @@ -489,7 +489,7 @@ cdce_attach(device_t dev) break; } } else { - device_printf(dev, "no data interface found!\n"); + device_printf(dev, "no data interface found\n"); goto detach; } } @@ -541,7 +541,7 @@ alloc_transfers: if (error || (i == 32)) { device_printf(dev, "No valid alternate " - "setting found!\n"); + "setting found\n"); goto detach; } Modified: stable/8/sys/dev/usb/net/if_cue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_cue.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_cue.c Wed Dec 9 22:42:40 2009 (r200334) @@ -404,7 +404,7 @@ cue_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, cue_config, CUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: stable/8/sys/dev/usb/net/if_kue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_kue.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_kue.c Wed Dec 9 22:42:40 2009 (r200334) @@ -480,14 +480,14 @@ kue_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, kue_config, KUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } sc->sc_mcfilters = malloc(KUE_MCFILTCNT(sc) * ETHER_ADDR_LEN, M_USBDEV, M_WAITOK); if (sc->sc_mcfilters == NULL) { - device_printf(dev, "failed allocating USB memory!\n"); + device_printf(dev, "failed allocating USB memory\n"); goto detach; } Modified: stable/8/sys/dev/usb/net/if_rue.c ============================================================================== --- stable/8/sys/dev/usb/net/if_rue.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_rue.c Wed Dec 9 22:42:40 2009 (r200334) @@ -535,7 +535,7 @@ rue_reset(struct rue_softc *sc) break; } if (i == RUE_TIMEOUT) - device_printf(sc->sc_ue.ue_dev, "reset never completed!\n"); + device_printf(sc->sc_ue.ue_dev, "reset never completed\n"); uether_pause(&sc->sc_ue, hz / 100); } @@ -591,7 +591,7 @@ rue_attach(device_t dev) sc->sc_xfer, rue_config, RUE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: stable/8/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/8/sys/dev/usb/net/if_udav.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/net/if_udav.c Wed Dec 9 22:42:40 2009 (r200334) @@ -254,7 +254,7 @@ udav_attach(device_t dev) error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, udav_config, UDAV_N_TRANSFER, sc, &sc->sc_mtx); if (error) { - device_printf(dev, "allocating USB transfers failed!\n"); + device_printf(dev, "allocating USB transfers failed\n"); goto detach; } Modified: stable/8/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/8/sys/dev/usb/serial/u3g.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/u3g.c Wed Dec 9 22:42:40 2009 (r200334) @@ -249,8 +249,6 @@ u3g_sierra_init(struct usb_device *udev) { struct usb_device_request req; - DPRINTFN(0, "\n"); - req.bmRequestType = UT_VENDOR; req.bRequest = UR_SET_INTERFACE; USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); @@ -269,8 +267,6 @@ u3g_huawei_init(struct usb_device *udev) { struct usb_device_request req; - DPRINTFN(0, "\n"); - req.bmRequestType = UT_WRITE_DEVICE; req.bRequest = UR_SET_FEATURE; USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); Modified: stable/8/sys/dev/usb/serial/uark.c ============================================================================== --- stable/8/sys/dev/usb/serial/uark.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/uark.c Wed Dec 9 22:42:40 2009 (r200334) @@ -211,7 +211,7 @@ uark_attach(device_t dev) if (error) { device_printf(dev, "allocating control USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } /* clear stall at first run */ Modified: stable/8/sys/dev/usb/serial/ubser.c ============================================================================== --- stable/8/sys/dev/usb/serial/ubser.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/ubser.c Wed Dec 9 22:42:40 2009 (r200334) @@ -282,7 +282,7 @@ ubser_attach(device_t dev) sc->sc_tx_size = usbd_xfer_max_len(sc->sc_xfer[UBSER_BULK_DT_WR]); if (sc->sc_tx_size == 0) { - DPRINTFN(0, "invalid tx_size!\n"); + DPRINTFN(0, "invalid tx_size\n"); goto detach; } /* initialize port numbers */ Modified: stable/8/sys/dev/usb/serial/ucycom.c ============================================================================== --- stable/8/sys/dev/usb/serial/ucycom.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/ucycom.c Wed Dec 9 22:42:40 2009 (r200334) @@ -266,7 +266,7 @@ ucycom_attach(device_t dev) sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc, @@ -555,7 +555,7 @@ ucycom_intr_read_callback(struct usb_xfe break; default: - DPRINTFN(0, "unsupported model number!\n"); + DPRINTFN(0, "unsupported model number\n"); goto tr_setup; } Modified: stable/8/sys/dev/usb/serial/ufoma.c ============================================================================== --- stable/8/sys/dev/usb/serial/ufoma.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/ufoma.c Wed Dec 9 22:42:40 2009 (r200334) @@ -401,7 +401,7 @@ ufoma_attach(device_t dev) if (error) { device_printf(dev, "allocating control USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } mad = ufoma_get_intconf(cd, id, UDESC_VS_INTERFACE, UDESCSUB_MCPC_ACM); @@ -1060,7 +1060,7 @@ ufoma_modem_setup(device_t dev, struct u break; } } else { - device_printf(dev, "no data interface!\n"); + device_printf(dev, "no data interface\n"); return (EINVAL); } } @@ -1071,7 +1071,7 @@ ufoma_modem_setup(device_t dev, struct u if (error) { device_printf(dev, "allocating BULK USB " - "transfers failed!\n"); + "transfers failed\n"); return (EINVAL); } return (0); Modified: stable/8/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/8/sys/dev/usb/serial/uftdi.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/uftdi.c Wed Dec 9 22:42:40 2009 (r200334) @@ -307,7 +307,7 @@ uftdi_attach(device_t dev) if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } sc->sc_ucom.sc_portno = FTDI_PIT_SIOA + uaa->info.bIfaceNum; Modified: stable/8/sys/dev/usb/serial/ugensa.c ============================================================================== --- stable/8/sys/dev/usb/serial/ugensa.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/ugensa.c Wed Dec 9 22:42:40 2009 (r200334) @@ -210,7 +210,7 @@ ugensa_attach(device_t dev) } if (cnt == 0) { - device_printf(dev, "No interfaces!\n"); + device_printf(dev, "No interfaces\n"); goto detach; } for (x = 0; x < cnt; x++) { @@ -229,7 +229,7 @@ ugensa_attach(device_t dev) if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } /* clear stall at first run */ Modified: stable/8/sys/dev/usb/serial/umct.c ============================================================================== --- stable/8/sys/dev/usb/serial/umct.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/umct.c Wed Dec 9 22:42:40 2009 (r200334) @@ -263,7 +263,7 @@ umct_attach(device_t dev) if (error) { device_printf(dev, "allocating USB " - "transfers failed!\n"); + "transfers failed\n"); goto detach; } Modified: stable/8/sys/dev/usb/serial/umodem.c ============================================================================== --- stable/8/sys/dev/usb/serial/umodem.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/umodem.c Wed Dec 9 22:42:40 2009 (r200334) @@ -311,7 +311,7 @@ umodem_attach(device_t dev) 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); if ((cud == NULL) || (cud->bLength < sizeof(*cud))) { - device_printf(dev, "no CM or union descriptor!\n"); + device_printf(dev, "no CM or union descriptor\n"); goto detach; } @@ -344,7 +344,7 @@ umodem_attach(device_t dev) break; } } else { - device_printf(dev, "no data interface!\n"); + device_printf(dev, "no data interface\n"); goto detach; } } Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/serial/uplcom.c Wed Dec 9 22:42:40 2009 (r200334) @@ -377,7 +377,7 @@ uplcom_attach(device_t dev) if (iface) { id = usbd_get_interface_descriptor(iface); if (id == NULL) { - device_printf(dev, "no interface descriptor (2)!\n"); + device_printf(dev, "no interface descriptor (2)\n"); goto detach; } sc->sc_data_iface_no = id->bInterfaceNumber; @@ -420,7 +420,7 @@ uplcom_attach(device_t dev) */ if (sc->sc_chiptype == TYPE_PL2303X) { if (uplcom_pl2303x_init(uaa->device)) { - device_printf(dev, "init failed!\n"); + device_printf(dev, "init failed\n"); goto detach; } } Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/storage/umass.c Wed Dec 9 22:42:40 2009 (r200334) @@ -2847,7 +2847,7 @@ umass_cam_detach_sim(struct umass_softc sc->sc_sim->softc = UMASS_GONE; cam_sim_free(sc->sc_sim, /* free_devq */ TRUE); } else { - panic("%s: CAM layer is busy!\n", + panic("%s: CAM layer is busy\n", sc->sc_name); } sc->sc_sim = NULL; Modified: stable/8/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/template/usb_template.c Wed Dec 9 22:42:40 2009 (r200334) @@ -727,7 +727,7 @@ handle_endpoint_desc: if ((pf->max_in_frame_size < wMaxPacketSize) || (pf->max_out_frame_size < wMaxPacketSize)) { DPRINTFN(0, "Endpoint profile %u " - "has too small buffer!\n", ep_no); + "has too small buffer\n", ep_no); return (1); } } else if (ed->bEndpointAddress & UE_DIR_IN) { @@ -735,7 +735,7 @@ handle_endpoint_desc: (1 << (ep_no % 8)); if (pf->max_in_frame_size < wMaxPacketSize) { DPRINTFN(0, "Endpoint profile %u " - "has too small buffer!\n", ep_no); + "has too small buffer\n", ep_no); return (1); } } else { @@ -743,7 +743,7 @@ handle_endpoint_desc: (1 << (ep_no % 8)); if (pf->max_out_frame_size < wMaxPacketSize) { DPRINTFN(0, "Endpoint profile %u " - "has too small buffer!\n", ep_no); + "has too small buffer\n", ep_no); return (1); } } Modified: stable/8/sys/dev/usb/usb_busdma.c ============================================================================== --- stable/8/sys/dev/usb/usb_busdma.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_busdma.c Wed Dec 9 22:42:40 2009 (r200334) @@ -445,7 +445,7 @@ usb_pc_common_mem_cb(void *arg, bus_dma_ /* * This check verifies that the physical address is correct: */ - DPRINTFN(0, "Page offset was not preserved!\n"); + DPRINTFN(0, "Page offset was not preserved\n"); error = 1; goto done; } @@ -764,8 +764,8 @@ usb_dma_tag_find(struct usb_dma_parent_t struct usb_dma_tag *udt; uint8_t nudt; - USB_ASSERT(align > 0, ("Invalid parameter align = 0!\n")); - USB_ASSERT(size > 0, ("Invalid parameter size = 0!\n")); + USB_ASSERT(align > 0, ("Invalid parameter align = 0\n")); + USB_ASSERT(size > 0, ("Invalid parameter size = 0\n")); udt = udpt->utag_first; nudt = udpt->utag_max; Modified: stable/8/sys/dev/usb/usb_debug.h ============================================================================== --- stable/8/sys/dev/usb/usb_debug.h Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_debug.h Wed Dec 9 22:42:40 2009 (r200334) @@ -35,11 +35,11 @@ extern int usb_debug; /* Check if USB debugging is enabled. */ #ifdef USB_DEBUG_VAR #if (USB_DEBUG != 0) -#define DPRINTFN(n,fmt,...) do { \ - if ((USB_DEBUG_VAR) >= (n)) { \ - printf("%s:%u: " fmt, \ - __FUNCTION__, __LINE__,## __VA_ARGS__); \ - } \ +#define DPRINTFN(n,fmt,...) do { \ + if ((USB_DEBUG_VAR) >= (n)) { \ + printf("%s: " fmt, \ + __FUNCTION__,## __VA_ARGS__); \ + } \ } while (0) #define DPRINTF(...) DPRINTFN(1, __VA_ARGS__) #else Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_dev.c Wed Dec 9 22:42:40 2009 (r200334) @@ -575,7 +575,7 @@ usb_fifo_free(struct usb_fifo *f) (f->udev->fifo[f->fifo_index] == f)) { f->udev->fifo[f->fifo_index] = NULL; } else { - DPRINTFN(0, "USB FIFO %p has not been linked!\n", f); + DPRINTFN(0, "USB FIFO %p has not been linked\n", f); } /* decrease refcount */ @@ -952,7 +952,7 @@ usb_dev_init_post(void *arg) usb_dev = make_dev(&usb_static_devsw, 0, UID_ROOT, GID_OPERATOR, 0644, USB_DEVICE_NAME); if (usb_dev == NULL) { - DPRINTFN(0, "Could not create usb bus device!\n"); + DPRINTFN(0, "Could not create usb bus device\n"); } } Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_device.c Wed Dec 9 22:42:40 2009 (r200334) @@ -1023,7 +1023,7 @@ usb_detach_device_sub(struct usb_device if (udev->flags.peer_suspended) { err = DEVICE_RESUME(dev); if (err) { - device_printf(dev, "Resume failed!\n"); + device_printf(dev, "Resume failed\n"); } } if (device_detach(dev)) { @@ -1038,7 +1038,7 @@ usb_detach_device_sub(struct usb_device error: /* Detach is not allowed to fail in the USB world */ - panic("An USB driver would not detach!\n"); + panic("A USB driver would not detach\n"); } /*------------------------------------------------------------------------* @@ -1131,7 +1131,7 @@ usb_probe_and_attach_sub(struct usb_devi * to device_detach(). USB devices should * never fail on detach! */ - panic("device_delete_child() failed!\n"); + panic("device_delete_child() failed\n"); } } if (uaa->temp_dev == NULL) { @@ -1140,7 +1140,7 @@ usb_probe_and_attach_sub(struct usb_devi uaa->temp_dev = device_add_child(udev->parent_dev, NULL, -1); if (uaa->temp_dev == NULL) { device_printf(udev->parent_dev, - "Device creation failed!\n"); + "Device creation failed\n"); return (1); /* failure */ } device_set_ivars(uaa->temp_dev, uaa); @@ -1320,7 +1320,7 @@ usb_probe_and_attach(struct usb_device * /* remove the last created child; it is unused */ if (device_delete_child(udev->parent_dev, uaa.temp_dev)) { - DPRINTFN(0, "device delete child failed!\n"); + DPRINTFN(0, "device delete child failed\n"); } } done: @@ -1353,7 +1353,7 @@ usb_suspend_resume_sub(struct usb_device err = DEVICE_RESUME(dev); } if (err) { - device_printf(dev, "%s failed!\n", + device_printf(dev, "%s failed\n", do_suspend ? "Suspend" : "Resume"); } } @@ -1473,13 +1473,13 @@ usb_alloc_device(device_t parent_dev, st if (device_index == bus->devices_max) { device_printf(bus->bdev, - "No free USB device index for new device!\n"); + "No free USB device index for new device\n"); return (NULL); } if (depth > 0x10) { device_printf(bus->bdev, - "Invalid device depth!\n"); + "Invalid device depth\n"); return (NULL); } udev = malloc(sizeof(*udev), M_USB, M_WAITOK | M_ZERO); @@ -1631,7 +1631,7 @@ usb_alloc_device(device_t parent_dev, st 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, + "at addr %d failed, %s\n", udev->address, usbd_errstr(err)); /* XXX try to re-enumerate the device */ err = usbd_req_re_enumerate(udev, NULL); @@ -1797,7 +1797,7 @@ repeat_set_config: (usbd_get_no_descriptors(udev->cdesc, UDESC_ENDPOINT) == 0)) { DPRINTFN(0, "Found no endpoints " - "(trying next config)!\n"); + "(trying next config)\n"); config_index++; goto repeat_set_config; } @@ -1814,7 +1814,7 @@ repeat_set_config: } } } else if (usb_test_huawei_autoinst_p(udev, &uaa) == 0) { - DPRINTFN(0, "Found Huawei auto-install disk!\n"); + DPRINTFN(0, "Found Huawei auto-install disk\n"); /* leave device unconfigured */ usb_unconfigure(udev, 0); } Modified: stable/8/sys/dev/usb/usb_hid.c ============================================================================== --- stable/8/sys/dev/usb/usb_hid.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_hid.c Wed Dec 9 22:42:40 2009 (r200334) @@ -450,7 +450,7 @@ hid_get_item(struct hid_data *s, struct c = &s->cur[s->pushlevel]; } else { DPRINTFN(0, "Cannot push " - "item @ %d!\n", s->pushlevel); + "item @ %d\n", s->pushlevel); } break; case 11: /* Pop */ @@ -468,7 +468,7 @@ hid_get_item(struct hid_data *s, struct c->loc.count = 0; } else { DPRINTFN(0, "Cannot pop " - "item @ %d!\n", s->pushlevel); + "item @ %d\n", s->pushlevel); } break; default: @@ -490,7 +490,7 @@ hid_get_item(struct hid_data *s, struct s->usages_max[s->nusage] = dval; s->nusage ++; } else { - DPRINTFN(0, "max usage reached!\n"); + DPRINTFN(0, "max usage reached\n"); } /* clear any pending usage sets */ @@ -525,7 +525,7 @@ hid_get_item(struct hid_data *s, struct c->usage_maximum; s->nusage ++; } else { - DPRINTFN(0, "Usage set dropped!\n"); + DPRINTFN(0, "Usage set dropped\n"); } s->susage = 0; break; Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_hub.c Wed Dec 9 22:42:40 2009 (r200334) @@ -385,7 +385,7 @@ repeat: (!(sc->sc_st.port_status & UPS_CURRENT_CONNECT_STATUS))) { if (timeout) { DPRINTFN(0, "giving up port reset " - "- device vanished!\n"); + "- device vanished\n"); goto error; } timeout = 1; @@ -435,7 +435,7 @@ repeat: child = usb_alloc_device(sc->sc_dev, udev->bus, udev, udev->depth + 1, portno - 1, portno, speed, mode); if (child == NULL) { - DPRINTFN(0, "could not allocate new device!\n"); + DPRINTFN(0, "could not allocate new device\n"); goto error; } return (0); /* success */ @@ -711,14 +711,14 @@ uhub_attach(device_t dev) parent_hub->flags.self_powered : 0); if (udev->depth > USB_HUB_MAX_DEPTH) { - DPRINTFN(0, "hub depth, %d, exceeded. HUB ignored!\n", + DPRINTFN(0, "hub depth, %d, exceeded. HUB ignored\n", USB_HUB_MAX_DEPTH); goto error; } if (!udev->flags.self_powered && parent_hub && (!parent_hub->flags.self_powered)) { DPRINTFN(0, "bus powered HUB connected to " - "bus powered HUB. HUB ignored!\n"); + "bus powered HUB. HUB ignored\n"); goto error; } /* get HUB descriptor */ @@ -740,11 +740,11 @@ uhub_attach(device_t dev) goto error; } if (hubdesc.bNbrPorts != nports) { - DPRINTFN(0, "number of ports changed!\n"); + DPRINTFN(0, "number of ports changed\n"); goto error; } if (nports == 0) { - DPRINTFN(0, "portless HUB!\n"); + DPRINTFN(0, "portless HUB\n"); goto error; } hub = malloc(sizeof(hub[0]) + (sizeof(hub->ports[0]) * nports), @@ -784,7 +784,7 @@ uhub_attach(device_t dev) } if (err) { DPRINTFN(0, "cannot setup interrupt transfer, " - "errstr=%s!\n", usbd_errstr(err)); + "errstr=%s\n", usbd_errstr(err)); goto error; } /* wait with power off for a while */ @@ -1924,7 +1924,7 @@ usb_dev_resume_peer(struct usb_device *u err = usbd_req_clear_port_feature(udev->parent_hub, NULL, udev->port_no, UHF_PORT_SUSPEND); if (err) { - DPRINTFN(0, "Resuming port failed!\n"); + DPRINTFN(0, "Resuming port failed\n"); return; } /* resume settle time */ @@ -1972,7 +1972,7 @@ usb_dev_resume_peer(struct usb_device *u NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Clearing device " - "remote wakeup failed: %s!\n", + "remote wakeup failed: %s\n", usbd_errstr(err)); } } @@ -2042,7 +2042,7 @@ repeat: NULL, UF_DEVICE_REMOTE_WAKEUP); if (err) { DPRINTFN(0, "Setting device " - "remote wakeup failed!\n"); + "remote wakeup failed\n"); } } USB_BUS_LOCK(udev->bus); Modified: stable/8/sys/dev/usb/usb_msctest.c ============================================================================== --- stable/8/sys/dev/usb/usb_msctest.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_msctest.c Wed Dec 9 22:42:40 2009 (r200334) @@ -284,7 +284,7 @@ bbb_command_callback(struct usb_xfer *xf sc->cbw.bCDBLength = sc->cmd_len; if (sc->cbw.bCDBLength > sizeof(sc->cbw.CBWCDB)) { sc->cbw.bCDBLength = sizeof(sc->cbw.CBWCDB); - DPRINTFN(0, "Truncating long command!\n"); + DPRINTFN(0, "Truncating long command\n"); } usbd_xfer_set_frame_data(xfer, 0, &sc->cbw, sizeof(sc->cbw)); usbd_transfer_submit(xfer); Modified: stable/8/sys/dev/usb/usb_process.c ============================================================================== --- stable/8/sys/dev/usb/usb_process.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_process.c Wed Dec 9 22:42:40 2009 (r200334) @@ -444,7 +444,7 @@ usb_proc_drain(struct usb_process *up) if (cold) { USB_THREAD_SUSPEND(up->up_ptr); printf("WARNING: A USB process has " - "been left suspended!\n"); + "been left suspended\n"); break; } cv_wait(&up->up_cv, up->up_mtx); Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_request.c Wed Dec 9 22:42:40 2009 (r200334) @@ -1549,7 +1549,7 @@ retry: 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, + "at addr %d failed, %s\n", udev->address, usbd_errstr(err)); goto done; } @@ -1557,7 +1557,7 @@ retry: err = usbd_req_get_device_desc(udev, mtx, &udev->ddesc); if (err) { DPRINTFN(0, "addr=%d, getting device " - "descriptor failed, %s!\n", old_addr, + "descriptor failed, %s\n", old_addr, usbd_errstr(err)); goto done; } Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/usb_transfer.c Wed Dec 9 22:42:40 2009 (r200334) @@ -201,9 +201,9 @@ usbd_transfer_setup_sub_malloc(struct us usb_size_t r; usb_size_t z; - USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x!\n", + USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x\n", align)); - USB_ASSERT(size > 0, ("Invalid size = 0!\n")); + USB_ASSERT(size > 0, ("Invalid size = 0\n")); if (count == 0) { return (0); /* nothing to allocate */ @@ -1200,7 +1200,7 @@ usbd_transfer_unsetup(struct usb_xfer ** USB_BUS_LOCK(info->bus); USB_ASSERT(info->setup_refcount != 0, ("Invalid setup " - "reference count!\n")); + "reference count\n")); info->setup_refcount--; @@ -1353,7 +1353,7 @@ usbd_setup_ctrl_transfer(struct usb_xfer if (len > xfer->flags_int.control_rem) { DPRINTFN(0, "Length (%d) greater than " - "remaining length (%d)!\n", len, + "remaining length (%d)\n", len, xfer->flags_int.control_rem); goto error; } @@ -1366,7 +1366,7 @@ usbd_setup_ctrl_transfer(struct usb_xfer (len != xfer->flags_int.control_rem) && (xfer->nframes != 1)) { DPRINTFN(0, "Short control transfer without " - "force_short_xfer set!\n"); + "force_short_xfer set\n"); goto error; } xfer->flags_int.control_rem -= len; @@ -1927,7 +1927,7 @@ usbd_xfer_set_frame_offset(struct usb_xf usb_frcount_t frindex) { KASSERT(!xfer->flags.ext_buffer, ("Cannot offset data frame " - "when the USB buffer is external!\n")); + "when the USB buffer is external\n")); KASSERT(frindex < xfer->max_frame_count, ("frame index overflow")); /* set virtual address to load */ @@ -2437,7 +2437,7 @@ usbd_pipe_start(struct usb_xfer_queue *p &udev->cs_msg[0], &udev->cs_msg[1]); } else { /* should not happen */ - DPRINTFN(0, "No stall handler!\n"); + DPRINTFN(0, "No stall handler\n"); } /* * Check if we should stall. Some USB hardware @@ -2580,7 +2580,7 @@ usbd_callback_wrapper_sub(struct usb_xfe if (xfer->aframes > xfer->nframes) { if (xfer->error == 0) { panic("%s: actual number of frames, %d, is " - "greater than initial number of frames, %d!\n", + "greater than initial number of frames, %d\n", __FUNCTION__, xfer->aframes, xfer->nframes); } else { /* just set some valid value */ @@ -2607,7 +2607,7 @@ usbd_callback_wrapper_sub(struct usb_xfe if (xfer->actlen > xfer->sumlen) { if (xfer->error == 0) { panic("%s: actual length, %d, is greater than " - "initial length, %d!\n", + "initial length, %d\n", __FUNCTION__, xfer->actlen, xfer->sumlen); } else { /* just set some valid value */ @@ -2809,7 +2809,7 @@ repeat: udev->default_xfer, usb_control_ep_cfg, USB_DEFAULT_XFER_MAX, NULL, udev->default_mtx)) { DPRINTFN(0, "could not setup default " - "USB transfer!\n"); + "USB transfer\n"); } else { goto repeat; } Modified: stable/8/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgt.c Wed Dec 9 22:41:50 2009 (r200333) +++ stable/8/sys/dev/usb/wlan/if_upgt.c Wed Dec 9 22:42:40 2009 (r200334) @@ -292,7 +292,7 @@ upgt_attach(device_t dev) /* Calculate device memory space. */ if (sc->sc_memaddr_frame_start == 0 || sc->sc_memaddr_frame_end == 0) { device_printf(dev, - "could not find memory space addresses on FW!\n"); + "could not find memory space addresses on FW\n"); error = EIO; goto fail5; } @@ -732,7 +732,7 @@ upgt_set_macfilter(struct upgt_softc *sc break; default: device_printf(sc->sc_dev, - "MAC filter does not know that state!\n"); + "MAC filter does not know that state\n"); break; } @@ -1181,7 +1181,7 @@ upgt_eeprom_parse(struct upgt_softc *sc) break; case UPGT_EEPROM_TYPE_OFF: DPRINTF(sc, UPGT_DEBUG_FW, - "%s: EEPROM off without end option!\n", __func__); + "%s: EEPROM off without end option\n", __func__); return (EIO); default: DPRINTF(sc, UPGT_DEBUG_FW, @@ -1356,7 +1356,7 @@ upgt_eeprom_read(struct upgt_softc *sc) error = mtx_sleep(sc, &sc->sc_mtx, 0, "eeprom_request", hz); if (error != 0) { device_printf(sc->sc_dev, - "timeout while waiting for EEPROM data!\n"); + "timeout while waiting for EEPROM data\n"); UPGT_UNLOCK(sc); return (EIO); } @@ -1490,7 +1490,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t * ("A current mbuf storage is small (%d)", pkglen + ETHER_ALIGN)); m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { - device_printf(sc->sc_dev, "could not create RX mbuf!\n"); + device_printf(sc->sc_dev, "could not create RX mbuf\n"); return (NULL); } m_adj(m, ETHER_ALIGN); @@ -1587,7 +1587,7 @@ upgt_mem_free(struct upgt_softc *sc, uin } device_printf(sc->sc_dev, - "could not free memory address 0x%08x!\n", addr); + "could not free memory address 0x%08x\n", addr); } static int @@ -1602,7 +1602,7 @@ upgt_fw_load(struct upgt_softc *sc) fw = firmware_get(upgt_fwname); if (fw == NULL) { - device_printf(sc->sc_dev, "could not read microcode %s!\n", + device_printf(sc->sc_dev, "could not read microcode %s\n", upgt_fwname); return (EIO); } @@ -1676,7 +1676,7 @@ upgt_fw_load(struct upgt_softc *sc) usbd_transfer_start(sc->sc_xfer[UPGT_BULK_RX]); error = mtx_sleep(sc, &sc->sc_mtx, 0, "upgtfw", 2 * hz); if (error != 0) { - device_printf(sc->sc_dev, "firmware load failed!\n"); + device_printf(sc->sc_dev, "firmware load failed\n"); error = EIO; } @@ -1782,7 +1782,7 @@ upgt_fw_verify(struct upgt_softc *sc) fw = firmware_get(upgt_fwname); if (fw == NULL) { - device_printf(sc->sc_dev, "could not read microcode %s!\n", + device_printf(sc->sc_dev, "could not read microcode %s\n", upgt_fwname); return EIO; } @@ -1802,7 +1802,7 @@ upgt_fw_verify(struct upgt_softc *sc) } if (offset == fw->datasize) { device_printf(sc->sc_dev, - "firmware Boot Record Area not found!\n"); + "firmware Boot Record Area not found\n"); error = EIO; goto fail; } @@ -1827,7 +1827,7 @@ upgt_fw_verify(struct upgt_softc *sc) if (bra_option_len != UPGT_BRA_FWTYPE_SIZE) { device_printf(sc->sc_dev, - "wrong UPGT_BRA_TYPE_FW len!\n"); + "wrong UPGT_BRA_TYPE_FW len\n"); error = EIO; goto fail; } @@ -1842,7 +1842,7 @@ upgt_fw_verify(struct upgt_softc *sc) break; } device_printf(sc->sc_dev, - "unsupported firmware type!\n"); + "unsupported firmware type\n"); error = EIO; goto fail; case UPGT_BRA_TYPE_VERSION: @@ -1946,7 +1946,7 @@ upgt_alloc_tx(struct upgt_softc *sc) data->buf = malloc(MCLBYTES, M_USBDEV, M_NOWAIT | M_ZERO); if (data->buf == NULL) { device_printf(sc->sc_dev, - "could not allocate TX buffer!\n"); + "could not allocate TX buffer\n"); return (ENOMEM); } STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, data, next); @@ -1970,7 +1970,7 @@ upgt_alloc_rx(struct upgt_softc *sc) data->buf = malloc(MCLBYTES, M_USBDEV, M_NOWAIT | M_ZERO); if (data->buf == NULL) { device_printf(sc->sc_dev, - "could not allocate RX buffer!\n"); + "could not allocate RX buffer\n"); return (ENOMEM); } STAILQ_INSERT_TAIL(&sc->sc_rx_inactive, data, next); From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:10:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B565106566B; Wed, 9 Dec 2009 23:10:33 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A48F8FC16; Wed, 9 Dec 2009 23:10: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 nB9NAXdZ043454; Wed, 9 Dec 2009 23:10:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NAWwX043453; Wed, 9 Dec 2009 23:10:32 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092310.nB9NAWwX043453@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200335 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:10:33 -0000 Author: thompsa Date: Wed Dec 9 23:10:32 2009 New Revision: 200335 URL: http://svn.freebsd.org/changeset/base/200335 Log: MFC r196487 Remove redundant Giant reference. Giant will be dropped automatically when the mutex argument is NULL. Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 22:42:40 2009 (r200334) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:10:32 2009 (r200335) @@ -2958,7 +2958,7 @@ uaudio_mixer_get(struct usb_device *udev USETW(req.wIndex, mc->wIndex); USETW(req.wLength, len); - err = usbd_do_request(udev, &Giant, &req, data); + err = usbd_do_request(udev, NULL, &req, data); if (err) { DPRINTF("err=%s\n", usbd_errstr(err)); return (0); @@ -3081,7 +3081,7 @@ uaudio_set_speed(struct usb_device *udev data[1] = speed >> 8; data[2] = speed >> 16; - return (usbd_do_request(udev, &Giant, &req, data)); + return (usbd_do_request(udev, NULL, &req, data)); } static int From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:11:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4079106566B; Wed, 9 Dec 2009 23:11:27 +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 D173D8FC14; Wed, 9 Dec 2009 23:11: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 nB9NBRi0043531; Wed, 9 Dec 2009 23:11:27 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NBRWh043529; Wed, 9 Dec 2009 23:11:27 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092311.nB9NBRWh043529@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200336 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:11:28 -0000 Author: thompsa Date: Wed Dec 9 23:11:27 2009 New Revision: 200336 URL: http://svn.freebsd.org/changeset/base/200336 Log: MFC r199060 Improve support for High-speed USB audio devices. - fix issues regarding the mixer, where the interface number was not set in time. - fix wrong use of resolution parameter. Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:10:32 2009 (r200335) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:11:27 2009 (r200336) @@ -105,10 +105,9 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def &uaudio_default_channels, 0, "uaudio default sample channels"); #endif -#define UAUDIO_MINFRAMES 16 /* must be factor of 8 due HS-USB */ +#define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ #define UAUDIO_RECURSE_LIMIT 24 /* rounds */ -#define UAUDIO_MINFRAMES_ALIGN(x) ((x) & ~(UAUDIO_MINFRAMES - 1)) #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) @@ -119,7 +118,7 @@ struct uaudio_mixer_node { int32_t maxval; #define MIX_MAX_CHAN 8 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ - uint32_t delta; + uint32_t mod; /* modulus */ uint32_t mul; uint32_t ctl; @@ -169,7 +168,7 @@ struct uaudio_chan { * buffer */ uint32_t intr_size; /* in bytes */ - uint32_t block_size; + uint32_t intr_frames; /* in units */ uint32_t sample_rate; uint32_t format; uint32_t pcm_format[2]; @@ -410,7 +409,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, @@ -420,7 +419,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, @@ -433,7 +432,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, @@ -443,7 +442,7 @@ static const struct usb_config .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, .bufsize = 0, /* use "wMaxPacketSize * frames" */ - .frames = UAUDIO_MINFRAMES, + .frames = UAUDIO_NFRAMES, .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, @@ -506,7 +505,6 @@ static const struct usb_config .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, .bufsize = sizeof(struct usb_device_request), - .flags = {}, .callback = &umidi_write_clear_stall_callback, .timeout = 1000, /* 1 second */ .interval = 50, /* 50ms */ @@ -517,7 +515,6 @@ static const struct usb_config .endpoint = 0x00, /* Control pipe */ .direction = UE_DIR_ANY, .bufsize = sizeof(struct usb_device_request), - .flags = {}, .callback = &umidi_read_clear_stall_callback, .timeout = 1000, /* 1 second */ .interval = 50, /* 50ms */ @@ -577,6 +574,8 @@ uaudio_attach(device_t dev) sc->sc_play_chan.priv_sc = sc; sc->sc_rec_chan.priv_sc = sc; sc->sc_udev = uaa->device; + sc->sc_mixer_iface_index = uaa->info.bIfaceIndex; + sc->sc_mixer_iface_no = uaa->info.bIfaceNum; if (usb_test_quirk(uaa, UQ_AUDIO_SWAP_LR)) sc->sc_uq_audio_swap_lr = 1; @@ -600,9 +599,6 @@ uaudio_attach(device_t dev) uaudio_mixer_fill_info(sc, uaa->device, id); - sc->sc_mixer_iface_index = uaa->info.bIfaceIndex; - sc->sc_mixer_iface_no = uaa->info.bIfaceNum; - DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); @@ -1119,34 +1115,11 @@ done: * next audio transfer. */ static void -uaudio_setup_blockcount(struct uaudio_chan *ch, usb_frcount_t max_frames, +uaudio_setup_blockcount(struct uaudio_chan *ch, uint32_t *total, uint32_t *blockcount) { - uint32_t temp; - uint32_t isiz; - - /* allow dynamic sizing of play buffer */ - isiz = ch->intr_size; - - /* allow dynamic sizing of play buffer */ - temp = isiz / ch->bytes_per_frame; - - /* align units */ - temp = UAUDIO_MINFRAMES_ALIGN(temp); - - /* range check - min */ - if (temp == 0) - temp = UAUDIO_MINFRAMES; - - /* range check - max */ - if (temp > max_frames) - temp = max_frames; - - /* store blockcount */ - *blockcount = temp; - - /* compute the total length */ - *total = temp * ch->bytes_per_frame; + *total = ch->intr_size; + *blockcount = ch->intr_frames; } static void @@ -1162,8 +1135,12 @@ uaudio_chan_play_callback(struct usb_xfe usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); - uaudio_setup_blockcount(ch, usbd_xfer_max_frames(xfer), - &total, &blockcount); + uaudio_setup_blockcount(ch, &total, &blockcount); + + if (ch->end == ch->start) { + DPRINTF("no buffer!\n"); + return; + } switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: @@ -1187,10 +1164,6 @@ tr_transferred: for (n = 0; n != blockcount; n++) usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame); - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - break; - } DPRINTFN(6, "transfer %d bytes\n", total); offset = 0; @@ -1235,17 +1208,23 @@ uaudio_chan_record_callback(struct usb_x uint32_t blockcount; uint32_t offset0; uint32_t offset1; + uint32_t mfl; int len; - int actlen, nframes; + int actlen; + int nframes; usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); + mfl = usbd_xfer_max_framelen(xfer); - uaudio_setup_blockcount(ch, usbd_xfer_max_frames(xfer), - &total, &blockcount); + uaudio_setup_blockcount(ch, &total, &blockcount); + + if (ch->end == ch->start) { + DPRINTF("no buffer!\n"); + return; + } switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -tr_transferred: if (actlen < total) { DPRINTF("short transfer, " "%d of %d bytes\n", actlen, total); @@ -1254,11 +1233,11 @@ tr_transferred: } offset0 = 0; + pc = usbd_xfer_get_frame(xfer, 0); for (n = 0; n != nframes; n++) { offset1 = offset0; - pc = usbd_xfer_get_frame(xfer, 0); len = usbd_xfer_frame_len(xfer, n); while (len > 0) { @@ -1279,36 +1258,26 @@ tr_transferred: } } - offset0 += ch->bytes_per_frame; + offset0 += mfl; } chn_intr(ch->pcm_ch); case USB_ST_SETUP: - if (ch->bytes_per_frame > usbd_xfer_max_framelen(xfer)) { - DPRINTF("bytes per transfer, %d, " - "exceeds maximum, %d!\n", - ch->bytes_per_frame, - usbd_xfer_max_framelen(xfer)); - return; - } +tr_setup: usbd_xfer_set_frames(xfer, blockcount); for (n = 0; n < blockcount; n++) { - usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame); + usbd_xfer_set_frame_len(xfer, n, mfl); } - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - return; - } usbd_transfer_submit(xfer); - return; + break; default: /* Error */ if (error == USB_ERR_CANCELLED) { - return; + break; } - goto tr_transferred; + goto tr_setup; } } @@ -1319,38 +1288,26 @@ uaudio_chan_init(struct uaudio_softc *sc struct uaudio_chan *ch = ((dir == PCMDIR_PLAY) ? &sc->sc_play_chan : &sc->sc_rec_chan); uint32_t buf_size; + uint32_t frames; uint8_t endpoint; + uint8_t blocks; uint8_t iface_index; uint8_t alt_index; + uint8_t fps_shift; usb_error_t err; - /* compute required buffer size */ - buf_size = (ch->bytes_per_frame * UAUDIO_MINFRAMES); - - /* setup interrupt interval */ - ch->intr_size = buf_size; + if (usbd_get_isoc_fps(sc->sc_udev) < 8000) { + /* FULL speed USB */ + frames = 8; + } else { + /* HIGH speed USB */ + frames = UAUDIO_NFRAMES; + } - /* double buffering */ - buf_size *= 2; + /* compute required buffer size */ - ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); - if (ch->buf == NULL) { - goto error; - } - if (sndbuf_setup(b, ch->buf, buf_size) != 0) { - goto error; - } - ch->start = ch->buf; - ch->end = ch->buf + buf_size; - ch->cur = ch->buf; - ch->pcm_ch = c; - ch->pcm_mtx = c->lock; - ch->pcm_buf = b; + buf_size = (ch->bytes_per_frame * frames); - if (ch->pcm_mtx == NULL) { - DPRINTF("ERROR: PCM channels does not have a mutex!\n"); - goto error; - } /* setup play/record format */ ch->pcm_cap.fmtlist = ch->pcm_format; @@ -1370,7 +1327,6 @@ uaudio_chan_init(struct uaudio_softc *sc ch->pcm_cap.fmtlist[1] = 0; - /* set alternate interface corresponding to the mode */ endpoint = ch->p_ed1->bEndpointAddress; @@ -1407,6 +1363,43 @@ uaudio_chan_init(struct uaudio_softc *sc DPRINTF("could not allocate USB transfers!\n"); goto error; } + + fps_shift = usbd_xfer_get_fps_shift(ch->xfer[0]); + + /* setup frame sizes */ + ch->intr_size = buf_size; + ch->intr_frames = (frames >> fps_shift); + ch->bytes_per_frame <<= fps_shift; + + if (ch->intr_frames == 0) { + DPRINTF("frame shift is too high!\n"); + goto error; + } + + /* setup double buffering */ + buf_size *= 2; + blocks = 2; + + ch->buf = malloc(buf_size, M_DEVBUF, M_WAITOK | M_ZERO); + if (ch->buf == NULL) + goto error; + if (sndbuf_setup(b, ch->buf, buf_size) != 0) + goto error; + if (sndbuf_resize(b, blocks, ch->intr_size)) + goto error; + + ch->start = ch->buf; + ch->end = ch->buf + buf_size; + ch->cur = ch->buf; + ch->pcm_ch = c; + ch->pcm_mtx = c->lock; + ch->pcm_buf = b; + + if (ch->pcm_mtx == NULL) { + DPRINTF("ERROR: PCM channels does not have a mutex!\n"); + goto error; + } + return (ch); error: @@ -1431,30 +1424,13 @@ uaudio_chan_free(struct uaudio_chan *ch) int uaudio_chan_set_param_blocksize(struct uaudio_chan *ch, uint32_t blocksize) { - uaudio_chan_set_param_fragments(ch, blocksize, 0 - 1); - - return (ch->block_size); + return (ch->intr_size); } int uaudio_chan_set_param_fragments(struct uaudio_chan *ch, uint32_t blocksize, uint32_t blockcount) { - /* we only support one size */ - blocksize = ch->intr_size; - blockcount = 2; - - if ((sndbuf_getblksz(ch->pcm_buf) != blocksize) || - (sndbuf_getblkcnt(ch->pcm_buf) != blockcount)) { - DPRINTFN(1, "resizing to %u x " - "%u bytes\n", blockcount, blocksize); - if (sndbuf_resize(ch->pcm_buf, blockcount, blocksize)) { - DPRINTFN(0, "failed to resize sound buffer, count=%u, " - "size=%u\n", blockcount, blocksize); - } - } - ch->block_size = sndbuf_getblksz(ch->pcm_buf); - return (1); } @@ -1591,12 +1567,12 @@ uaudio_mixer_add_ctl(struct uaudio_softc DPRINTF("adding %d\n", mc->ctl); } - mc->delta = 0; if (mc->type == MIX_ON_OFF) { mc->minval = 0; mc->maxval = 1; + mc->mod = 1; } else if (mc->type == MIX_SELECTOR) { - + mc->mod = 1; } else { /* determine min and max values */ @@ -1607,21 +1583,30 @@ uaudio_mixer_add_ctl(struct uaudio_softc mc->maxval = uaudio_mixer_get(sc->sc_udev, GET_MAX, mc); - mc->maxval = 1 + uaudio_mixer_signext(mc->type, mc->maxval); + mc->maxval = uaudio_mixer_signext(mc->type, mc->maxval); + + /* check if max and min was swapped */ + + if (mc->maxval < mc->minval) { + res = mc->maxval; + mc->maxval = mc->minval; + mc->minval = res; + } + /* compute value range */ mc->mul = mc->maxval - mc->minval; - if (mc->mul == 0) { + if (mc->mul == 0) mc->mul = 1; - } + + /* compute value alignment */ res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); - if (res > 0) { - mc->delta = ((res * 255) + (mc->mul / 2)) / mc->mul; - } + if (res == 0) + res = 1; + mc->mod = mc->mul / res; + if (mc->mod == 0) + mc->mod = 1; } - if (mc->maxval < mc->minval) { - mc->maxval = mc->minval; - } uaudio_mixer_add_ctl_sub(sc, mc); #if USB_DEBUG @@ -3108,7 +3093,21 @@ uaudio_mixer_bsd2value(struct uaudio_mix val = mc->minval; } } else { - val = (((val + (mc->delta / 2)) * mc->mul) / 255) + mc->minval; + + /* compute actual volume */ + val = (val * mc->mul) / 255; + + /* align volume level */ + val = val - (val % mc->mod); + + /* add lower offset */ + val = val + mc->minval; + + /* make sure we don't write a value out of range */ + if (val > mc->maxval) + val = mc->maxval; + else if (val < mc->minval) + val = mc->minval; } DPRINTFN(6, "type=0x%03x val=%d min=%d max=%d val=%d\n", From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:12:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64BFA106566C; Wed, 9 Dec 2009 23:12:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52FDF8FC12; Wed, 9 Dec 2009 23:12: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 nB9NCERw043597; Wed, 9 Dec 2009 23:12:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NCEq1043595; Wed, 9 Dec 2009 23:12:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092312.nB9NCEq1043595@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200337 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:12:14 -0000 Author: thompsa Date: Wed Dec 9 23:12:14 2009 New Revision: 200337 URL: http://svn.freebsd.org/changeset/base/200337 Log: MFC r199576 remove volume alignment (was previously not correctly implemented) Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:11:27 2009 (r200336) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:12:14 2009 (r200337) @@ -118,7 +118,6 @@ struct uaudio_mixer_node { int32_t maxval; #define MIX_MAX_CHAN 8 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ - uint32_t mod; /* modulus */ uint32_t mul; uint32_t ctl; @@ -1318,6 +1317,11 @@ uaudio_chan_init(struct uaudio_softc *sc ch->pcm_cap.minspeed = ch->sample_rate; ch->pcm_cap.maxspeed = ch->sample_rate; + /* setup mutex and PCM channel */ + + ch->pcm_ch = c; + ch->pcm_mtx = c->lock; + if (ch->p_asf1d->bNrChannels >= 2) ch->pcm_cap.fmtlist[0] = SND_FORMAT(ch->p_fmt->freebsd_fmt, 2, 0); @@ -1391,8 +1395,6 @@ uaudio_chan_init(struct uaudio_softc *sc ch->start = ch->buf; ch->end = ch->buf + buf_size; ch->cur = ch->buf; - ch->pcm_ch = c; - ch->pcm_mtx = c->lock; ch->pcm_buf = b; if (ch->pcm_mtx == NULL) { @@ -1570,9 +1572,7 @@ uaudio_mixer_add_ctl(struct uaudio_softc if (mc->type == MIX_ON_OFF) { mc->minval = 0; mc->maxval = 1; - mc->mod = 1; } else if (mc->type == MIX_SELECTOR) { - mc->mod = 1; } else { /* determine min and max values */ @@ -1600,11 +1600,8 @@ uaudio_mixer_add_ctl(struct uaudio_softc /* compute value alignment */ res = uaudio_mixer_get(sc->sc_udev, GET_RES, mc); - if (res == 0) - res = 1; - mc->mod = mc->mul / res; - if (mc->mod == 0) - mc->mod = 1; + + DPRINTF("Resolution = %d\n", (int)res); } uaudio_mixer_add_ctl_sub(sc, mc); @@ -3097,9 +3094,6 @@ uaudio_mixer_bsd2value(struct uaudio_mix /* compute actual volume */ val = (val * mc->mul) / 255; - /* align volume level */ - val = val - (val % mc->mod); - /* add lower offset */ val = val + mc->minval; From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:12:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7CB41065670; Wed, 9 Dec 2009 23:12:52 +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 B5E2F8FC24; Wed, 9 Dec 2009 23:12: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 nB9NCqjh043655; Wed, 9 Dec 2009 23:12:52 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NCqUD043653; Wed, 9 Dec 2009 23:12:52 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092312.nB9NCqUD043653@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200338 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:12:52 -0000 Author: thompsa Date: Wed Dec 9 23:12:52 2009 New Revision: 200338 URL: http://svn.freebsd.org/changeset/base/200338 Log: MFC r199677 add support for MIDI devices without audio control stream. Submitted by: Hans Petter Selasky Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:12:14 2009 (r200337) +++ stable/8/sys/dev/sound/usb/uaudio.c Wed Dec 9 23:12:52 2009 (r200338) @@ -559,6 +559,13 @@ uaudio_probe(device_t dev) else return (0); } + + /* check for MIDI stream */ + + if ((uaa->info.bInterfaceClass == UICLASS_AUDIO) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_MIDISTREAM)) { + return (0); + } return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:14:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 975E01065679; Wed, 9 Dec 2009 23:14:53 +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 857728FC15; Wed, 9 Dec 2009 23:14: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 nB9NErtg043759; Wed, 9 Dec 2009 23:14:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NErno043757; Wed, 9 Dec 2009 23:14:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092314.nB9NErno043757@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200339 - stable/8/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:14:53 -0000 Author: thompsa Date: Wed Dec 9 23:14:53 2009 New Revision: 200339 URL: http://svn.freebsd.org/changeset/base/200339 Log: MFC r198833 Add more verbose output when dumping the configuration descriptor. Modified: stable/8/usr.sbin/usbconfig/dump.c Directory Properties: stable/8/usr.sbin/usbconfig/ (props changed) Modified: stable/8/usr.sbin/usbconfig/dump.c ============================================================================== --- stable/8/usr.sbin/usbconfig/dump.c Wed Dec 9 23:12:52 2009 (r200338) +++ stable/8/usr.sbin/usbconfig/dump.c Wed Dec 9 23:14:53 2009 (r200339) @@ -100,21 +100,66 @@ dump_field(struct libusb20_device *pdev, printf("%s%s = 0x%04x ", plevel, field, value); - if ((field[0] != 'i') || (field[1] == 'd')) { - printf("\n"); - return; - } - if (value == 0) { - printf(" \n"); - return; + if (strlen(plevel) == 8) { + /* Endpoint Descriptor */ + + if (strcmp(field, "bEndpointAddress") == 0) { + if (value & 0x80) + printf(" \n"); + else + printf(" \n"); + return; + } + + if (strcmp(field, "bmAttributes") == 0) { + switch (value & 0x03) { + case 0: + printf(" \n"); + break; + case 1: + switch (value & 0x0C) { + case 0x00: + printf(" \n"); + break; + case 0x04: + printf(" \n"); + break; + case 0x08: + printf(" \n"); + break; + default: + printf(" \n"); + break; + } + break; + case 2: + printf(" \n"); + break; + default: + printf(" \n"); + break; + } + return; + } } - if (libusb20_dev_req_string_simple_sync(pdev, value, - temp_string, sizeof(temp_string))) { - printf(" \n"); + + if ((field[0] == 'i') && (field[1] != 'd')) { + /* Indirect String Descriptor */ + if (value == 0) { + printf(" \n"); + return; + } + if (libusb20_dev_req_string_simple_sync(pdev, value, + temp_string, sizeof(temp_string))) { + printf(" \n"); + return; + } + printf(" <%s>\n", temp_string); return; } - printf(" <%s>\n", temp_string); - return; + + /* No additional information */ + printf("\n"); } static void From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 00:16:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54F3E106566B; Thu, 10 Dec 2009 00:16:12 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2678FC16; Thu, 10 Dec 2009 00:16: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 nBA0GBAJ045131; Thu, 10 Dec 2009 00:16:11 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA0GB1q045129; Thu, 10 Dec 2009 00:16:11 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <200912100016.nBA0GB1q045129@svn.freebsd.org> From: Jason Evans Date: Thu, 10 Dec 2009 00:16: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: r200340 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 00:16:12 -0000 Author: jasone Date: Thu Dec 10 00:16:11 2009 New Revision: 200340 URL: http://svn.freebsd.org/changeset/base/200340 Log: Fix the posix_memalign() changes in r196861 to actually return a NULL pointer as intended. PR: standards/138307 Modified: head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Wed Dec 9 23:14:53 2009 (r200339) +++ head/lib/libc/stdlib/malloc.c Thu Dec 10 00:16:11 2009 (r200340) @@ -5340,6 +5340,7 @@ posix_memalign(void **memptr, size_t ali size = 1; else { result = NULL; + *memptr = NULL; ret = 0; goto RETURN; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 00:24:29 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15FD9106566C; Thu, 10 Dec 2009 00:24:29 +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 E12CD8FC12; Thu, 10 Dec 2009 00:24:28 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7269F46B06; Wed, 9 Dec 2009 19:24:28 -0500 (EST) Date: Thu, 10 Dec 2009 00:24:28 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Andrew Gallatin In-Reply-To: <4B1FAC12.6080907@cs.duke.edu> Message-ID: References: <200912082048.nB8Km6aP099420@svn.freebsd.org> <200912081645.37356.jhb@freebsd.org> <20091208221028.GA57735@stack.nl> <200912081742.58162.jhb@freebsd.org> <4B1FAC12.6080907@cs.duke.edu> 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, Jilles Tjoelker , John Baldwin Subject: Re: svn commit: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 00:24:29 -0000 On Wed, 9 Dec 2009, Andrew Gallatin wrote: > John Baldwin wrote: > >> The fact that we don't fail attempts to use pshared outright is probably >> dubious. They cannot possibly work as currently implemented aside from >> fork() since the structure embeds a file descriptor and file descriptor >> indices are a per-process namespace, not a global namespace. > > FWIW, this is what confused me. It tends to be kind of a land-mine, since > programs can be ported from Linux, and appear to work at first for casual > use. If we don't support pshared, we should return an error from sem_init() > to make it obvious. > > Also, perhaps the sem_init() man page should mention sem_open(), since that > seems to be the only way to really share a semaphore between processes on > FreeBSD. It's beginning to sound like our POSIX semaphores should be behaving more like umtx, which requires only a shared page, and less like file descriptors. Of course, that would make the global namespace more tricky... Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 01:01:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C051065676; Thu, 10 Dec 2009 01:01:54 +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 11DE18FC12; Thu, 10 Dec 2009 01:01:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBA11rtK046080; Thu, 10 Dec 2009 01:01:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA11rYe046077; Thu, 10 Dec 2009 01:01:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200912100101.nBA11rYe046077@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 10 Dec 2009 01:01: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: r200341 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 01:01:54 -0000 Author: jkim Date: Thu Dec 10 01:01:53 2009 New Revision: 200341 URL: http://svn.freebsd.org/changeset/base/200341 Log: Implement a rudimentary suspend/resume methods for PCI P2P bridge. Reviewed by: jhb, imp Modified: head/sys/dev/pci/pci.c head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu Dec 10 00:16:11 2009 (r200340) +++ head/sys/dev/pci/pci.c Thu Dec 10 01:01:53 2009 (r200341) @@ -253,7 +253,7 @@ disable. 1 means conservatively place d agressively place devices into D3 state. 3 means put absolutely everything\n\ in D3 state."); -static int pci_do_power_resume = 1; +int pci_do_power_resume = 1; TUNABLE_INT("hw.pci.do_power_resume", &pci_do_power_resume); SYSCTL_INT(_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RW, &pci_do_power_resume, 1, Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Thu Dec 10 00:16:11 2009 (r200340) +++ head/sys/dev/pci/pci_pci.c Thu Dec 10 01:01:53 2009 (r200341) @@ -52,7 +52,18 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" +#ifdef __HAVE_ACPI +#include +#include "acpi_if.h" +#else +#define ACPI_PWR_FOR_SLEEP(x, y, z) +#endif + +extern int pci_do_power_resume; + static int pcib_probe(device_t dev); +static int pcib_suspend(device_t dev); +static int pcib_resume(device_t dev); static device_method_t pcib_methods[] = { /* Device interface */ @@ -60,8 +71,8 @@ static device_method_t pcib_methods[] = DEVMETHOD(device_attach, pcib_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_suspend, pcib_suspend), + DEVMETHOD(device_resume, pcib_resume), /* Bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), @@ -121,6 +132,154 @@ pcib_is_io_open(struct pcib_softc *sc) } /* + * Get current I/O decode. + */ +static void +pcib_get_io_decode(struct pcib_softc *sc) +{ + device_t dev; + uint32_t iolow; + + dev = sc->dev; + + iolow = pci_read_config(dev, PCIR_IOBASEL_1, 1); + if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32) + sc->iobase = PCI_PPBIOBASE( + pci_read_config(dev, PCIR_IOBASEH_1, 2), iolow); + else + sc->iobase = PCI_PPBIOBASE(0, iolow); + + iolow = pci_read_config(dev, PCIR_IOLIMITL_1, 1); + if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32) + sc->iolimit = PCI_PPBIOLIMIT( + pci_read_config(dev, PCIR_IOLIMITH_1, 2), iolow); + else + sc->iolimit = PCI_PPBIOLIMIT(0, iolow); +} + +/* + * Get current memory decode. + */ +static void +pcib_get_mem_decode(struct pcib_softc *sc) +{ + device_t dev; + pci_addr_t pmemlow; + + dev = sc->dev; + + sc->membase = PCI_PPBMEMBASE(0, + pci_read_config(dev, PCIR_MEMBASE_1, 2)); + sc->memlimit = PCI_PPBMEMLIMIT(0, + pci_read_config(dev, PCIR_MEMLIMIT_1, 2)); + + pmemlow = pci_read_config(dev, PCIR_PMBASEL_1, 2); + if ((pmemlow & PCIM_BRPM_MASK) == PCIM_BRPM_64) + sc->pmembase = PCI_PPBMEMBASE( + pci_read_config(dev, PCIR_PMBASEH_1, 4), pmemlow); + else + sc->pmembase = PCI_PPBMEMBASE(0, pmemlow); + + pmemlow = pci_read_config(dev, PCIR_PMLIMITL_1, 2); + if ((pmemlow & PCIM_BRPM_MASK) == PCIM_BRPM_64) + sc->pmemlimit = PCI_PPBMEMLIMIT( + pci_read_config(dev, PCIR_PMLIMITH_1, 4), pmemlow); + else + sc->pmemlimit = PCI_PPBMEMLIMIT(0, pmemlow); +} + +/* + * Restore previous I/O decode. + */ +static void +pcib_set_io_decode(struct pcib_softc *sc) +{ + device_t dev; + uint32_t iohi; + + dev = sc->dev; + + iohi = sc->iobase >> 16; + if (iohi > 0) + pci_write_config(dev, PCIR_IOBASEH_1, iohi, 2); + pci_write_config(dev, PCIR_IOBASEL_1, sc->iobase >> 8, 1); + + iohi = sc->iolimit >> 16; + if (iohi > 0) + pci_write_config(dev, PCIR_IOLIMITH_1, iohi, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, sc->iolimit >> 8, 1); +} + +/* + * Restore previous memory decode. + */ +static void +pcib_set_mem_decode(struct pcib_softc *sc) +{ + device_t dev; + pci_addr_t pmemhi; + + dev = sc->dev; + + pci_write_config(dev, PCIR_MEMBASE_1, sc->membase >> 16, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, sc->memlimit >> 16, 2); + + pmemhi = sc->pmembase >> 32; + if (pmemhi > 0) + pci_write_config(dev, PCIR_PMBASEH_1, pmemhi, 4); + pci_write_config(dev, PCIR_PMBASEL_1, sc->pmembase >> 16, 2); + + pmemhi = sc->pmemlimit >> 32; + if (pmemhi > 0) + pci_write_config(dev, PCIR_PMLIMITH_1, pmemhi, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, sc->pmemlimit >> 16, 2); +} + +/* + * Get current bridge configuration. + */ +static void +pcib_cfg_save(struct pcib_softc *sc) +{ + device_t dev; + + dev = sc->dev; + + sc->command = pci_read_config(dev, PCIR_COMMAND, 2); + sc->pribus = pci_read_config(dev, PCIR_PRIBUS_1, 1); + sc->secbus = pci_read_config(dev, PCIR_SECBUS_1, 1); + sc->subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); + sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2); + sc->seclat = pci_read_config(dev, PCIR_SECLAT_1, 1); + if (sc->command & PCIM_CMD_PORTEN) + pcib_get_io_decode(sc); + if (sc->command & PCIM_CMD_MEMEN) + pcib_get_mem_decode(sc); +} + +/* + * Restore previous bridge configuration. + */ +static void +pcib_cfg_restore(struct pcib_softc *sc) +{ + device_t dev; + + dev = sc->dev; + + pci_write_config(dev, PCIR_COMMAND, sc->command, 2); + pci_write_config(dev, PCIR_PRIBUS_1, sc->pribus, 1); + pci_write_config(dev, PCIR_SECBUS_1, sc->secbus, 1); + pci_write_config(dev, PCIR_SUBBUS_1, sc->subbus, 1); + pci_write_config(dev, PCIR_BRIDGECTL_1, sc->bridgectl, 2); + pci_write_config(dev, PCIR_SECLAT_1, sc->seclat, 1); + if (sc->command & PCIM_CMD_PORTEN) + pcib_set_io_decode(sc); + if (sc->command & PCIM_CMD_MEMEN) + pcib_set_mem_decode(sc); +} + +/* * Generic device interface */ static int @@ -138,7 +297,6 @@ void pcib_attach_common(device_t dev) { struct pcib_softc *sc; - uint8_t iolow; struct sysctl_ctx_list *sctx; struct sysctl_oid *soid; @@ -148,14 +306,9 @@ pcib_attach_common(device_t dev) /* * Get current bridge configuration. */ - sc->command = pci_read_config(dev, PCIR_COMMAND, 1); - sc->domain = pci_get_domain(dev); - sc->pribus = pci_read_config(dev, PCIR_PRIBUS_1, 1); - sc->secbus = pci_read_config(dev, PCIR_SECBUS_1, 1); - sc->subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); - sc->secstat = pci_read_config(dev, PCIR_SECSTAT_1, 2); - sc->bridgectl = pci_read_config(dev, PCIR_BRIDGECTL_1, 2); - sc->seclat = pci_read_config(dev, PCIR_SECLAT_1, 1); + sc->domain = pci_get_domain(dev); + sc->secstat = pci_read_config(dev, PCIR_SECSTAT_1, 2); + pcib_cfg_save(sc); /* * Setup sysctl reporting nodes @@ -172,51 +325,6 @@ pcib_attach_common(device_t dev) CTLFLAG_RD, &sc->subbus, 0, "Subordinate bus number"); /* - * Determine current I/O decode. - */ - if (sc->command & PCIM_CMD_PORTEN) { - iolow = pci_read_config(dev, PCIR_IOBASEL_1, 1); - if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32) { - sc->iobase = PCI_PPBIOBASE(pci_read_config(dev, PCIR_IOBASEH_1, 2), - pci_read_config(dev, PCIR_IOBASEL_1, 1)); - } else { - sc->iobase = PCI_PPBIOBASE(0, pci_read_config(dev, PCIR_IOBASEL_1, 1)); - } - - iolow = pci_read_config(dev, PCIR_IOLIMITL_1, 1); - if ((iolow & PCIM_BRIO_MASK) == PCIM_BRIO_32) { - sc->iolimit = PCI_PPBIOLIMIT(pci_read_config(dev, PCIR_IOLIMITH_1, 2), - pci_read_config(dev, PCIR_IOLIMITL_1, 1)); - } else { - sc->iolimit = PCI_PPBIOLIMIT(0, pci_read_config(dev, PCIR_IOLIMITL_1, 1)); - } - } - - /* - * Determine current memory decode. - */ - if (sc->command & PCIM_CMD_MEMEN) { - sc->membase = PCI_PPBMEMBASE(0, pci_read_config(dev, PCIR_MEMBASE_1, 2)); - sc->memlimit = PCI_PPBMEMLIMIT(0, pci_read_config(dev, PCIR_MEMLIMIT_1, 2)); - iolow = pci_read_config(dev, PCIR_PMBASEL_1, 1); - if ((iolow & PCIM_BRPM_MASK) == PCIM_BRPM_64) - sc->pmembase = PCI_PPBMEMBASE( - pci_read_config(dev, PCIR_PMBASEH_1, 4), - pci_read_config(dev, PCIR_PMBASEL_1, 2)); - else - sc->pmembase = PCI_PPBMEMBASE(0, - pci_read_config(dev, PCIR_PMBASEL_1, 2)); - iolow = pci_read_config(dev, PCIR_PMLIMITL_1, 1); - if ((iolow & PCIM_BRPM_MASK) == PCIM_BRPM_64) - sc->pmemlimit = PCI_PPBMEMLIMIT( - pci_read_config(dev, PCIR_PMLIMITH_1, 4), - pci_read_config(dev, PCIR_PMLIMITL_1, 2)); - else - sc->pmemlimit = PCI_PPBMEMLIMIT(0, - pci_read_config(dev, PCIR_PMLIMITL_1, 2)); - } - - /* * Quirk handling. */ switch (pci_get_devid(dev)) { @@ -337,6 +445,41 @@ pcib_attach(device_t dev) } int +pcib_suspend(device_t dev) +{ + device_t acpi_dev; + int dstate, error; + + pcib_cfg_save(device_get_softc(dev)); + error = bus_generic_suspend(dev); + if (error == 0 && pci_do_power_resume) { + acpi_dev = devclass_get_device(devclass_find("acpi"), 0); + if (acpi_dev != NULL) { + dstate = PCI_POWERSTATE_D3; + ACPI_PWR_FOR_SLEEP(acpi_dev, dev, &dstate); + pci_set_powerstate(dev, dstate); + } + } + return (error); +} + +int +pcib_resume(device_t dev) +{ + device_t acpi_dev; + + if (pci_do_power_resume) { + acpi_dev = devclass_get_device(devclass_find("acpi"), 0); + if (acpi_dev != NULL) { + ACPI_PWR_FOR_SLEEP(acpi_dev, dev, NULL); + pci_set_powerstate(dev, PCI_POWERSTATE_D0); + } + } + pcib_cfg_restore(device_get_softc(dev)); + return (bus_generic_resume(dev)); +} + +int pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { struct pcib_softc *sc = device_get_softc(dev); From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 02:51:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59213106566C; Thu, 10 Dec 2009 02:51:41 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47EC88FC15; Thu, 10 Dec 2009 02:51: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 nBA2pfWM048410; Thu, 10 Dec 2009 02:51:41 GMT (envelope-from jasone@svn.freebsd.org) Received: (from jasone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA2pfr9048408; Thu, 10 Dec 2009 02:51:41 GMT (envelope-from jasone@svn.freebsd.org) Message-Id: <200912100251.nBA2pfr9048408@svn.freebsd.org> From: Jason Evans Date: Thu, 10 Dec 2009 02:51: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: r200345 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 02:51:41 -0000 Author: jasone Date: Thu Dec 10 02:51:40 2009 New Revision: 200345 URL: http://svn.freebsd.org/changeset/base/200345 Log: Simplify arena_run_reg_dalloc(), and remove a bug that was due to incorrect initialization of ssize_invs. Modified: head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Thu Dec 10 01:45:06 2009 (r200344) +++ head/lib/libc/stdlib/malloc.c Thu Dec 10 02:51:40 2009 (r200345) @@ -2419,7 +2419,7 @@ arena_run_reg_alloc(arena_run_t *run, ar static inline void arena_run_reg_dalloc(arena_run_t *run, arena_bin_t *bin, void *ptr, size_t size) { - unsigned diff, regind, elm, bit; + unsigned shift, diff, regind, elm, bit; assert(run->magic == ARENA_RUN_MAGIC); @@ -2428,31 +2428,16 @@ arena_run_reg_dalloc(arena_run_t *run, a * actual division here can reduce allocator throughput by over 20%! */ diff = (unsigned)((uintptr_t)ptr - (uintptr_t)run - bin->reg0_offset); - if ((size & (size - 1)) == 0) { - /* - * log2_table allows fast division of a power of two in the - * [1..128] range. - * - * (x / divisor) becomes (x >> log2_table[divisor - 1]). - */ - static const unsigned char log2_table[] = { - 0, 1, 0, 2, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7 - }; - if (size <= 128) - regind = (diff >> log2_table[size - 1]); - else if (size <= 32768) - regind = diff >> (8 + log2_table[(size >> 8) - 1]); - else - regind = diff / size; - } else if (size < qspace_max) { + /* Rescale (factor powers of 2 out of the numerator and denominator). */ + shift = ffs(size) - 1; + diff >>= shift; + size >>= shift; + + if (size == 1) { + /* The divisor was a power of 2. */ + regind = diff; + } else { /* * To divide by a number D that is not a power of two we * multiply by (2^21 / D) and then right shift by 21 positions. @@ -2461,78 +2446,32 @@ arena_run_reg_dalloc(arena_run_t *run, a * * becomes * - * (X * qsize_invs[(D >> QUANTUM_2POW) - 3]) - * >> SIZE_INV_SHIFT + * (X * size_invs[D - 3]) >> SIZE_INV_SHIFT * * We can omit the first three elements, because we never - * divide by 0, and QUANTUM and 2*QUANTUM are both powers of - * two, which are handled above. + * divide by 0, and 1 and 2 are both powers of two, which are + * handled above. */ #define SIZE_INV_SHIFT 21 -#define QSIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s << QUANTUM_2POW)) + 1) - static const unsigned qsize_invs[] = { - QSIZE_INV(3), - QSIZE_INV(4), QSIZE_INV(5), QSIZE_INV(6), QSIZE_INV(7) -#if (QUANTUM_2POW < 4) - , - QSIZE_INV(8), QSIZE_INV(9), QSIZE_INV(10), QSIZE_INV(11), - QSIZE_INV(12),QSIZE_INV(13), QSIZE_INV(14), QSIZE_INV(15) -#endif - }; - assert(QUANTUM * (((sizeof(qsize_invs)) / sizeof(unsigned)) + 3) - >= (1U << QSPACE_MAX_2POW_DEFAULT)); - - if (size <= (((sizeof(qsize_invs) / sizeof(unsigned)) + 2) << - QUANTUM_2POW)) { - regind = qsize_invs[(size >> QUANTUM_2POW) - 3] * diff; - regind >>= SIZE_INV_SHIFT; - } else - regind = diff / size; -#undef QSIZE_INV - } else if (size < cspace_max) { -#define CSIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s << CACHELINE_2POW)) + 1) - static const unsigned csize_invs[] = { - CSIZE_INV(3), - CSIZE_INV(4), CSIZE_INV(5), CSIZE_INV(6), CSIZE_INV(7) +#define SIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s)) + 1) + static const unsigned size_invs[] = { + SIZE_INV(3), + SIZE_INV(4), SIZE_INV(5), SIZE_INV(6), SIZE_INV(7), + SIZE_INV(8), SIZE_INV(9), SIZE_INV(10), SIZE_INV(11), + SIZE_INV(12), SIZE_INV(13), SIZE_INV(14), SIZE_INV(15), + SIZE_INV(16), SIZE_INV(17), SIZE_INV(18), SIZE_INV(19), + SIZE_INV(20), SIZE_INV(21), SIZE_INV(22), SIZE_INV(23), + SIZE_INV(24), SIZE_INV(25), SIZE_INV(26), SIZE_INV(27), + SIZE_INV(28), SIZE_INV(29), SIZE_INV(30), SIZE_INV(31) }; - assert(CACHELINE * (((sizeof(csize_invs)) / sizeof(unsigned)) + - 3) >= (1U << CSPACE_MAX_2POW_DEFAULT)); - if (size <= (((sizeof(csize_invs) / sizeof(unsigned)) + 2) << - CACHELINE_2POW)) { - regind = csize_invs[(size >> CACHELINE_2POW) - 3] * - diff; - regind >>= SIZE_INV_SHIFT; - } else - regind = diff / size; -#undef CSIZE_INV - } else { -#define SSIZE_INV(s) (((1U << SIZE_INV_SHIFT) / (s << SUBPAGE_2POW)) + 1) - static const unsigned ssize_invs[] = { - SSIZE_INV(3), - SSIZE_INV(4), SSIZE_INV(5), SSIZE_INV(6), SSIZE_INV(7), - SSIZE_INV(8), SSIZE_INV(9), SSIZE_INV(10), SSIZE_INV(11), - SSIZE_INV(12), SSIZE_INV(13), SSIZE_INV(14), SSIZE_INV(15) -#if (PAGE_SHIFT == 13) - , - SSIZE_INV(16), SSIZE_INV(17), SSIZE_INV(18), SSIZE_INV(19), - SSIZE_INV(20), SSIZE_INV(21), SSIZE_INV(22), SSIZE_INV(23), - SSIZE_INV(24), SSIZE_INV(25), SSIZE_INV(26), SSIZE_INV(27), - SSIZE_INV(28), SSIZE_INV(29), SSIZE_INV(29), SSIZE_INV(30) -#endif - }; - assert(SUBPAGE * (((sizeof(ssize_invs)) / sizeof(unsigned)) + 3) - >= PAGE_SIZE); - - if (size < (((sizeof(ssize_invs) / sizeof(unsigned)) + 2) << - SUBPAGE_2POW)) { - regind = ssize_invs[(size >> SUBPAGE_2POW) - 3] * diff; - regind >>= SIZE_INV_SHIFT; - } else + if (size <= ((sizeof(size_invs) / sizeof(unsigned)) + 2)) + regind = (diff * size_invs[size - 3]) >> SIZE_INV_SHIFT; + else regind = diff / size; -#undef SSIZE_INV - } +#undef SIZE_INV #undef SIZE_INV_SHIFT + } assert(diff == regind * size); assert(regind < bin->nregs); From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 03:09:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE807106566B; Thu, 10 Dec 2009 03:09:35 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A34148FC1A; Thu, 10 Dec 2009 03:09: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 nBA39Zdl048986; Thu, 10 Dec 2009 03:09:35 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA39Zvk048982; Thu, 10 Dec 2009 03:09:35 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200912100309.nBA39Zvk048982@svn.freebsd.org> From: Kip Macy Date: Thu, 10 Dec 2009 03:09: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: r200346 - in head/sys/i386: i386 xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 03:09:35 -0000 Author: kmacy Date: Thu Dec 10 03:09:35 2009 New Revision: 200346 URL: http://svn.freebsd.org/changeset/base/200346 Log: - revert pmap_kenter_temporary to taking a physical address - make minidump work Modified: head/sys/i386/i386/dump_machdep.c head/sys/i386/i386/minidump_machdep.c head/sys/i386/xen/pmap.c Modified: head/sys/i386/i386/dump_machdep.c ============================================================================== --- head/sys/i386/i386/dump_machdep.c Thu Dec 10 02:51:40 2009 (r200345) +++ head/sys/i386/i386/dump_machdep.c Thu Dec 10 03:09:35 2009 (r200346) @@ -182,11 +182,7 @@ cb_dumpdata(struct md_pa *mdp, int seqnr } for (i = 0; i < chunk; i++) { a = pa + i * PAGE_SIZE; -#ifdef XEN - va = pmap_kenter_temporary(xpmap_ptom(trunc_page(a)), i); -#else va = pmap_kenter_temporary(trunc_page(a), i); -#endif } error = dump_write(di, va, 0, dumplo, sz); if (error) Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Thu Dec 10 02:51:40 2009 (r200345) +++ head/sys/i386/i386/minidump_machdep.c Thu Dec 10 03:09:35 2009 (r200346) @@ -65,6 +65,11 @@ static void *dump_va; static uint64_t counter, progress; CTASSERT(sizeof(*vm_page_dump) == 4); +#ifndef XEN +#define xpmap_mtop(x) (x) +#define xpmap_ptom(x) (x) +#endif + static int is_dumpable(vm_paddr_t pa) @@ -194,7 +199,7 @@ minidumpsys(struct dumperinfo *di) j = va >> PDRSHIFT; if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { /* This is an entire 2M page. */ - pa = pd[j] & PG_PS_FRAME; + pa = xpmap_mtop(pd[j] & PG_PS_FRAME); for (k = 0; k < NPTEPG; k++) { if (is_dumpable(pa)) dump_add_page(pa); @@ -204,10 +209,10 @@ minidumpsys(struct dumperinfo *di) } if ((pd[j] & PG_V) == PG_V) { /* set bit for each valid page in this 2MB block */ - pt = pmap_kenter_temporary(pd[j] & PG_FRAME, 0); + pt = pmap_kenter_temporary(xpmap_mtop(pd[j] & PG_FRAME), 0); for (k = 0; k < NPTEPG; k++) { if ((pt[k] & PG_V) == PG_V) { - pa = pt[k] & PG_FRAME; + pa = xpmap_mtop(pt[k] & PG_FRAME); if (is_dumpable(pa)) dump_add_page(pa); } @@ -307,7 +312,7 @@ minidumpsys(struct dumperinfo *di) continue; } if ((pd[j] & PG_V) == PG_V) { - pa = pd[j] & PG_FRAME; + pa = xpmap_mtop(pd[j] & PG_FRAME); error = blk_write(di, 0, pa, PAGE_SIZE); if (error) goto fail; Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Thu Dec 10 02:51:40 2009 (r200345) +++ head/sys/i386/xen/pmap.c Thu Dec 10 03:09:35 2009 (r200346) @@ -3101,9 +3101,10 @@ void * pmap_kenter_temporary(vm_paddr_t pa, int i) { vm_offset_t va; + vm_paddr_t ma = xpmap_ptom(pa); va = (vm_offset_t)crashdumpmap + (i * PAGE_SIZE); - PT_SET_MA(va, (pa & ~PAGE_MASK) | PG_V | pgeflag); + PT_SET_MA(va, (ma & ~PAGE_MASK) | PG_V | pgeflag); invlpg(va); return ((void *)crashdumpmap); } From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 05:45:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C86C106566B; Thu, 10 Dec 2009 05:45:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D55EF8FC0A; Thu, 10 Dec 2009 05:45: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 nBA5jeYM052321; Thu, 10 Dec 2009 05:45:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA5je5g052318; Thu, 10 Dec 2009 05:45:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912100545.nBA5je5g052318@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 10 Dec 2009 05:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200349 - in stable/8/sys/dev: puc uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 05:45:41 -0000 Author: marcel Date: Thu Dec 10 05:45:40 2009 New Revision: 200349 URL: http://svn.freebsd.org/changeset/base/200349 Log: MFC rev 200230: Add support for the NetMos NM9865 family of Serial/Parallel ports. Modified: stable/8/sys/dev/puc/pucdata.c stable/8/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Thu Dec 10 05:08:58 2009 (r200348) +++ stable/8/sys/dev/puc/pucdata.c Thu Dec 10 05:45:40 2009 (r200349) @@ -168,10 +168,10 @@ const struct puc_cfg puc_pci_devices[] = { 0x10e8, 0x818e, 0xffff, 0, "Applied Micro Circuits 8 Port UART", - DEFAULT_RCLK, - PUC_PORT_8S, 0x14, -1, -1, + DEFAULT_RCLK, + PUC_PORT_8S, 0x14, -1, -1, .config_function = puc_config_amc - }, + }, { 0x11fe, 0x8010, 0xffff, 0, "Comtrol RocketPort 550/8 RJ11 part A", @@ -808,6 +808,42 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S1P, 0x10, 4, 0, }, + { 0x9710, 0x9865, 0xa000, 0x3002, + "NetMos NM9865 Dual UART", + DEFAULT_RCLK, + PUC_PORT_2S, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3003, + "NetMos NM9865 Triple UART", + DEFAULT_RCLK, + PUC_PORT_3S, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3004, + "NetMos NM9865 Quad UART", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0,0 + }, + + { 0x9710, 0x9865, 0xa000, 0x3011, + "NetMos NM9865 Single UART and 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_1S1P, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3012, + "NetMos NM9865 Dual UART and 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_2S1P, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3020, + "NetMos NM9865 Dual 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_2P, 0x10, 4, 0, + }, + { 0xb00c, 0x021c, 0xffff, 0, "IC Book Labs Gunboat x4 Lite", DEFAULT_RCLK, Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Thu Dec 10 05:08:58 2009 (r200348) +++ stable/8/sys/dev/uart/uart_bus_pci.c Thu Dec 10 05:45:40 2009 (r200349) @@ -111,6 +111,7 @@ static struct pci_id pci_ns8250_ids[] = 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, +{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 06:24:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AA5E1065670; Thu, 10 Dec 2009 06:24:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ECD98FC08; Thu, 10 Dec 2009 06:24:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBA6OGOt053247; Thu, 10 Dec 2009 06:24:16 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA6OG9K053244; Thu, 10 Dec 2009 06:24:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912100624.nBA6OG9K053244@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 10 Dec 2009 06:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200350 - in stable/7/sys/dev: puc uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 06:24:16 -0000 Author: marcel Date: Thu Dec 10 06:24:16 2009 New Revision: 200350 URL: http://svn.freebsd.org/changeset/base/200350 Log: MFC rev 200230: Add support for the NetMos NM9865 family of Serial/Parallel ports. Modified: stable/7/sys/dev/puc/pucdata.c stable/7/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/puc/pucdata.c ============================================================================== --- stable/7/sys/dev/puc/pucdata.c Thu Dec 10 05:45:40 2009 (r200349) +++ stable/7/sys/dev/puc/pucdata.c Thu Dec 10 06:24:16 2009 (r200350) @@ -168,10 +168,10 @@ const struct puc_cfg puc_pci_devices[] = { 0x10e8, 0x818e, 0xffff, 0, "Applied Micro Circuits 8 Port UART", - DEFAULT_RCLK, - PUC_PORT_8S, 0x14, -1, -1, + DEFAULT_RCLK, + PUC_PORT_8S, 0x14, -1, -1, .config_function = puc_config_amc - }, + }, { 0x11fe, 0x8010, 0xffff, 0, "Comtrol RocketPort 550/8 RJ11 part A", @@ -773,6 +773,42 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S1P, 0x10, 4, 0, }, + { 0x9710, 0x9865, 0xa000, 0x3002, + "NetMos NM9865 Dual UART", + DEFAULT_RCLK, + PUC_PORT_2S, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3003, + "NetMos NM9865 Triple UART", + DEFAULT_RCLK, + PUC_PORT_3S, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3004, + "NetMos NM9865 Quad UART", + DEFAULT_RCLK, + PUC_PORT_4S, 0x10, 4, 0,0 + }, + + { 0x9710, 0x9865, 0xa000, 0x3011, + "NetMos NM9865 Single UART and 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_1S1P, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3012, + "NetMos NM9865 Dual UART and 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_2S1P, 0x10, 4, 0, + }, + + { 0x9710, 0x9865, 0xa000, 0x3020, + "NetMos NM9865 Dual 1284 Printer port", + DEFAULT_RCLK, + PUC_PORT_2P, 0x10, 4, 0, + }, + { 0xb00c, 0x021c, 0xffff, 0, "IC Book Labs Gunboat x4 Lite", DEFAULT_RCLK, Modified: stable/7/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_pci.c Thu Dec 10 05:45:40 2009 (r200349) +++ stable/7/sys/dev/uart/uart_bus_pci.c Thu Dec 10 06:24:16 2009 (r200350) @@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, +{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, { 0xdeaf, 0x9051, 0xffff, 0, "Middle Digital PC Weasel Serial Port", 0x10 }, { 0xffff, 0, 0xffff, 0, NULL, 0, 0} }; From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 06:42:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C306B106568B; Thu, 10 Dec 2009 06:42:28 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B17E48FC0A; Thu, 10 Dec 2009 06:42: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 nBA6gSiJ053607; Thu, 10 Dec 2009 06:42:28 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA6gSSh053605; Thu, 10 Dec 2009 06:42:28 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200912100642.nBA6gSSh053605@svn.freebsd.org> From: Tim Kientzle Date: Thu, 10 Dec 2009 06:42: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: r200351 - head/lib/libarchive X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 06:42:28 -0000 Author: kientzle Date: Thu Dec 10 06:42:28 2009 New Revision: 200351 URL: http://svn.freebsd.org/changeset/base/200351 Log: Merge two cpio fixes from libarchive.googlecode.com: 1) Avoid an infinite loop in the header resync for certain malformed archives. 2) Don't try to match hardlinks if the nlinks count is < 2. This reduces the likelihood of a false hardlink match due to ino truncation. MFC after: 7 days Modified: head/lib/libarchive/archive_read_support_format_cpio.c Modified: head/lib/libarchive/archive_read_support_format_cpio.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_cpio.c Thu Dec 10 06:24:16 2009 (r200350) +++ head/lib/libarchive/archive_read_support_format_cpio.c Thu Dec 10 06:42:28 2009 (r200351) @@ -356,7 +356,7 @@ find_newc_header(struct archive_read *a) * Scan ahead until we find something that looks * like an odc header. */ - while (p + sizeof(struct cpio_newc_header) < q) { + while (p + sizeof(struct cpio_newc_header) <= q) { switch (p[5]) { case '1': case '2': @@ -490,7 +490,7 @@ find_odc_header(struct archive_read *a) * Scan ahead until we find something that looks * like an odc header. */ - while (p + sizeof(struct cpio_odc_header) < q) { + while (p + sizeof(struct cpio_odc_header) <= q) { switch (p[5]) { case '7': if (memcmp("070707", p, 6) == 0 @@ -731,6 +731,9 @@ record_hardlink(struct cpio *cpio, struc dev_t dev; ino_t ino; + if (archive_entry_nlink(entry) <= 1) + return; + dev = archive_entry_dev(entry); ino = archive_entry_ino(entry); From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 07:48:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0115A106566B; Thu, 10 Dec 2009 07:48:48 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3F208FC13; Thu, 10 Dec 2009 07:48: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 nBA7mlw8054945; Thu, 10 Dec 2009 07:48:47 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA7mlKq054943; Thu, 10 Dec 2009 07:48:47 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200912100748.nBA7mlKq054943@svn.freebsd.org> From: Kip Macy Date: Thu, 10 Dec 2009 07: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: r200352 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 07:48:48 -0000 Author: kmacy Date: Thu Dec 10 07:48:47 2009 New Revision: 200352 URL: http://svn.freebsd.org/changeset/base/200352 Log: for PV XEN translate page table entries from machine (real) to physical (logical) addresses so that kgdb can translate them to the correct coredump offsets Modified: head/sys/i386/i386/minidump_machdep.c Modified: head/sys/i386/i386/minidump_machdep.c ============================================================================== --- head/sys/i386/i386/minidump_machdep.c Thu Dec 10 06:42:28 2009 (r200351) +++ head/sys/i386/i386/minidump_machdep.c Thu Dec 10 07:48:47 2009 (r200352) @@ -313,7 +313,23 @@ minidumpsys(struct dumperinfo *di) } if ((pd[j] & PG_V) == PG_V) { pa = xpmap_mtop(pd[j] & PG_FRAME); +#ifndef XEN error = blk_write(di, 0, pa, PAGE_SIZE); +#else + pt = pmap_kenter_temporary(pa, 0); + memcpy(fakept, pt, PAGE_SIZE); + for (i = 0; i < NPTEPG; i++) + fakept[i] = xpmap_mtop(fakept[i]); + error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + if (error) + goto fail; + /* flush, in case we reuse fakept in the same block */ + error = blk_flush(di); + if (error) + goto fail; + bzero(fakept, sizeof(fakept)); +#endif + if (error) goto fail; } else { From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 09:26:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB8691065670; Thu, 10 Dec 2009 09:26:56 +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 DA3CF8FC18; Thu, 10 Dec 2009 09:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBA9Qu4M057029; Thu, 10 Dec 2009 09:26:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBA9Quia057027; Thu, 10 Dec 2009 09:26:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912100926.nBA9Quia057027@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Dec 2009 09:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200353 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 09:26:57 -0000 Author: mav Date: Thu Dec 10 09:26:56 2009 New Revision: 200353 URL: http://svn.freebsd.org/changeset/base/200353 Log: Limit maximum I/O size, depending on command set supported by device. It is required to suppot non-LBA48 devices with MAXPHYS above 128K. Same is done in ada(4). Modified: head/sys/dev/ata/ata-disk.c Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Thu Dec 10 07:48:47 2009 (r200352) +++ head/sys/dev/ata/ata-disk.c Thu Dec 10 09:26:56 2009 (r200353) @@ -126,6 +126,10 @@ ad_attach(device_t dev) adp->disk->d_name = "ad"; adp->disk->d_drv1 = dev; adp->disk->d_maxsize = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; + if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 65536 * DEV_BSIZE); + else /* 28bit ATA command limit */ + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 256 * DEV_BSIZE); adp->disk->d_sectorsize = DEV_BSIZE; adp->disk->d_mediasize = DEV_BSIZE * (off_t)adp->total_secs; adp->disk->d_fwsectors = adp->sectors; From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 10:34:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3D2D106566B; Thu, 10 Dec 2009 10:34:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A92448FC17; Thu, 10 Dec 2009 10:34: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 nBAAYU0i058478; Thu, 10 Dec 2009 10:34:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAAYUYF058476; Thu, 10 Dec 2009 10:34:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912101034.nBAAYUYF058476@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 10 Dec 2009 10:34: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: r200354 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 10:34:30 -0000 Author: luigi Date: Thu Dec 10 10:34:30 2009 New Revision: 200354 URL: http://svn.freebsd.org/changeset/base/200354 Log: No functional changes (who dares to touch this code!) but: - cast the result of LEN() to int as this is the main usage. - use LEN() in one place where it was forgotten. - Document the use of a static variable in rw mode. More small changes to follow. MFC after: 7 days Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Thu Dec 10 09:26:56 2009 (r200353) +++ head/sys/net/radix.c Thu Dec 10 10:34:30 2009 (r200354) @@ -72,6 +72,8 @@ static struct radix_node_head *mask_rnhe /* * Work area -- the following point to 3 buffers of size max_keylen, * allocated in this order in a block of memory malloc'ed by rn_init. + * rn_zeros, rn_ones are set in rn_init and used in readonly afterwards. + * addmask_key is used in rn_addmask in rw mode and not thread-safe. */ static char *rn_zeros, *rn_ones, *addmask_key; @@ -135,8 +137,9 @@ static int rn_satisfies_leaf(char *trial * To make the assumption more explicit, we use the LEN() macro to access * this field. It is safe to pass an expression with side effects * to LEN() as the argument is evaluated only once. + * We cast the result to int as this is the dominant usage. */ -#define LEN(x) (*(const u_char *)(x)) +#define LEN(x) ( (int) (*(const u_char *)(x)) ) /* * XXX THIS NEEDS TO BE FIXED @@ -197,7 +200,7 @@ rn_refines(m_arg, n_arg) { register caddr_t m = m_arg, n = n_arg; register caddr_t lim, lim2 = lim = n + LEN(n); - int longer = LEN(n++) - (int)LEN(m++); + int longer = LEN(n++) - LEN(m++); int masks_are_equal = 1; if (longer > 0) @@ -250,10 +253,10 @@ rn_satisfies_leaf(trial, leaf, skip) char *cplim; int length = min(LEN(cp), LEN(cp2)); - if (cp3 == 0) + if (cp3 == NULL) cp3 = rn_ones; else - length = min(length, *(u_char *)cp3); + length = min(length, LEN(cp3)); cplim = cp + length; cp3 += skip; cp2 += skip; for (cp += skip; cp < cplim; cp++, cp2++, cp3++) if ((*cp ^ *cp2) & *cp3) @@ -424,7 +427,7 @@ rn_insert(v_arg, head, dupentry, nodes) { caddr_t v = v_arg; struct radix_node *top = head->rnh_treetop; - int head_off = top->rn_offset, vlen = (int)LEN(v); + int head_off = top->rn_offset, vlen = LEN(v); register struct radix_node *t = rn_search(v_arg, top); register caddr_t cp = v + head_off; register int b; From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 11:52:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE3931065693; Thu, 10 Dec 2009 11:52:16 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBD1F8FC08; Thu, 10 Dec 2009 11:52: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 nBABqGOC061521; Thu, 10 Dec 2009 11:52:16 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBABqGB6061515; Thu, 10 Dec 2009 11:52:16 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912101152.nBABqGB6061515@svn.freebsd.org> From: Shteryana Shopova Date: Thu, 10 Dec 2009 11:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200355 - stable/8/contrib/bsnmp/snmp_mibII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 11:52:17 -0000 Author: syrinx Date: Thu Dec 10 11:52:16 2009 New Revision: 200355 URL: http://svn.freebsd.org/changeset/base/200355 Log: MFC r200063 Fix a problem with high CPU consumption (up to 30%) by bsnmpd on a loaded system. Instead of constantly calling the mibII_idle function when the server is not busy call the function only once every 10 seconds to avoid bsnmpd constantly doing gettimeofday syscalls. Make the idle polling interval confugurable via begemotIfDataPoll. Modified: stable/8/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt stable/8/contrib/bsnmp/snmp_mibII/mibII.c stable/8/contrib/bsnmp/snmp_mibII/mibII.h stable/8/contrib/bsnmp/snmp_mibII/mibII_begemot.c stable/8/contrib/bsnmp/snmp_mibII/mibII_tree.def Directory Properties: stable/8/contrib/bsnmp/ (props changed) Modified: stable/8/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt Thu Dec 10 10:34:30 2009 (r200354) +++ stable/8/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt Thu Dec 10 11:52:16 2009 (r200355) @@ -39,7 +39,7 @@ IMPORTS FROM BEGEMOT-IP-MIB; begemotMib2 MODULE-IDENTITY - LAST-UPDATED "200602130000Z" + LAST-UPDATED "200908030000Z" ORGANIZATION "German Aerospace Center" CONTACT-INFO " Hartmut Brandt @@ -54,6 +54,12 @@ begemotMib2 MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for private mib2 stuff." + REVISION "200908030000Z" + DESCRIPTION + "Second edition adds begemotIfDataPoll object." + REVISION "200602130000Z" + DESCRIPTION + "Initial revision." ::= { begemotIp 1 } begemotIfMaxspeed OBJECT-TYPE @@ -87,4 +93,14 @@ begemotIfForcePoll OBJECT-TYPE bit rate in its MIB." ::= { begemotMib2 3 } +begemotIfDataPoll OBJECT-TYPE + SYNTAX TimeTicks + UNITS "deciseconds" + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "The rate at which the mib2 module will poll interface data." + DEFVAL { 100 } + ::= { begemotMib2 4 } + END Modified: stable/8/contrib/bsnmp/snmp_mibII/mibII.c ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/mibII.c Thu Dec 10 10:34:30 2009 (r200354) +++ stable/8/contrib/bsnmp/snmp_mibII/mibII.c Thu Dec 10 11:52:16 2009 (r200355) @@ -117,6 +117,15 @@ u_int mibif_hc_update_interval; /* HC update timer handle */ static void *hc_update_timer; +/* Idle poll timer */ +static void *mibII_poll_timer; + +/* interfaces' data poll interval */ +u_int mibII_poll_ticks; + +/* Idle poll hook */ +static void mibII_idle(void *arg __unused); + /*****************************/ static const struct asn_oid oid_ifMIB = OIDX_ifMIB; @@ -410,6 +419,20 @@ mibif_reset_hc_timer(void) mibif_hc_update_interval = ticks; } +/** + * Restart the idle poll timer. + */ +void +mibif_restart_mibII_poll_timer(void) +{ + if (mibII_poll_timer != NULL) + timer_stop(mibII_poll_timer); + + if ((mibII_poll_timer = timer_start_repeat(mibII_poll_ticks * 10, + mibII_poll_ticks * 10, mibII_idle, NULL, module)) == NULL) + syslog(LOG_ERR, "timer_start(%u): %m", mibII_poll_ticks); +} + /* * Fetch new MIB data. */ @@ -1553,7 +1576,7 @@ get_cloners(void) * Idle function */ static void -mibII_idle(void) +mibII_idle(void *arg __unused) { struct mibifa *ifa; @@ -1608,6 +1631,10 @@ mibII_start(void) ipForward_reg = or_register(&oid_ipForward, "The MIB module for the display of CIDR multipath IP Routes.", module); + + mibII_poll_timer = NULL; + mibII_poll_ticks = MIBII_POLL_TICKS; + mibif_restart_mibII_poll_timer(); } /* @@ -1651,6 +1678,11 @@ mibII_init(struct lmodule *mod, int argc static int mibII_fini(void) { + if (mibII_poll_timer != NULL ) { + timer_stop(mibII_poll_timer); + mibII_poll_timer = NULL; + } + if (route_fd != NULL) fd_deselect(route_fd); if (route != -1) @@ -1690,7 +1722,7 @@ const struct snmp_module config = { "This module implements the interface and ip groups.", mibII_init, mibII_fini, - mibII_idle, /* idle */ + NULL, /* idle */ NULL, /* dump */ NULL, /* config */ mibII_start, Modified: stable/8/contrib/bsnmp/snmp_mibII/mibII.h ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/mibII.h Thu Dec 10 10:34:30 2009 (r200354) +++ stable/8/contrib/bsnmp/snmp_mibII/mibII.h Thu Dec 10 11:52:16 2009 (r200355) @@ -211,6 +211,14 @@ extern u_int mibif_hc_update_interval; /* re-compute update interval */ void mibif_reset_hc_timer(void); +/* interfaces' data poll interval */ +extern u_int mibII_poll_ticks; + +/* restart the data poll timer */ +void mibif_restart_mibII_poll_timer(void); + +#define MIBII_POLL_TICKS 100 + /* get interfaces and interface addresses. */ void mib_fetch_interfaces(void); Modified: stable/8/contrib/bsnmp/snmp_mibII/mibII_begemot.c ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/mibII_begemot.c Thu Dec 10 10:34:30 2009 (r200354) +++ stable/8/contrib/bsnmp/snmp_mibII/mibII_begemot.c Thu Dec 10 11:52:16 2009 (r200355) @@ -59,6 +59,11 @@ op_begemot_mibII(struct snmp_context *ct ctx->scratch->int1 = mibif_force_hc_update_interval; mibif_force_hc_update_interval = value->v.uint32; return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + ctx->scratch->int1 = mibII_poll_ticks; + mibII_poll_ticks = value->v.uint32; + return (SNMP_ERR_NOERROR); } abort(); @@ -68,6 +73,10 @@ op_begemot_mibII(struct snmp_context *ct case LEAF_begemotIfForcePoll: mibif_force_hc_update_interval = ctx->scratch->int1; return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + mibII_poll_ticks = ctx->scratch->int1; + return (SNMP_ERR_NOERROR); } abort(); @@ -78,6 +87,10 @@ op_begemot_mibII(struct snmp_context *ct mibif_force_hc_update_interval = ctx->scratch->int1; mibif_reset_hc_timer(); return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + mibif_restart_mibII_poll_timer(); + return (SNMP_ERR_NOERROR); } abort(); } @@ -98,6 +111,10 @@ op_begemot_mibII(struct snmp_context *ct case LEAF_begemotIfForcePoll: value->v.uint32 = mibif_force_hc_update_interval; return (SNMP_ERR_NOERROR); + + case LEAF_begemotIfDataPoll: + value->v.uint32 = mibII_poll_ticks; + return (SNMP_ERR_NOERROR); } abort(); } Modified: stable/8/contrib/bsnmp/snmp_mibII/mibII_tree.def ============================================================================== --- stable/8/contrib/bsnmp/snmp_mibII/mibII_tree.def Thu Dec 10 10:34:30 2009 (r200354) +++ stable/8/contrib/bsnmp/snmp_mibII/mibII_tree.def Thu Dec 10 11:52:16 2009 (r200355) @@ -240,6 +240,7 @@ (1 begemotIfMaxspeed COUNTER64 op_begemot_mibII GET) (2 begemotIfPoll TIMETICKS op_begemot_mibII GET) (3 begemotIfForcePoll TIMETICKS op_begemot_mibII GET SET) + (4 begemotIfDataPoll TIMETICKS op_begemot_mibII GET SET) ) ) ) From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 13:59:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E48A106566C; Thu, 10 Dec 2009 13:59:29 +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 5CF3E8FC17; Thu, 10 Dec 2009 13:59:29 +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 0BD6146B38; Thu, 10 Dec 2009 08:59:29 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 59B9A8A01F; Thu, 10 Dec 2009 08:59:28 -0500 (EST) From: John Baldwin To: Robert Watson Date: Thu, 10 Dec 2009 08:59:20 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912082048.nB8Km6aP099420@svn.freebsd.org> <4B1FAC12.6080907@cs.duke.edu> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912100859.20208.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 10 Dec 2009 08:59:28 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no 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, Andrew Gallatin , Jilles Tjoelker Subject: Re: svn commit: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 13:59:29 -0000 On Wednesday 09 December 2009 7:24:28 pm Robert Watson wrote: > On Wed, 9 Dec 2009, Andrew Gallatin wrote: > > > John Baldwin wrote: > > > >> The fact that we don't fail attempts to use pshared outright is probably > >> dubious. They cannot possibly work as currently implemented aside from > >> fork() since the structure embeds a file descriptor and file descriptor > >> indices are a per-process namespace, not a global namespace. > > > > FWIW, this is what confused me. It tends to be kind of a land-mine, since > > programs can be ported from Linux, and appear to work at first for casual > > use. If we don't support pshared, we should return an error from sem_init() > > to make it obvious. > > > > Also, perhaps the sem_init() man page should mention sem_open(), since that > > seems to be the only way to really share a semaphore between processes on > > FreeBSD. > > It's beginning to sound like our POSIX semaphores should be behaving more like > umtx, which requires only a shared page, and less like file descriptors. Of > course, that would make the global namespace more tricky... I believe even that would be tricky since umtx uses the userland address of the umtx as a cookie and that is not guaranteed safe aside from the fork(2) case. Oh, hmm, I'm wrong on that one. You can make a PROCESS_SHARED umtx and it uses the offset relative to the start of the containing vm_object for it's hash key. That's cute. Note that you really only need for the pshared variant. The file descriptors do provide many of the desired semantics (Solaris implements many of the POSIX IPC primitives by mmap()'ing files in /tmp using the provided name for example). One possibility is to make sem_t use the kernel-backed fd-based semaphores for named semaphores and non-pshared semaphores but to use umtx for pshared semaphores. The threads library already does a similar trick where it uses umtx for !pshared semaphores and the kernel for everything else. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 14:41:47 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DE69106566C; Thu, 10 Dec 2009 14:41: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 8D3288FC14; Thu, 10 Dec 2009 14:41:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBAEflr6066335; Thu, 10 Dec 2009 14:41:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAEfldP066334; Thu, 10 Dec 2009 14:41:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912101441.nBAEfldP066334@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 10 Dec 2009 14:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200356 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 14:41:47 -0000 Author: kib Date: Thu Dec 10 14:41:47 2009 New Revision: 200356 URL: http://svn.freebsd.org/changeset/base/200356 Log: Record part of history I participated in. No objections from: ed, pho Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Dec 10 11:52:16 2009 (r200355) +++ head/share/misc/committers-src.dot Thu Dec 10 14:41:47 2009 (r200356) @@ -123,6 +123,7 @@ julian [label="Julian Elischer\njulian@F kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] +kib [label="Konstantin Belousov\nkib@FreeBSD.org\n2006/06/03"] kmacy [label="Kip Macy\nkmacy@FreeBSD.org\n2005/06/01"] le [label="Lukas Ertl\nle@FreeBSD.org\n2004/02/02"] linimon [label="Mark Linimon\nlinimon@FreeBSD.org\n2006/09/30"] @@ -257,6 +258,7 @@ dwmalone -> snb ed -> gavin ed -> jilles +ed -> rdivacky eivind -> des eivind -> rwatson @@ -347,7 +349,14 @@ julian -> archie julian -> adrian julian -> zec +kan -> kib + +kib -> dchagin kib -> lulf +kib -> pho +kib -> rdivacky +kib -> rmacklem +kib -> stas kmacy -> lstewart @@ -390,6 +399,7 @@ philip -> ed philip -> jls philip -> matteo +pjd -> kib pjd -> lulf rgrimes -> markm @@ -416,6 +426,7 @@ rwatson -> jh rwatson -> kensmith rwatson -> kmacy rwatson -> linimon +rwatson -> rmacklem rwatson -> shafeeq rwatson -> tmm rwatson -> trasz From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 14:54:29 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE19106568D; Thu, 10 Dec 2009 14:54:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3508FC20; Thu, 10 Dec 2009 14:54:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBAEsTGe066688; Thu, 10 Dec 2009 14:54:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAEsTdB066686; Thu, 10 Dec 2009 14:54:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912101454.nBAEsTdB066686@svn.freebsd.org> From: John Baldwin Date: Thu, 10 Dec 2009 14:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200357 - head/sys/boot/i386/libi386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 14:54:29 -0000 Author: jhb Date: Thu Dec 10 14:54:29 2009 New Revision: 200357 URL: http://svn.freebsd.org/changeset/base/200357 Log: Don't warn about an RSDP with a corrupt checksum. The kernel does a better job about warning about these things later and this message can be confusing. Submitted by: infofarmer MFC after: 1 week Modified: head/sys/boot/i386/libi386/biosacpi.c Modified: head/sys/boot/i386/libi386/biosacpi.c ============================================================================== --- head/sys/boot/i386/libi386/biosacpi.c Thu Dec 10 14:41:47 2009 (r200356) +++ head/sys/boot/i386/libi386/biosacpi.c Thu Dec 10 14:54:29 2009 (r200357) @@ -125,10 +125,8 @@ biosacpi_search_rsdp(char *base, int len sum = 0; for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++) sum += *(cp + idx); - if (sum != 0) { - printf("acpi: bad RSDP checksum (%d)\n", sum); + if (sum != 0) continue; - } return(rsdp); } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 15:17:35 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 125AC106568B; Thu, 10 Dec 2009 15:17:35 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 013098FC24; Thu, 10 Dec 2009 15:17: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 nBAFHYNe067206; Thu, 10 Dec 2009 15:17:34 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAFHYhN067204; Thu, 10 Dec 2009 15:17:34 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912101517.nBAFHYhN067204@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 10 Dec 2009 15:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200358 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 15:17:35 -0000 Author: luigi Date: Thu Dec 10 15:17:34 2009 New Revision: 200358 URL: http://svn.freebsd.org/changeset/base/200358 Log: centralize the code to free a packet (or a chain) while in dummynet. Remove an old macro and its stale comment. Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Dec 10 14:54:29 2009 (r200357) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Dec 10 15:17:34 2009 (r200358) @@ -461,6 +461,27 @@ heap_free(struct dn_heap *h) */ /* + * Dispose a packet in dummynet. Use an inline functions so if we + * need to free extra state associated to a packet, this is a + * central point to do it. + */ +static __inline void *dn_free_pkt(struct mbuf *m) +{ + m_freem(m); + return NULL; +} + +static __inline void dn_free_pkts(struct mbuf *mnext) +{ + struct mbuf *m; + + while ((m = mnext) != NULL) { + mnext = m->m_nextpkt; + dn_free_pkt(m); + } +} + +/* * Return the mbuf tag holding the dummynet state. As an optimization * this is assumed to be the first tag on the list. If this turns out * wrong we'll need to search the list. @@ -1009,12 +1030,12 @@ dummynet_send(struct mbuf *m) case DN_TO_DROP: /* drop the packet after some time */ - m_freem(m); + dn_free_pkt(m); break; default: printf("dummynet: bad switch %d!\n", pkt->dn_dir); - m_freem(m); + dn_free_pkt(m); break; } } @@ -1553,20 +1574,11 @@ dropit: if (q) q->drops++; DUMMYNET_UNLOCK(); - m_freem(m); - *m0 = NULL; + *m0 = dn_free_pkt(m); return ((fs && (fs->flags_fs & DN_NOERROR)) ? 0 : ENOBUFS); } /* - * Below, the rt_unref is only needed when (pkt->dn_dir == DN_TO_IP_OUT) - * Doing this would probably save us the initial bzero of dn_pkt - */ -#define DN_FREE_PKT(_m) do { \ - m_freem(_m); \ -} while (0) - -/* * Dispose all packets and flow_queues on a flow_set. * If all=1, also remove red lookup table and other storage, * including the descriptor itself. @@ -1582,13 +1594,7 @@ purge_flow_set(struct dn_flow_set *fs, i for (i = 0; i <= fs->rq_size; i++) { for (q = fs->rq[i]; q != NULL; q = qn) { - struct mbuf *m, *mnext; - - mnext = q->head; - while ((m = mnext) != NULL) { - mnext = m->m_nextpkt; - DN_FREE_PKT(m); - } + dn_free_pkts(q->head); qn = q->next; free(q, M_DUMMYNET); } @@ -1616,15 +1622,10 @@ purge_flow_set(struct dn_flow_set *fs, i static void purge_pipe(struct dn_pipe *pipe) { - struct mbuf *m, *mnext; purge_flow_set( &(pipe->fs), 1 ); - mnext = pipe->head; - while ((m = mnext) != NULL) { - mnext = m->m_nextpkt; - DN_FREE_PKT(m); - } + dn_free_pkts(pipe->head); heap_free( &(pipe->scheduler_heap) ); heap_free( &(pipe->not_eligible_heap) ); @@ -1974,7 +1975,6 @@ dummynet_drain(void) { struct dn_flow_set *fs; struct dn_pipe *pipe; - struct mbuf *m, *mnext; int i; DUMMYNET_LOCK_ASSERT(); @@ -1990,12 +1990,7 @@ dummynet_drain(void) for (i = 0; i < HASHSIZE; i++) { SLIST_FOREACH(pipe, &pipehash[i], next) { purge_flow_set(&(pipe->fs), 0); - - mnext = pipe->head; - while ((m = mnext) != NULL) { - mnext = m->m_nextpkt; - DN_FREE_PKT(m); - } + dn_free_pkt(pipe->head); pipe->head = pipe->tail = NULL; } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 16:47:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DD451065670; Thu, 10 Dec 2009 16:47:49 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep33-int.chello.at (viefep33-int.chello.at [62.179.121.51]) by mx1.freebsd.org (Postfix) with ESMTP id 4066D8FC0C; Thu, 10 Dec 2009 16:47:48 +0000 (UTC) Received: from edge03.upc.biz ([192.168.13.238]) by viefep13-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091210163121.JCLI26374.viefep13-int.chello.at@edge03.upc.biz>; Thu, 10 Dec 2009 17:31:21 +0100 Received: from lizard.fafoe.narf.at ([213.47.85.26]) by edge03.upc.biz with edge id FUXK1d04m0a5KZh03UXLUP; Thu, 10 Dec 2009 17:31:21 +0100 X-SourceIP: 213.47.85.26 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id 4946CBE61; Thu, 10 Dec 2009 17:31:19 +0100 (CET) Date: Thu, 10 Dec 2009 17:31:19 +0100 From: Stefan Farfeleder To: Roman Divacky Message-ID: <20091210163118.GA66146@lizard.fafoe.narf.at> References: <200912031802.nB3I2txS021472@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912031802.nB3I2txS021472@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200068 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 16:47:49 -0000 On Thu, Dec 03, 2009 at 06:02:55PM +0000, Roman Divacky wrote: > Author: rdivacky > Date: Thu Dec 3 18:02:55 2009 > New Revision: 200068 > URL: http://svn.freebsd.org/changeset/base/200068 > > Log: > Connect unzip to the build. > > Approved by: ed (mentor) > Approved by: des (unzip author) > Tested by: exp ports build (miwi) For me this breaks the ooo-3 build with: unzip: -n, -o and -u are contradictory The failing command is 'unzip -quo jurt_src.zip'. From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 16:55:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C99091065672; Thu, 10 Dec 2009 16:55:16 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8B9D8FC12; Thu, 10 Dec 2009 16:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBAGtGE3069297; Thu, 10 Dec 2009 16:55:16 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAGtGTk069296; Thu, 10 Dec 2009 16:55:16 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <200912101655.nBAGtGTk069296@svn.freebsd.org> From: Takanori Watanabe Date: Thu, 10 Dec 2009 16:55: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: r200359 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 16:55:16 -0000 Author: takawata Date: Thu Dec 10 16:55:16 2009 New Revision: 200359 URL: http://svn.freebsd.org/changeset/base/200359 Log: Add module dependency for cam if configured as ATA_CAM. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Thu Dec 10 15:17:34 2009 (r200358) +++ head/sys/dev/ata/ata-all.c Thu Dec 10 16:55:16 2009 (r200359) @@ -1681,6 +1681,9 @@ ata_module_event_handler(module_t mod, i static moduledata_t ata_moduledata = { "ata", ata_module_event_handler, NULL }; DECLARE_MODULE(ata, ata_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND); MODULE_VERSION(ata, 1); +#ifdef ATA_CAM +MODULE_DEPEND(ata, cam, 1, 1, 1); +#endif static void ata_init(void) From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 17:34:32 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46F091065679; Thu, 10 Dec 2009 17:34:32 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id E85BF8FC17; Thu, 10 Dec 2009 17:34:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0B9039CB0CF; Thu, 10 Dec 2009 18:32:34 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eO0mOEz3vMiA; Thu, 10 Dec 2009 18:32:31 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9483F9CB0E8; Thu, 10 Dec 2009 18:32:31 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id nBAHWVbR094377; Thu, 10 Dec 2009 18:32:31 +0100 (CET) (envelope-from rdivacky) Date: Thu, 10 Dec 2009 18:32:31 +0100 From: Roman Divacky To: Stefan Farfeleder Message-ID: <20091210173231.GA93327@freebsd.org> References: <200912031802.nB3I2txS021472@svn.freebsd.org> <20091210163118.GA66146@lizard.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091210163118.GA66146@lizard.fafoe.narf.at> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, des@FreeBSD.org Subject: Re: svn commit: r200068 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 17:34:32 -0000 On Thu, Dec 10, 2009 at 05:31:19PM +0100, Stefan Farfeleder wrote: > On Thu, Dec 03, 2009 at 06:02:55PM +0000, Roman Divacky wrote: > > Author: rdivacky > > Date: Thu Dec 3 18:02:55 2009 > > New Revision: 200068 > > URL: http://svn.freebsd.org/changeset/base/200068 > > > > Log: > > Connect unzip to the build. > > > > Approved by: ed (mentor) > > Approved by: des (unzip author) > > Tested by: exp ports build (miwi) > > For me this breaks the ooo-3 build with: > > unzip: -n, -o and -u are contradictory > > The failing command is 'unzip -quo jurt_src.zip'. I dont see a reason why this check is there: if (n_opt + o_opt + u_opt > 1) errorx("-n, -o and -u are contradictory"); dag, can you comment? /usr/local/bin/unzip seems to accept those together happilly.. From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 18:34:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE321065693; Thu, 10 Dec 2009 18:34:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5FD8FC12; Thu, 10 Dec 2009 18:34: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 nBAIY7x7071598; Thu, 10 Dec 2009 18:34:07 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAIY7pF071596; Thu, 10 Dec 2009 18:34:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912101834.nBAIY7pF071596@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 10 Dec 2009 18:34: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: r200360 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 18:34:08 -0000 Author: luigi Date: Thu Dec 10 18:34:07 2009 New Revision: 200360 URL: http://svn.freebsd.org/changeset/base/200360 Log: when draining a flowset free the entire chain, not just one packet. Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Dec 10 16:55:16 2009 (r200359) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Dec 10 18:34:07 2009 (r200360) @@ -1990,7 +1990,7 @@ dummynet_drain(void) for (i = 0; i < HASHSIZE; i++) { SLIST_FOREACH(pipe, &pipehash[i], next) { purge_flow_set(&(pipe->fs), 0); - dn_free_pkt(pipe->head); + dn_free_pkts(pipe->head); pipe->head = pipe->tail = NULL; } } From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 18:37:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82AAB1065679; Thu, 10 Dec 2009 18:37:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 724878FC21; Thu, 10 Dec 2009 18:37: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 nBAIbEmR071698; Thu, 10 Dec 2009 18:37:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAIbEid071696; Thu, 10 Dec 2009 18:37:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912101837.nBAIbEid071696@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 10 Dec 2009 18:37: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: r200361 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 18:37:14 -0000 Author: luigi Date: Thu Dec 10 18:37:14 2009 New Revision: 200361 URL: http://svn.freebsd.org/changeset/base/200361 Log: use div64 when converting back the burst value for userland Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Dec 10 18:34:07 2009 (r200360) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Dec 10 18:37:14 2009 (r200361) @@ -2165,7 +2165,7 @@ dummynet_get(struct sockopt *sopt) */ bcopy(pipe, bp, sizeof(*pipe)); pipe_bp->delay = (pipe_bp->delay * 1000) / hz; - pipe_bp->burst /= 8 * hz; + pipe_bp->burst = div64(pipe_bp->burst, 8 * hz); /* * XXX the following is a hack based on ->next being the * first field in dn_pipe and dn_flow_set. The correct From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 18:38:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0DCC1065695; Thu, 10 Dec 2009 18:38:40 +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 CE71A8FC28; Thu, 10 Dec 2009 18:38: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 nBAIcekk071767; Thu, 10 Dec 2009 18:38:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAIceex071764; Thu, 10 Dec 2009 18:38:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200912101838.nBAIceex071764@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 10 Dec 2009 18:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200362 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 18:38:41 -0000 Author: pjd Date: Thu Dec 10 18:38:40 2009 New Revision: 200362 URL: http://svn.freebsd.org/changeset/base/200362 Log: MFC r200124,r200126, r200124: Avoid using additional variable for storing an error if we are not going to do anything with it. r200126: Fix deadlock when ZVOLs are present and we are replacing dead component or calling scrub when pool is in a degraded state. It will try to taste ZVOLs, which will lead to deadlock, as ZVOL will try to acquire the same locks as replace/scrub is holding already. We can't simply skip provider based on their GEOM class, because ZVOL can have providers build on top of it and we need to skip those as well. We do it by asking for ZFS::iszvol attribute. Any ZVOL-based provider will give us positive answer and we have to skip those providers. This way we remove possibility to create ZFS pools on top of ZVOLs, but it is not very useful anyway. I believe deadlock is still possible in some very complex situations like when we have MD provider on top of UFS file on top of ZVOL. When we try to replace dead component in the pool mentioned ZVOL is based on, there might be a deadlock when ZFS will try to taste MD provider. There is no easy way to detect that, but it isn't very common. r200125,r200158: Fix order of looking for providers. Before r200125 the order of looking for providers was wrong. It was: 1. Find provider by name. 2. Find provider by guid. 3. Find provider by name and guid. Where it should have been: 1. Find provider by name and guid. 2. Find provider by guid. 3. Find provider by name. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 10 18:37:14 2009 (r200361) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 10 18:38:40 2009 (r200362) @@ -293,11 +293,16 @@ vdev_geom_read_guid(struct g_consumer *c uint64_t psize; off_t offset, size; uint64_t guid; - int error, l, len; + int error, l, len, iszvol; g_topology_assert_not(); pp = cp->provider; + ZFS_LOG(1, "Reading guid from %s...", pp->name); + if (g_getattr("ZFS::iszvol", cp, &iszvol) == 0 && iszvol) { + ZFS_LOG(1, "Skipping ZVOL-based provider %s.", pp->name); + return (0); + } psize = pp->mediasize; psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t)); @@ -316,8 +321,7 @@ vdev_geom_read_guid(struct g_consumer *c if ((offset % pp->sectorsize) != 0) continue; - error = vdev_geom_io(cp, BIO_READ, label, offset, size); - if (error != 0) + if (vdev_geom_io(cp, BIO_READ, label, offset, size) != 0) continue; buf = label->vl_vdev_phys.vp_nvlist; @@ -502,7 +506,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi if ((owned = mtx_owned(&Giant))) mtx_unlock(&Giant); - cp = vdev_geom_open_by_path(vd, 0); + cp = vdev_geom_open_by_path(vd, 1); if (cp == NULL) { /* * The device at vd->vdev_path doesn't have the expected guid. @@ -512,7 +516,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi cp = vdev_geom_open_by_guid(vd); } if (cp == NULL) - cp = vdev_geom_open_by_path(vd, 1); + cp = vdev_geom_open_by_path(vd, 0); if (cp == NULL) { ZFS_LOG(1, "Provider %s not found.", vd->vdev_path); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 10 18:37:14 2009 (r200361) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 10 18:38:40 2009 (r200362) @@ -335,8 +335,11 @@ zvol_start(struct bio *bp) wakeup_one(&zv->zv_queue); mtx_unlock(&zv->zv_queue_mtx); break; - case BIO_DELETE: case BIO_GETATTR: + if (g_handleattr_int(bp, "ZFS::iszvol", 1)) + break; + /* FALLTHROUGH */ + case BIO_DELETE: default: g_io_deliver(bp, EOPNOTSUPP); break; From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 21:15:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E27D106566B; Thu, 10 Dec 2009 21:15:09 +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 440E08FC08; Thu, 10 Dec 2009 21:15: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 nBALF9WR075100; Thu, 10 Dec 2009 21:15:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBALF9ix075098; Thu, 10 Dec 2009 21:15:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912102115.nBALF9ix075098@svn.freebsd.org> From: Xin LI Date: Thu, 10 Dec 2009 21:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200364 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 21:15:09 -0000 Author: delphij Date: Thu Dec 10 21:15:08 2009 New Revision: 200364 URL: http://svn.freebsd.org/changeset/base/200364 Log: Allow commits to contrib/expat. Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Thu Dec 10 20:06:37 2009 (r200363) +++ svnadmin/conf/paths Thu Dec 10 21:15:08 2009 (r200364) @@ -60,6 +60,7 @@ ^vendor/clang ^vendor/cpio ^vendor/ee +^vendor/expat ^vendor/file ^vendor/gdb ^vendor/gdtoa From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 21:15:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA48106566C; Thu, 10 Dec 2009 21:15:25 +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 981C08FC14; Thu, 10 Dec 2009 21:15: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 nBALFP0b075151; Thu, 10 Dec 2009 21:15:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBALFPHU075142; Thu, 10 Dec 2009 21:15:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912102115.nBALFPHU075142@svn.freebsd.org> From: Xin LI Date: Thu, 10 Dec 2009 21:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200365 - in vendor/expat: 1.95.5 1.95.5/contrib 1.95.5/doc 1.95.5/examples 1.95.5/lib 1.95.5/tests 1.95.5/xmlwf 2.0.1 2.0.1/contrib 2.0.1/doc 2.0.1/examples 2.0.1/lib 2.0.1/tests 2.0.1... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 21:15:25 -0000 Author: delphij Date: Thu Dec 10 21:15:25 2009 New Revision: 200365 URL: http://svn.freebsd.org/changeset/base/200365 Log: Flattern all tags and dist tree for expat. Added: vendor/expat/1.95.5/COPYING - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/COPYING vendor/expat/1.95.5/Changes - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/Changes vendor/expat/1.95.5/FREEBSD-upgrade - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/FREEBSD-upgrade vendor/expat/1.95.5/MANIFEST - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/MANIFEST vendor/expat/1.95.5/Makefile.in - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/Makefile.in vendor/expat/1.95.5/README - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/README vendor/expat/1.95.5/configure - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/configure vendor/expat/1.95.5/configure.in - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/configure.in vendor/expat/1.95.5/doc/ - copied from r200363, vendor/expat/1.95.5/contrib/expat/doc/ vendor/expat/1.95.5/examples/ - copied from r200363, vendor/expat/1.95.5/contrib/expat/examples/ vendor/expat/1.95.5/expat_config.h.in - copied unchanged from r200363, vendor/expat/1.95.5/contrib/expat/expat_config.h.in vendor/expat/1.95.5/lib/ - copied from r200363, vendor/expat/1.95.5/contrib/expat/lib/ vendor/expat/1.95.5/tests/ - copied from r200363, vendor/expat/1.95.5/contrib/expat/tests/ vendor/expat/1.95.5/xmlwf/ - copied from r200363, vendor/expat/1.95.5/contrib/expat/xmlwf/ vendor/expat/2.0.1/COPYING - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/COPYING vendor/expat/2.0.1/Changes - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/Changes vendor/expat/2.0.1/MANIFEST - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/MANIFEST vendor/expat/2.0.1/Makefile.in - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/Makefile.in vendor/expat/2.0.1/README - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/README vendor/expat/2.0.1/configure - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/configure vendor/expat/2.0.1/configure.in - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/configure.in vendor/expat/2.0.1/doc/ - copied from r200363, vendor/expat/2.0.1/contrib/expat/doc/ vendor/expat/2.0.1/examples/ - copied from r200363, vendor/expat/2.0.1/contrib/expat/examples/ vendor/expat/2.0.1/expat_config.h.in - copied unchanged from r200363, vendor/expat/2.0.1/contrib/expat/expat_config.h.in vendor/expat/2.0.1/lib/ - copied from r200363, vendor/expat/2.0.1/contrib/expat/lib/ vendor/expat/2.0.1/tests/ - copied from r200363, vendor/expat/2.0.1/contrib/expat/tests/ vendor/expat/2.0.1/xmlwf/ - copied from r200363, vendor/expat/2.0.1/contrib/expat/xmlwf/ vendor/expat/dist/COPYING - copied unchanged from r200363, vendor/expat/dist/contrib/expat/COPYING vendor/expat/dist/Changes - copied unchanged from r200363, vendor/expat/dist/contrib/expat/Changes vendor/expat/dist/FREEBSD-upgrade - copied unchanged from r200363, vendor/expat/dist/contrib/expat/FREEBSD-upgrade vendor/expat/dist/MANIFEST - copied unchanged from r200363, vendor/expat/dist/contrib/expat/MANIFEST vendor/expat/dist/Makefile.in - copied unchanged from r200363, vendor/expat/dist/contrib/expat/Makefile.in vendor/expat/dist/README - copied unchanged from r200363, vendor/expat/dist/contrib/expat/README vendor/expat/dist/configure - copied unchanged from r200363, vendor/expat/dist/contrib/expat/configure vendor/expat/dist/configure.in - copied unchanged from r200363, vendor/expat/dist/contrib/expat/configure.in vendor/expat/dist/doc/ - copied from r200363, vendor/expat/dist/contrib/expat/doc/ vendor/expat/dist/examples/ - copied from r200363, vendor/expat/dist/contrib/expat/examples/ vendor/expat/dist/expat_config.h.in - copied unchanged from r200363, vendor/expat/dist/contrib/expat/expat_config.h.in vendor/expat/dist/lib/ - copied from r200363, vendor/expat/dist/contrib/expat/lib/ vendor/expat/dist/tests/ - copied from r200363, vendor/expat/dist/contrib/expat/tests/ vendor/expat/dist/xmlwf/ - copied from r200363, vendor/expat/dist/contrib/expat/xmlwf/ Deleted: vendor/expat/1.95.5/contrib/ vendor/expat/2.0.1/contrib/ vendor/expat/dist/contrib/ Copied: vendor/expat/1.95.5/COPYING (from r200363, vendor/expat/1.95.5/contrib/expat/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/COPYING Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/COPYING) @@ -0,0 +1,22 @@ +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper +Copyright (c) 2001, 2002 Expat maintainers. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copied: vendor/expat/1.95.5/Changes (from r200363, vendor/expat/1.95.5/contrib/expat/Changes) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/Changes Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/Changes) @@ -0,0 +1,99 @@ +Release 1.95.5 Fri Sep 6 2002 + - Added XML_UseForeignDTD() for improved SAX2 support. + - Added XML_GetFeatureList(). + - Defined XML_Bool type and the values XML_TRUE and XML_FALSE. + - Use an incomplete struct instead of a void* for the parser + (may not retain). + - Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected. + - Finally fixed bug where default handler would report DTD + events that were already handled by another handler. + Initial patch contributed by Darryl Miller. + - Removed unnecessary DllMain() function that caused static + linking into a DLL to be difficult. + - Added VC++ projects for building static libraries. + - Reduced line-length for all source code and headers to be + no longer than 80 characters, to help with AS/400 support. + - Reduced memory copying during parsing (SF patch #600964). + - Fixed a variety of bugs: see SF issues 580793, 434664, + 483514, 580503, 581069, 584041, 584183, 584832, 585537, + 596555, 596678, 598352, 598944, 599715, 600479, 600971. + +Release 1.95.4 Fri Jul 12 2002 + - Added support for VMS, contributed by Craig Berry. See + vms/README.vms for more information. + - Added Mac OS (classic) support, with a makefile for MPW, + contributed by Thomas Wegner and Daryle Walker. + - Added Borland C++ Builder 5 / BCC 5.5 support, contributed + by Patrick McConnell (SF patch #538032). + - Fixed a variety of bugs: see SF issues 441449, 563184, + 564342, 566334, 566901, 569461, 570263, 575168, 579196. + - Made skippedEntityHandler conform to SAX2 (see source comment) + - Re-implemented WFC: Entity Declared from XML 1.0 spec and + added a new error "entity declared in parameter entity": + see SF bug report 569461 and SF patch 578161 + - Re-implemented section 5.1 from XML 1.0 spec: + see SF bug report 570263 and SF patch 578161 + +Release 1.95.3 Mon Jun 3 2002 + - Added a project to the MSVC workspace to create a wchar_t + version of the library; the DLLs are named libexpatw.dll. + - Changed the name of the Windows DLLs from expat.dll to + libexpat.dll; this fixes SF bug #432456. + - Added the XML_ParserReset() API function. + - Fixed XML_SetReturnNSTriplet() to work for element names. + - Made the XML_UNICODE builds usable (thanks, Karl!). + - Allow xmlwf to read from standard input. + - Install a man page for xmlwf on Unix systems. + - Fixed many bugs; see SF bug reports 231864, 461380, 464837, + 466885, 469226, 477667, 484419, 487840, 494749, 496505, + 547350. Other bugs which we can't test as easily may also + have been fixed, especially in the area of build support. + +Release 1.95.2 Fri Jul 27 2001 + - More changes to make MSVC happy with the build; add a single + workspace to support both the library and xmlwf application. + - Added a Windows installer for Windows users; includes + xmlwf.exe. + - Added compile-time constants that can be used to determine the + Expat version + - Removed a lot of GNU-specific dependencies to aide portability + among the various Unix flavors. + - Fix the UTF-8 BOM bug. + - Cleaned up warning messages for several compilers. + - Added the -Wall, -Wstrict-prototypes options for GCC. + +Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000 + - Changes to get expat to build under Microsoft compiler + - Removed all aborts and instead return an UNEXPECTED_STATE error. + - Fixed a bug where a stray '%' in an entity value would cause an + abort. + - Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for + finding this oversight. + - Changed default patterns in lib/Makefile.in to fit non-GNU makes + Thanks to robin@unrated.net for reporting and providing an + account to test on. + - The reference had the wrong label for XML_SetStartNamespaceDecl. + Reported by an anonymous user. + +Release 1.95.0 Fri Sep 29 2000 + - XML_ParserCreate_MM + Allows you to set a memory management suite to replace the + standard malloc,realloc, and free. + - XML_SetReturnNSTriplet + If you turn this feature on when namespace processing is in + effect, then qualified, prefixed element and attribute names + are returned as "uri|name|prefix" where '|' is whatever + separator character is used in namespace processing. + - Merged in features from perl-expat + o XML_SetElementDeclHandler + o XML_SetAttlistDeclHandler + o XML_SetXmlDeclHandler + o XML_SetEntityDeclHandler + o StartDoctypeDeclHandler takes 3 additional parameters: + sysid, pubid, has_internal_subset + o Many paired handler setters (like XML_SetElementHandler) + now have corresponding individual handler setters + o XML_GetInputContext for getting the input context of + the current parse position. + - Added reference material + - Packaged into a distribution that builds a sharable library Copied: vendor/expat/1.95.5/FREEBSD-upgrade (from r200363, vendor/expat/1.95.5/contrib/expat/FREEBSD-upgrade) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/FREEBSD-upgrade Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/FREEBSD-upgrade) @@ -0,0 +1,16 @@ +$FreeBSD$ + +eXpat from www.libexpat.org + +Imported by: + + tar zxvf expat-1.95.5.tar.gz + cd expat-1.95.5 + rm -rf bcb5 win32 vms conftools doc/valid-xhtml10.png + vi FREEBSD-upgrade + cvs import -m "Virgin import (trimmed) of eXpat version 1.95.5" \ + src/contrib/expat EXPAT v1_95_5 + +phk@FreeBSD.org + + Copied: vendor/expat/1.95.5/MANIFEST (from r200363, vendor/expat/1.95.5/contrib/expat/MANIFEST) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/MANIFEST Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/MANIFEST) @@ -0,0 +1,85 @@ +Changes +COPYING +MANIFEST +Makefile.in +README +configure +configure.in +expat_config.h.in +bcb5/ExpatGroup.bpg +bcb5/ReadMe.txt +bcb5/elements.bpf +bcb5/elements.bpr +bcb5/elements.mak +bcb5/libexpat.bpf +bcb5/libexpat.bpr +bcb5/libexpat.mak +bcb5/libexpatw.bpf +bcb5/libexpatw.bpr +bcb5/libexpatw.mak +bcb5/makefile.mak +bcb5/outline.bpf +bcb5/outline.bpr +bcb5/outline.mak +bcb5/setup.bat +bcb5/xmlwf.bpf +bcb5/xmlwf.bpr +bcb5/xmlwf.mak +conftools/PrintPath +conftools/ac_c_bigendian_cross.m4 +conftools/config.guess +conftools/config.sub +conftools/expat.m4 +conftools/install-sh +conftools/libtool.m4 +conftools/ltmain.sh +conftools/mkinstalldirs +doc/reference.html +doc/style.css +doc/valid-xhtml10.png +doc/xmlwf.1 +doc/xmlwf.sgml +examples/elements.c +examples/outline.c +lib/ascii.h +lib/asciitab.h +lib/expat.h +lib/iasciitab.h +lib/internal.h +lib/latin1tab.h +lib/nametab.h +lib/utf8tab.h +lib/xmlparse.c +lib/xmlrole.c +lib/xmlrole.h +lib/xmltok.c +lib/xmltok.h +lib/xmltok_impl.c +lib/xmltok_impl.h +lib/xmltok_ns.c +lib/winconfig.h +tests/README.txt +tests/chardata.c +tests/chardata.h +tests/runtests.c +tests/xmltest.sh +vms/descrip.mms +vms/expat_config.h +vms/README.vms +win32/expat.iss +win32/MANIFEST.txt +xmlwf/codepage.c +xmlwf/codepage.h +xmlwf/ct.c +xmlwf/filemap.h +xmlwf/readfilemap.c +xmlwf/unixfilemap.c +xmlwf/win32filemap.c +xmlwf/xmlfile.c +xmlwf/xmlfile.h +xmlwf/xmlmime.c +xmlwf/xmlmime.h +xmlwf/xmltchar.h +xmlwf/xmlurl.h +xmlwf/xmlwf.c +xmlwf/xmlwin32url.cxx Copied: vendor/expat/1.95.5/Makefile.in (from r200363, vendor/expat/1.95.5/contrib/expat/Makefile.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/Makefile.in Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/Makefile.in) @@ -0,0 +1,171 @@ +################################################################ +# Process this file with top-level configure script to produce Makefile +# +# Copyright 2000 Clark Cooper +# +# This file is part of EXPAT. +# +# EXPAT is free software; you can redistribute it and/or modify it +# under the terms of the License (based on the MIT/X license) contained +# in the file COPYING that comes with this distribution. +# +# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. +# + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +mandir = ${prefix}/man/man1 + +top_builddir = . + + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs + +MANFILE = $(srcdir)/doc/xmlwf.1 +APIHEADER = $(srcdir)/lib/expat.h +LIBRARY = libexpat.la + + +default: buildlib xmlwf/xmlwf + +buildlib: $(LIBRARY) + +all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline + +clean: + cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs + cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs + cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs + cd tests && rm -rf .libs runtests runtests.o chardata.o + rm -rf .libs libexpat.la + find . -name core | xargs rm -f + +distclean: clean + rm -f expat_config.h config.status config.log config.cache libtool + rm -f Makefile + +extraclean: distclean + rm -f expat_config.h.in configure + rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 + +check: tests/runtests + tests/runtests + +install: xmlwf/xmlwf installlib + $(mkinstalldirs) $(bindir) $(mandir) + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf + $(INSTALL_DATA) $(MANFILE) $(mandir) + +installlib: $(LIBRARY) $(APIHEADER) + $(mkinstalldirs) $(libdir) $(includedir) + $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY) + $(INSTALL_DATA) $(APIHEADER) $(includedir) + +uninstall: uninstalllib + $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf + rm -f $(mandir)/xmlwf.1 + +uninstalllib: + $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY) + rm -f $(includedir)/$(APIHEADER) + +# for VPATH builds (invoked by configure) +mkdir-init: + @for d in lib xmlwf examples tests ; do \ + (mkdir $$d 2> /dev/null || test 1) ; \ + done + +CC = @CC@ +LIBTOOL = @LIBTOOL@ + +INCLUDES = -I$(srcdir)/lib -I. +LDFLAGS = @LDFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CFLAGS = @CFLAGS@ +VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ + +### autoconf this? +LTFLAGS = --silent + +COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) +LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) +LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ +LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ + +LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo +$(LIBRARY): $(LIB_OBJS) + $(LINK_LIB) $(LIB_OBJS) + +lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ + $(top_builddir)/expat_config.h lib/internal.h + +lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ + $(top_builddir)/expat_config.h lib/internal.h + +lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ + lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ + lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ + $(top_builddir)/expat_config.h + + +XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o +xmlwf/xmlwf.o: xmlwf/xmlwf.c +xmlwf/xmlfile.o: xmlwf/xmlfile.c +xmlwf/codepage.o: xmlwf/codepage.c +xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c +xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) + $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) + +examples/elements.o: examples/elements.c +examples/elements: examples/elements.o $(LIBRARY) + $(LINK_EXE) $< $(LIBRARY) + +examples/outline.o: examples/outline.c +examples/outline: examples/outline.o $(LIBRARY) + $(LINK_EXE) $< $(LIBRARY) + +tests/chardata.o: tests/chardata.c tests/chardata.h +tests/runtests.o: tests/runtests.c tests/chardata.h +tests/runtests: tests/runtests.o tests/chardata.o $(LIBRARY) + $(LINK_EXE) $^ -lcheck + +tests/xmlts.zip: + wget --output-document=tests/xmlts.zip \ + http://www.w3.org/XML/Test/xmlts20020606.zip + +tests/XML-Test-Suite: tests/xmlts.zip + cd tests && unzip -q xmlts.zip + +run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite + tests/xmltest.sh + +.SUFFIXES: .c .lo .o + +.c.o: + $(COMPILE) -o $@ -c $< +.c.lo: + $(LTCOMPILE) -o $@ -c $< + +.PHONY: buildlib all \ + clean distclean extraclean maintainer-clean \ + dist distdir \ + install uninstall Copied: vendor/expat/1.95.5/README (from r200363, vendor/expat/1.95.5/contrib/expat/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/README Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/README) @@ -0,0 +1,112 @@ + + Expat, Release 1.95.5 + +This is Expat, a C library for parsing XML, written by James Clark. +Expat is a stream-oriented XML parser. This means that you register +handlers with the parser before starting the parse. These handlers +are called when the parser discovers the associated structures in the +document being parsed. A start tag is an example of the kind of +structures for which you may register handlers. + +Windows users should use the expat_win32bin package, which includes +both precompiled libraries and executalbes, and source code for +developers. + +Expat is free software. You may copy, distribute, and modify it under +the terms of the License contained in the file COPYING distributed +with this package. This license is the same as the MIT/X Consortium +license. + +Versions of Expat that have an odd minor version (the middle number in +the release above), are development releases and should be considered +as beta software. Releases with even minor version numbers are +intended to be production grade software. + +If you are building Expat from a check-out from the CVS repository, +you need to run a script that generates the configure script using the +GNU autoconf and libtool tools. To do this, you need to have +autoconf 2.52 or newer and libtool 1.4 or newer. Run the script like +this: + + ./buildconf.sh + +Once this has been done, follow the same instructions as for building +from a source distribution. + +To build Expat from a source distribution, you first run the +configuration shell script in the top level distribution directory: + + ./configure + +There are many options which you may provide to configure (which you +can discover by running configure with the --help option). But the +one of most interest is the one that sets the installation directory. +By default, the configure script will set things up to install +libexpat into /usr/local/lib, expat.h into /usr/local/include, and +xmlwf into /usr/local/bin. If, for example, you'd prefer to install +into /home/me/mystuff/lib, /home/me/mystuff/include, and +/home/me/mystuff/bin, you can tell configure about that with: + + ./configure --prefix=/home/me/mystuff + +After running the configure script, the "make" command will build +things and "make install" will install things into their proper +location. Note that you need to have write permission into the +directories into which things will be installed. + +If you are interested in building Expat to provide document +information in UTF-16 rather than the default UTF-8, following these +instructions: + + 1. For UTF-16 output as unsigned short (and version/error + strings as char), run: + + ./configure CPPFLAGS=-DXML_UNICODE + + For UTF-16 output as wchar_t (incl. version/error strings), + run: + + ./configure CFLAGS="-g -O2 -fshort-wchar" \ + CPPFLAGS=-DXML_UNICODE_WCHAR_T + + 2. Edit the MakeFile, changing: + + LIBRARY = libexpat.la + + to: + + LIBRARY = libexpatw.la + + (Note the additional "w" in the library name.) + + 3. Run "make buildlib" (which builds the library only). + + 4. Run "make installlib" (which installs the library only). + +Note for Solaris users: The "ar" command is usually located in +"/usr/ccs/bin", which is not in the default PATH. You will need to +add this to your path for the "make" command, and probably also switch +to GNU make (the "make" found in /usr/ccs/bin does not seem to work +properly -- appearantly it does not understand .PHONY directives). If +you're using ksh or bash, use this command to build: + + PATH=/usr/ccs/bin:$PATH make + +When using Expat with a project using autoconf for configuration, you +can use the probing macro in conftools/expat.m4 to determine how to +include Expat. See the comments at the top of that file for more +information. + +A reference manual is available in the file doc/reference.html in this +distribution. + +The homepage for this project is http://www.libexpat.org/. There +are links there to connect you to the bug reports page. If you need +to report a bug when you don't have access to a browser, you may also +send a bug report by email to expat-bugs@mail.libexpat.org. + +Discussion related to the direction of future expat development takes +place on expat-discuss@mail.libexpat.org. Archives of this list and +other Expat-related lists may be found at: + + http://mail.libexpat.org/mailman-21/listinfo/ Copied: vendor/expat/1.95.5/configure (from r200363, vendor/expat/1.95.5/contrib/expat/configure) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/1.95.5/configure Thu Dec 10 21:15:25 2009 (r200365, copy of r200363, vendor/expat/1.95.5/contrib/expat/configure) @@ -0,0 +1,10094 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.53 for expat 1.95.5. +# +# Report bugs to . +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) lt_cv_sys_path_separator=';' ;; + *) lt_cv_sys_path_separator=':' ;; + esac + PATH_SEPARATOR=$lt_cv_sys_path_separator +fi + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='expat' +PACKAGE_TARNAME='expat' +PACKAGE_VERSION='1.95.5' +PACKAGE_STRING='expat 1.95.5' +PACKAGE_BUGREPORT='expat-bugs@mail.libexpat.org' + +ac_unique_file="Makefile.in" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 21:16:17 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AFF41065695; Thu, 10 Dec 2009 21:16:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6C28FC1C; Thu, 10 Dec 2009 21:16: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 nBALGHAH075209; Thu, 10 Dec 2009 21:16:17 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBALGHi5075207; Thu, 10 Dec 2009 21:16:17 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <200912102116.nBALGHi5075207@svn.freebsd.org> From: Brooks Davis Date: Thu, 10 Dec 2009 21:16: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: r200366 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 21:16:17 -0000 Author: brooks Date: Thu Dec 10 21:16:16 2009 New Revision: 200366 URL: http://svn.freebsd.org/changeset/base/200366 Log: Add a missing else that negated the truncation of ki_ngroups to NGROUPS. Submitted by: Dmitry Pryanishnikov Modified: head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Thu Dec 10 21:15:25 2009 (r200365) +++ head/lib/libkvm/kvm_proc.c Thu Dec 10 21:16:16 2009 (r200366) @@ -149,7 +149,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcn if (ucred.cr_ngroups > KI_NGROUPS) { kp->ki_ngroups = KI_NGROUPS; kp->ki_cr_flags |= KI_CRF_GRP_OVERFLOW; - } + } else kp->ki_ngroups = ucred.cr_ngroups; kvm_read(kd, (u_long)ucred.cr_groups, kp->ki_groups, kp->ki_ngroups * sizeof(gid_t)); From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 21:18:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B4AC10656A8; Thu, 10 Dec 2009 21:18:54 +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 D5CEB8FC12; Thu, 10 Dec 2009 21:18: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 nBALIrE1075305; Thu, 10 Dec 2009 21:18:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBALIr0u075304; Thu, 10 Dec 2009 21:18:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912102118.nBALIr0u075304@svn.freebsd.org> From: Xin LI Date: Thu, 10 Dec 2009 21:18: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: r200367 - head/contrib/expat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 21:18:54 -0000 Author: delphij Date: Thu Dec 10 21:18:53 2009 New Revision: 200367 URL: http://svn.freebsd.org/changeset/base/200367 Log: Bootstrap merge history. Modified: Directory Properties: head/contrib/expat/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 21:21:25 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 761621065672; Thu, 10 Dec 2009 21:21:25 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 0E13D8FC22; Thu, 10 Dec 2009 21:21:24 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id nBALK987023770; Thu, 10 Dec 2009 15:20:09 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id nBALK9Is023769; Thu, 10 Dec 2009 15:20:09 -0600 (CST) (envelope-from brooks) Date: Thu, 10 Dec 2009 15:20:09 -0600 From: Brooks Davis To: Dmitry Pryanishnikov Message-ID: <20091210212009.GB23550@lor.one-eyed-alien.net> References: <4B146423.2090703@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+g7M9IMkV8truYOl" Content-Disposition: inline In-Reply-To: <4B146423.2090703@gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Thu, 10 Dec 2009 15:20:09 -0600 (CST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r195843 - in head: lib/libkvm sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 21:21:25 -0000 --+g7M9IMkV8truYOl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 01, 2009 at 02:32:35AM +0200, Dmitry Pryanishnikov wrote: >=20 > Hello! >=20 >> Author: brooks >> Date: Fri Jul 24 15:03:10 2009 >> New Revision: 195843 >> URL: http://svn.freebsd.org/changeset/base/195843 >>=20 >> Log: >> Revert the changes to struct kinfo_proc in r194498. Instead, fill >> in up to 16 (KI_NGROUPS) values and steal a bit from ki_cr_flags >> (all bits currently unused) to indicate overflow with the new flag >> KI_CRF_GRP_OVERFLOW. >> This fixes procstat -s. >> Approved by: re (kib) >>=20 >> Modified: >> head/lib/libkvm/kvm_proc.c >> head/sys/kern/kern_proc.c >> head/sys/sys/user.h >>=20 >> Modified: head/lib/libkvm/kvm_proc.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/lib/libkvm/kvm_proc.c Fri Jul 24 14:57:02 2009 (r195842) >> +++ head/lib/libkvm/kvm_proc.c Fri Jul 24 15:03:10 2009 (r195843) >> @@ -145,8 +145,14 @@ kvm_proclist(kd, what, arg, p, bp, maxcn >> kp->ki_svuid =3D ucred.cr_svuid; >> kp->ki_rgid =3D ucred.cr_rgid; >> kp->ki_svgid =3D ucred.cr_svgid; >> - kp->ki_ngroups =3D ucred.cr_ngroups; >> - kp->ki_groups =3D ucred.cr_groups; >> + kp->ki_cr_flags =3D ucred.cr_flags; >> + if (ucred.cr_ngroups > KI_NGROUPS) { >> + kp->ki_ngroups =3D KI_NGROUPS; >> + kp->ki_cr_flags |=3D KI_CRF_GRP_OVERFLOW; >> + } >> + kp->ki_ngroups =3D ucred.cr_ngroups; >=20 > It seems that 'else' is missing after closing brace of this 'if'? With = the > code as is, 'kp->ki_ngroups =3D KI_NGROUPS;' is effectively NO-OP... Yikes, you're right. Sorry I took so long to fix this. I'll MFC in about a week. -- Brooks --+g7M9IMkV8truYOl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLIWYIXY6L6fI4GtQRArJqAJ9zqdPxxNUN2nmb+oVinJ5QDVUa9ACg3UrH 61YErVplE9LCo1ronCKvBk0= =bNfj -----END PGP SIGNATURE----- --+g7M9IMkV8truYOl-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 21:23:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67E27106568B; Thu, 10 Dec 2009 21:23: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 575148FC13; Thu, 10 Dec 2009 21:23: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 nBALNkum075452; Thu, 10 Dec 2009 21:23:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBALNkbp075450; Thu, 10 Dec 2009 21:23:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912102123.nBALNkbp075450@svn.freebsd.org> From: Xin LI Date: Thu, 10 Dec 2009 21:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200368 - vendor/expat/dist/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 21:23:46 -0000 Author: delphij Date: Thu Dec 10 21:23:46 2009 New Revision: 200368 URL: http://svn.freebsd.org/changeset/base/200368 Log: Correct a DoS issue when processing XML document with malformed UTF-8 sequences. Obtained from: expat CVS (revisions 1.14 and 1.15) Security: CVE-2009-3560 Modified: vendor/expat/dist/lib/xmltok_impl.c Modified: vendor/expat/dist/lib/xmltok_impl.c ============================================================================== --- vendor/expat/dist/lib/xmltok_impl.c Thu Dec 10 21:18:53 2009 (r200367) +++ vendor/expat/dist/lib/xmltok_impl.c Thu Dec 10 21:23:46 2009 (r200368) @@ -1744,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 22:25:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB0E1065670; Thu, 10 Dec 2009 22:25:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DE198FC16; Thu, 10 Dec 2009 22:25: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 nBAMPr5b076761; Thu, 10 Dec 2009 22:25:53 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBAMPrZx076758; Thu, 10 Dec 2009 22:25:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912102225.nBAMPrZx076758@svn.freebsd.org> From: Ed Schouten Date: Thu, 10 Dec 2009 22:25: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: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 22:25:53 -0000 Author: ed Date: Thu Dec 10 22:25:53 2009 New Revision: 200369 URL: http://svn.freebsd.org/changeset/base/200369 Log: Update termcap entries for xterm. It turns out these entries do make Terminal.app behave a little better. According to Thomas Dickey, Terminal.app should use TERM=nsterm anyway, but we don't support this yet. Already having an improved termcap entry helps, so I am going to MFC this change after all. Suggested by: Leonidas Tsampros MFC after: 1 month Modified: head/etc/termcap.small head/share/termcap/termcap.src Modified: head/etc/termcap.small ============================================================================== --- head/etc/termcap.small Thu Dec 10 21:23:46 2009 (r200368) +++ head/etc/termcap.small Thu Dec 10 22:25:53 2009 (r200369) @@ -291,32 +291,32 @@ pc3|ibmpc3|IBM PC 386BSD Console:\ :up=\E[A:\ :ut: -# $XFree86: xc/programs/xterm/termcap,v 3.28 2001/01/17 23:46:39 dawes Exp $ +# $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $ # -xterm-xfree86|XFree86 xterm:\ - :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ - :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ - :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ - :@7=\EOF:@8=\EOM:kI=\E[2~:\ - :kh=\EOH:kP=\E[5~:kN=\E[6~:\ - :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:Km=\E[M:tc=xterm-basic: +xterm-new|modern xterm:\ + :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kH=\EOF:kI=\E[2~:\ + :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\ + :tc=xterm-basic: # # This chunk is used for building the VT220/Sun/PC keyboard variants. -xterm-basic|xterm common (XFree86):\ - :li#24:co#80:am:kn#12:km:mi:ms:xn:AX:bl=^G:\ - :is=\E[!p\E[?3;4l\E[4l\E>:rs=\E[!p\E[?3;4l\E[4l\E>:le=^H:\ - :AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:al=\E[L:dc=\E[P:dl=\E[M:\ - :UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:\ - :ho=\E[H:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:\ - :im=\E[4h:ei=\E[4l:ks=\E[?1h\E=:ke=\E[?1l\E>:kD=\E[3~:kb=^H:\ - :sf=\n:sr=\EM:st=\EH:ct=\E[3g:sc=\E7:rc=\E8:\ - :eA=\E(B\E)0:as=\E(0:ae=\E(B:ml=\El:mu=\Em:up=\E[A:nd=\E[C:\ - :md=\E[1m:me=\E[m:mr=\E[7m:so=\E[7m:se=\E[27m:us=\E[4m:ue=\E[24m:\ - :ti=\E[?1049h:te=\E[?1049l:vi=\E[?25l:ve=\E[?25h:\ - :ut:Co#8:pa#64:op=\E[39;49m:AB=\E[4%dm:AF=\E[3%dm:\ +xterm-basic|modern xterm common:\ + :am:bs:km:mi:ms:ut:xn:AX:\ + :Co#8:co#80:kn#12:li#24:pa#64:\ + :AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ + :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:\ + :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ + :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\ + :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ + :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ + :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ + :so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\ + :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: # # This is the only entry which you should have to customize, since "xterm" # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. -xterm|xterm-color|X11 terminal emulator:\ - :ti@:te@:tc=xterm-xfree86: +xterm|X11 terminal emulator:\ + :tc=xterm-new: Modified: head/share/termcap/termcap.src ============================================================================== --- head/share/termcap/termcap.src Thu Dec 10 21:23:46 2009 (r200368) +++ head/share/termcap/termcap.src Thu Dec 10 22:25:53 2009 (r200369) @@ -2784,48 +2784,46 @@ SH|screen-s|VT 100/ANSI X3.64 virtual te :ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen: SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\ :co#132:tc=screen: -# $Xorg: termcap,v 1.3 2000/08/17 19:55:10 cpqbld Exp $ +# $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $ # # Note: # termcap format is limited to 1023 characters. This set of descriptions # is a subset of the terminfo, since not all features can be fit into # that limit. The 'xterm' description supports color. The monochrome -# 'xtermm' drops color in favor of additional function keys. If you need -# both, use terminfo. +# 'xterm-mono' drops color in favor of additional function keys. If you +# need both, use terminfo. # # The 1023-character limit applies to each entry after resolving the # "tc=" strings. Some implementations may discount all or part of the # formatting characters in the entry (i.e., the backslash newline tab # colon). GNU termcap does not have this limit. # -# I checked the limits using ncurses "captoinfo -CrTv", which prints +# I checked the limits using ncurses "captoinfo -CrTUvx", which prints # the resolved length of each entry in a comment at the end - T.Dickey # -# $XFree86: xc/programs/xterm/termcap,v 3.28 2001/01/17 23:46:39 dawes Exp $ -# -xterm-xfree86|XFree86 xterm:\ - :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\ - :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\ - :k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ - :@7=\EOF:@8=\EOM:kI=\E[2~:\ - :kh=\EOH:kP=\E[5~:kN=\E[6~:\ - :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:Km=\E[M:tc=xterm-basic: +xterm-new|modern xterm:\ + :*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\ + :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ + :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kH=\EOF:kI=\E[2~:\ + :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\ + :tc=xterm-basic: # # This chunk is used for building the VT220/Sun/PC keyboard variants. -xterm-basic|xterm common (XFree86):\ - :li#24:co#80:am:kn#12:km:mi:ms:xn:AX:bl=^G:\ - :is=\E[!p\E[?3;4l\E[4l\E>:rs=\E[!p\E[?3;4l\E[4l\E>:le=^H:\ - :AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:al=\E[L:dc=\E[P:dl=\E[M:\ - :UP=\E[%dA:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:\ - :ho=\E[H:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:\ - :im=\E[4h:ei=\E[4l:ks=\E[?1h\E=:ke=\E[?1l\E>:kD=\E[3~:kb=^H:\ - :sf=\n:sr=\EM:st=\EH:ct=\E[3g:sc=\E7:rc=\E8:\ - :eA=\E(B\E)0:as=\E(0:ae=\E(B:ml=\El:mu=\Em:up=\E[A:nd=\E[C:\ - :md=\E[1m:me=\E[m:mr=\E[7m:so=\E[7m:se=\E[27m:us=\E[4m:ue=\E[24m:\ - :ti=\E[?1049h:te=\E[?1049l:vi=\E[?25l:ve=\E[?25h:\ - :ut:Co#8:pa#64:op=\E[39;49m:AB=\E[4%dm:AF=\E[3%dm: +xterm-basic|modern xterm common:\ + :am:bs:km:mi:ms:ut:xn:AX:\ + :Co#8:co#80:kn#12:li#24:pa#64:\ + :AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ + :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:\ + :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ + :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\ + :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ + :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ + :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ + :so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\ + :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h: -# The xterm-xfree86 description has all of the features, but is not completely +# The xterm-new description has all of the features, but is not completely # compatible with vt220. If you are using a Sun or PC keyboard, set the # sunKeyboard resource to true: # + maps the editing keypad @@ -2835,68 +2833,91 @@ xterm-basic|xterm common (XFree86):\ # + uses DEC-style control sequences for the application keypad. # xterm-vt220|xterm emulating vt220:\ - :kH=\E[4~::@7=\E[4~:*6=\E[4~:kh=\E[1~:Km=\E[M:tc=xterm-basic: + :*6=\E[4~:@7=\E[4~:K2=\EOu:Km=\E[M:kH=\E[4~:kh=\E[1~:\ + :tc=xterm-basic: xterm-24|xterms|vs100|24x80 xterm:\ - :li#24:\ - :tc=xterm: + :li#24:tc=xterm-old: xterm-65|65x80 xterm:\ - :li#65:tc=xterm: + :li#65:tc=xterm-old: xterm-bold|xterm with bold for underline:\ - :so=\E[7m:us=\E[1m:tc=xterm: + :so=\E[7m:us=\E[1m:tc=xterm-old: xterm-boldso|xterm with bold for standout:\ - :se=\E[m:so=\E[1m:tc=xterm: + :se=\E[m:so=\E[1m:tc=xterm-old: xterm-mono|monochrome xterm:\ - :kn#20:\ - :st@:ut@:Co@:NC@:op@:AB@:AF@:pa@:Sf@:Sb@:tc=xterm: + :ut@:\ + :Co@:NC@:kn#20:pa@:\ + :AB@:AF@:Sb@:Sf@:op@:st@:tc=xterm-old: # # Alternate terminal description that "works" for interactive shells such as # tcsh and bash. xterm-noapp|xterm with cursor keys in normal mode:\ - :kl=\E[D:kd=\E[B:kr=\E[C:ku=\E[A:ks=\E=:ke=\E>:ti@:te@:tc=xterm: + :kd=\E[B:ke=\E>:kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:te@:ti@:\ + :tc=xterm: +# +# This should work for the commonly used "color xterm" variations (XFree86 +# xterm, color_xterm, nxterm, rxvt). Note that it does not set 'bce', so for +# XFree86 and rxvt, some applications that use colors will be less efficient, +# and in a few special cases (with "smart" optimization) the wrong color will +# be painted in spots. +xterm-color|generic "ANSI" color xterm:\ + :Co#8:NC@:pa#64:\ + :AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:tc=xterm-r6: # # These aliases are for compatibility with the terminfo; termcap cannot provide -# the extra features, but termcap applications still want the names. -xterm-16color|xterm alias 1:tc=xterm-xfree86: -xterm-88color|xterm alias 2:tc=xterm-256color: -xterm-256color|xterm alias 3:tc=xterm-xfree86: -xterm-nrc|xterm alias 4:tc=xterm: -xterm-rep|xterm alias 5:tc=xterm: -xterm-xmc|xterm alias 6:sg#1:tc=xterm: +# the extra features such as color initialization, but termcap applications +# still want the names. +xterm-16color|xterm alias 1:\ + :tc=xterm-new: + +xterm-88color|xterm alias 2:\ + :Co#88:pa#7744:tc=xterm-256color: + +xterm-256color|xterm alias 3:\ + :Co#256:pa#32767:\ + :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-new: + +xterm-nrc|xterm alias 4:\ + :tc=xterm: +xterm-rep|xterm alias 5:\ + :tc=xterm: +xterm-xmc|xterm alias 6:\ + :sg#1:tc=xterm: # # An 8-bit description is doable with termcap, but there are probably no # termcap (or BSD curses) applications that are able to use it. xterm-8bit|xterm terminal emulator 8-bit controls (X Window System):\ - :co#80:li#24:\ - :it#8:am:km:mi:ms:xn:\ - :AL=\233%dL:DC=\233%dP:DL=\233%dM:DO=\233%dB:IC=\233%d@:LE=\233%dD:\ - :RI=\233%dC:UP=\233%dA:ae=^O:al=\233L:as=^N:bl=^G:bt=\233Z:\ - :cd=\233J:ce=\233K:cl=\233H\2332J:cm=\233%i%d;%dH:cr=^M:\ - :cs=\233%i%d;%dr:ct=\2333g:dc=\233P:dl=\233M:do=^J:up=\233A:nd=\233C:\ - :ei=\2334l:ho=\233H:im=\2334h:\ + :am:km:mi:ms:xn:\ + :co#80:it#8:li#24:\ + :AL=\233%dL:DC=\233%dP:DL=\233%dM:DO=\233%dB:IC=\233%d@:\ + :K2=\217y:Km=\233M:LE=\233%dD:RI=\233%dC:UP=\233%dA:\ + :ae=\E(B:al=\233L:as=\E(0:bl=^G:bt=\233Z:cd=\233J:ce=\233K:\ + :cl=\233H\2332J:cm=\233%i%d;%dH:cr=^M:cs=\233%i%d;%dr:\ + :ct=\2333g:dc=\233P:dl=\233M:do=^J:ei=\2334l:ho=\233H:\ + :im=\2334h:\ :is=\E[62"p\E G\233m\233?7h\E>\E7\233?1;3;4;6l\2334l\233r\E8:\ :k1=\23311~:k2=\23312~:k3=\23313~:k4=\23314~:k5=\23315~:\ :k6=\23317~:k7=\23318~:k8=\23319~:k9=\23320~:kD=\2333~:\ :kI=\2332~:kN=\2336~:kP=\2335~:kb=^H:kd=\217B:\ :ke=\233?1l\E>:kh=\2331~:kl=\217D:kr=\217C:ks=\233?1h\E=:\ - :ku=\217A:le=^H:mb=\2335m:md=\2331m:me=\233m^O:mr=\2337m:\ - :rc=\E8:sc=\E7:se=\23327m:sf=^J:so=\2337m:sr=\215:\ - :st=\210:ta=^I:te=\233?1049l:ti=\233?1049h:ue=\23324m:us=\2334m:\ - :vb=\233?5h\233?5l:ve=\233?25h:vi=\233?25l:Km=\233M: -# -xterm-hp|XFree86 xterm with hpterm function keys:\ - :k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:k8=\Ew:\ - :kC=\EJ:kD=\EP:@7=\EF:kI=\EQ:kN=\ES:kP=\ET:kh=\Eh:\ - :kd=\EB:kl=\ED:kr=\EC:ku=\EA:tc=xterm-basic: -# -xterm-sco|XFree86 xterm with SCO function keys:\ - :kl=\E[D:kd=\E[B:kr=\E[C:ku=\E[A:@7=\E[F:\ - :k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:\ - :k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:k;=\E[V:\ - :F1=\E[W:F2=\E[X:F3=\E[Y:F5=\E[a:F6=\E[b:\ - :F7=\E[c:F8=\E[d:F9=\E[e:FA=\E[f:FB=\E[g:\ - :FC=\E[h:FD=\E[i:FE=\E[j:FF=\E[k:\ - :kh=\E[H:kI=\E[L:kN=\E[G:kP=\E[I:ac@:tc=xterm-basic: + :ku=\217A:le=^H:mb=\2335m:md=\2331m:me=\233m:mr=\2337m:\ + :nd=\233C:rc=\E8:sc=\E7:se=\23327m:sf=^J:so=\2337m:sr=\215:\ + :st=\210:ta=^I:te=\233?1049l:ti=\233?1049h:ue=\23324m:\ + :up=\233A:us=\2334m:vb=\233?5h\233?5l:ve=\233?25l\233?25h:\ + :vs=\233?12;25h:vi=\233?25l: +# +xterm-hp|xterm with hpterm function keys:\ + :@7=\EF:k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:\ + :k8=\Ew:kC=\EJ:kD=\EP:kI=\EQ:kN=\ES:kP=\ET:kd=\EB:kh=\Eh:\ + :kl=\ED:kr=\EC:ku=\EA:tc=xterm-basic: +# +xterm-sco|xterm with SCO function keys:\ + :@7=\E[F:F1=\E[W:F2=\E[X:F3=\E[Y:F5=\E[a:F6=\E[b:F7=\E[c:\ + :F8=\E[d:F9=\E[e:FA=\E[f:FB=\E[g:FC=\E[h:FD=\E[i:FE=\E[j:\ + :FF=\E[k:ac=:k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:\ + :k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:k;=\E[V:kD=\177:kI=\E[L:\ + :kN=\E[G:kP=\E[I:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:\ + :tc=xterm-basic: # xterm-vt52|xterm emulating vt52:\ :bs:\ @@ -2906,63 +2927,65 @@ xterm-vt52|xterm emulating vt52:\ :le=\ED:nd=\EC:nw=^M^J:sf=^J:sr=\EI:ta=^I:up=\EA: # xterm-sun|xterm with Sun functionkeys:\ - :k1=\E[224z:k2=\E[225z:k3=\E[226z:k4=\E[227z:\ - :k5=\E[228z:k6=\E[229z:k7=\E[230z:k8=\E[231z:\ - :k9=\E[232z:k;=\E[233z:F1=\E[192z:F2=\E[193z:\ - :%1=\E[196z:&8=\E[195z:@0=\E[200z:kI=\E[2z:\ - :kN=\E[222z:kP=\E[216z:kh=\E[214z:kD=^?:\ - :Km=\E[M:@5=\E[197z::@7=\E[220z:\ + :%1=\E[196z:&8=\E[195z:@0=\E[200z:@5=\E[197z:@7=\E[220z:\ + :F1=\E[192z:F2=\E[193z:K2=\E[218z:Km=\E[M:k1=\E[224z:\ + :k2=\E[225z:k3=\E[226z:k4=\E[227z:k5=\E[228z:k6=\E[229z:\ + :k7=\E[230z:k8=\E[231z:k9=\E[232z:k;=\E[233z:kD=\E[3z:\ + :kI=\E[2z:kN=\E[222z:kP=\E[216z:kh=\E[214z:\ :tc=xterm-basic: # # vi may work better with this entry, because vi doesn't use insert mode much. -# |xterm-ic|xterm-vi|xterm with insert character instead of insert mode: +# |xterm-ic|xterm-vi|xterm with insert character instead of insert mode:\ xterm-ic|xterm-vi|xterm with insert char:\ - :im@:ei@:mi@:ic=\E[@:IC=\E[%d@:tc=xterm: + :mi@:\ + :IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm: # # Compatible with the X11R6.3 xterm xterm-r6|xterm-old|X11R6 xterm:\ + :am:bs:km:mi:ms:pt:xn:\ + :co#80:kn#20:li#24:\ + :*6=\E[4~:@0=\E[1~:@7=\E[4~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\ + :DO=\E[%dB:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:\ + :F5=\E[28~:F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:\ + :FA=\E[34~:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:\ + :as=^N:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:\ + :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:eA=\E)0:ei=\E[4l:\ + :ho=\E[H:im=\E[4h:\ :is=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ - :rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ - :AL=\E[%dL:DL=\E[%dM:DC=\E[%dP:DO=\E[%dB:UP=\E[%dA:\ - :LE=\E[%dD:RI=\E[%dC:al=\E[L:am:bl=^G:\ - :bs:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:co#80:\ - :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:ho=\E[H:\ - :im=\E[4h:ei=\E[4l:mi:ks=\E[?1h\E=:ke=\E[?1l\E>:@7=\E[4~:kh=\E[1~:\ :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\ :k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\ - :F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:F5=\E[28~:\ - :F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:FA=\E[34~:\ - :kn#20:km:@0=\E[1~:kI=\E[2~:kD=^?:*6=\E[4~:kP=\E[5~:kN=\E[6~:\ - :kb=^H:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:\ - :li#24:md=\E[1m:me=\E[m:mr=\E[7m:ms:nd=\E[C:pt:\ - :eA=\E)0:as=^N:ae=^O:ml=\El:mu=\Em:\ - :sc=\E7:rc=\E8:sf=\n:so=\E[7m:se=\E[m:sr=\EM:\ - :ti=\E7\E[?47h:te=\E[2J\E[?47l\E8:up=\E[A:us=\E[4m:ue=\E[m:xn: + :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\EOB:\ + :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ + :ku=\EOA:md=\E[1m:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:\ + :rc=\E8:rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\ + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\ + :ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m: # # Compatible with the R5 xterm xterm-r5|X11R5 xterm X11R5:\ - :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:UP=\E[%dA:\ - :al=\E[L:am:\ - :bs:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:co#80:\ - :cs=\E[%i%d;%dr:ct=\E[3g:\ - :dc=\E[P:dl=\E[M:\ - :im=\E[4h:ei=\E[4l:mi:\ - :ho=\E[H:\ + :am:bs:km:mi:ms:pt:xn:\ + :co#80:kn#4:li#24:\ + :@7=\E[4~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:\ + :IC=\E[%d@:UP=\E[%dA:al=\E[L:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ + :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ + :ei=\E[4l:ho=\E[H:im=\E[4h:\ :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\ + :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:kb=^H:kd=\EOB:\ + :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\ + :ku=\EOA:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:rc=\E8:\ :rs=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H:\ - :k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:kb=^H:kd=\EOB:ke=\E[?1l\E>:\ - :kl=\EOD:km:kn#4:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:\ - :@7=\E[4~:kh=\E[1~:\ - :li#24:md=\E[1m:me=\E[m:mr=\E[7m:ms:nd=\E[C:pt:\ - :sc=\E7:rc=\E8:sf=\n:so=\E[7m:se=\E[m:sr=\EM:\ - :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:\ - :up=\E[A:us=\E[4m:ue=\E[m:xn: + :sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\ + :ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m: +# +# Customization begins here. +xterm-xfree86|xterm terminal emulator (XFree86):\ + :tc=xterm-new: # # This is the only entry which you should have to customize, since "xterm" # is widely used for a variety of incompatible terminal emulations including # color_xterm and rxvt. -xterm|xterm-color|X11 terminal emulator:\ - :ti@:te@:tc=xterm-xfree86: +xterm|X11 terminal emulator:\ + :tc=xterm-new: # :tc=xterm-r6: # dtterm termcap entry - Obtained from Xinside's CDE with permission # from Thomas Roell From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 23:46:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE2E710656A4; Thu, 10 Dec 2009 23:46:37 +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 CC8F48FC19; Thu, 10 Dec 2009 23:46: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 nBANkbBj078444; Thu, 10 Dec 2009 23:46:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBANkbr2078442; Thu, 10 Dec 2009 23:46:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912102346.nBANkbr2078442@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Dec 2009 23:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200372 - stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 23:46:38 -0000 Author: mav Date: Thu Dec 10 23:46:37 2009 New Revision: 200372 URL: http://svn.freebsd.org/changeset/base/200372 Log: MFC r197044: Actually component with the greatest priority is used by the prefer balance algorithm. Modified: stable/8/sbin/geom/class/mirror/gmirror.8 Directory Properties: stable/8/sbin/geom/ (props changed) Modified: stable/8/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- stable/8/sbin/geom/class/mirror/gmirror.8 Thu Dec 10 23:28:54 2009 (r200371) +++ stable/8/sbin/geom/class/mirror/gmirror.8 Thu Dec 10 23:46:37 2009 (r200372) @@ -122,7 +122,7 @@ indicates an action to be performed: Create a mirror. The order of components is important, because a component's priority is based on its position (starting from 0 to 255). -The component with the biggest priority (the lowest number) is used by the +The component with the biggest priority is used by the .Cm prefer balance algorithm and is also used as a master component when resynchronization is needed, From owner-svn-src-all@FreeBSD.ORG Thu Dec 10 23:51:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76BBC1065670; Thu, 10 Dec 2009 23:51:24 +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 4B69F8FC08; Thu, 10 Dec 2009 23:51: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 nBANpO8V078610; Thu, 10 Dec 2009 23:51:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBANpOKc078607; Thu, 10 Dec 2009 23:51:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912102351.nBANpOKc078607@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Dec 2009 23:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200373 - stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2009 23:51:24 -0000 Author: mav Date: Thu Dec 10 23:51:24 2009 New Revision: 200373 URL: http://svn.freebsd.org/changeset/base/200373 Log: MFC r200282, r200290: Change gmirror default balance algorithm from "split" to improved "load". "split" is very ineffective for devices with rotating media as HDDs. To be effective, it needs that transfer time reduction due to block splitting was bigger then access time increase due to non-sequential access. For modern HDDs I was able to reproduce it only with read sizes of 2MB and above, which is almost not applicable in real life. "load" algorithm same time is more universal and effective now. Modified: stable/8/sbin/geom/class/mirror/geom_mirror.c stable/8/sbin/geom/class/mirror/gmirror.8 Directory Properties: stable/8/sbin/geom/ (props changed) Modified: stable/8/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- stable/8/sbin/geom/class/mirror/geom_mirror.c Thu Dec 10 23:46:37 2009 (r200372) +++ stable/8/sbin/geom/class/mirror/geom_mirror.c Thu Dec 10 23:51:24 2009 (r200373) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; -static char label_balance[] = "split", configure_balance[] = "none"; +static char label_balance[] = "load", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; static intmax_t insert_priority = 0, configure_priority = -1; Modified: stable/8/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- stable/8/sbin/geom/class/mirror/gmirror.8 Thu Dec 10 23:46:37 2009 (r200372) +++ stable/8/sbin/geom/class/mirror/gmirror.8 Thu Dec 10 23:51:24 2009 (r200373) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 1, 2009 +.Dd December 8, 2009 .Dt GMIRROR 8 .Os .Sh NAME @@ -135,6 +135,7 @@ Specifies balance algorithm to use, one .Bl -tag -width ".Cm round-robin" .It Cm load Read from the component with the lowest load. +This is the default balance algorithm. .It Cm prefer Read from the component with the biggest priority. .It Cm round-robin @@ -142,7 +143,6 @@ Use round-robin algorithm when choosing .It Cm split Split read requests, which are bigger than or equal to slice size on N pieces, where N is the number of active components. -This is the default balance algorithm. .El .It Fl F Do not synchronize after a power failure or system crash. From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 00:00:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E418106566B; Fri, 11 Dec 2009 00:00:19 +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 D7C3D8FC13; Fri, 11 Dec 2009 00:00: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 nBB00Is9078931; Fri, 11 Dec 2009 00:00:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB00InE078928; Fri, 11 Dec 2009 00:00:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110000.nBB00InE078928@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 00:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200374 - stable/7/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 00:00:19 -0000 Author: mav Date: Fri Dec 11 00:00:18 2009 New Revision: 200374 URL: http://svn.freebsd.org/changeset/base/200374 Log: MFC r200282, r200290: Change gmirror default balance algorithm from "split" to improved "load". "split" is very ineffective for devices with rotating media as HDDs. To be effective, it needs that transfer time reduction due to block splitting was bigger then access time increase due to non-sequential access. For modern HDDs I was able to reproduce it only with read sizes of 2MB and above, which is almost not applicable in real life. "load" algorithm same time is more universal and effective now. Modified: stable/7/sbin/geom/class/mirror/geom_mirror.c stable/7/sbin/geom/class/mirror/gmirror.8 Directory Properties: stable/7/sbin/geom/ (props changed) stable/7/sbin/geom/class/label/ (props changed) stable/7/sbin/geom/class/part/ (props changed) stable/7/sbin/geom/misc/ (props changed) Modified: stable/7/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- stable/7/sbin/geom/class/mirror/geom_mirror.c Thu Dec 10 23:51:24 2009 (r200373) +++ stable/7/sbin/geom/class/mirror/geom_mirror.c Fri Dec 11 00:00:18 2009 (r200374) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_MIRROR_VERSION; -static char label_balance[] = "split", configure_balance[] = "none"; +static char label_balance[] = "load", configure_balance[] = "none"; static intmax_t label_slice = 4096, configure_slice = -1; static intmax_t insert_priority = 0; Modified: stable/7/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- stable/7/sbin/geom/class/mirror/gmirror.8 Thu Dec 10 23:51:24 2009 (r200373) +++ stable/7/sbin/geom/class/mirror/gmirror.8 Fri Dec 11 00:00:18 2009 (r200374) @@ -129,6 +129,7 @@ Specifies balance algorithm to use, one .Bl -tag -width ".Cm round-robin" .It Cm load Read from the component with the lowest load. +This is the default balance algorithm. .It Cm prefer Read from the component with the biggest priority. .It Cm round-robin @@ -136,7 +137,6 @@ Use round-robin algorithm when choosing .It Cm split Split read requests, which are bigger than or equal to slice size on N pieces, where N is the number of active components. -This is the default balance algorithm. .El .It Fl F Do not synchronize after a power failure or system crash. From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 00:38:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F4151065676; Fri, 11 Dec 2009 00:38:14 +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 D8F4E8FC12; Fri, 11 Dec 2009 00:38: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 nBB0cDuj079822; Fri, 11 Dec 2009 00:38:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB0cDBU079820; Fri, 11 Dec 2009 00:38:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110038.nBB0cDBU079820@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 00:38: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: r200375 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 00:38:14 -0000 Author: mav Date: Fri Dec 11 00:38:13 2009 New Revision: 200375 URL: http://svn.freebsd.org/changeset/base/200375 Log: Add one more set of codec IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 00:00:18 2009 (r200374) +++ head/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 00:38:13 2009 (r200375) @@ -610,6 +610,7 @@ static const struct { #define CIRRUSLOGIC_VENDORID 0x1013 #define HDA_CODEC_CS4206 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206) #define HDA_CODEC_CS4207 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207) +#define HDA_CODEC_CSXXXX HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0xffff) /* Realtek */ #define REALTEK_VENDORID 0x10ec @@ -683,7 +684,9 @@ static const struct { #define HDA_CODEC_IDT92HD700D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7639) #define HDA_CODEC_IDT92HD206X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7645) #define HDA_CODEC_IDT92HD206D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7646) +#define HDA_CODEC_CXD9872RDK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7661) #define HDA_CODEC_STAC9872AK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7662) +#define HDA_CODEC_CXD9872AKD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7664) #define HDA_CODEC_STAC9221 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7680) #define HDA_CODEC_STAC922XD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681) #define HDA_CODEC_STAC9221_A2 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7682) @@ -731,6 +734,7 @@ static const struct { #define HDA_CODEC_CX20549 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045) #define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047) #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) +#define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -846,6 +850,8 @@ static const struct { { HDA_CODEC_AD1988B, "Analog Devices AD1988B" }, { HDA_CODEC_AD1989B, "Analog Devices AD1989B" }, { HDA_CODEC_CMI9880, "CMedia CMI9880" }, + { HDA_CODEC_CXD9872RDK, "Sigmatel CXD9872RD/K" }, + { HDA_CODEC_CXD9872AKD, "Sigmatel CXD9872AKD" }, { HDA_CODEC_STAC9200D, "Sigmatel STAC9200D" }, { HDA_CODEC_STAC9204X, "Sigmatel STAC9204X" }, { HDA_CODEC_STAC9204D, "Sigmatel STAC9204D" }, @@ -900,6 +906,7 @@ static const struct { { HDA_CODEC_CX20549, "Conexant CX20549 (Venice)" }, { HDA_CODEC_CX20551, "Conexant CX20551 (Waikiki)" }, { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, + { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -965,6 +972,7 @@ static const struct { /* Unknown codec */ { HDA_CODEC_ALCXXXX, "Realtek (Unknown)" }, { HDA_CODEC_ADXXXX, "Analog Devices (Unknown)" }, + { HDA_CODEC_CSXXXX, "Cirrus Logic (Unknown)" }, { HDA_CODEC_CMIXXXX, "CMedia (Unknown)" }, { HDA_CODEC_STACXXXX, "Sigmatel (Unknown)" }, { HDA_CODEC_SIIXXXX, "Silicon Image (Unknown)" }, From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 00:57:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7838F106566B; Fri, 11 Dec 2009 00:57:30 +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 670BA8FC0C; Fri, 11 Dec 2009 00:57: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 nBB0vU3q080315; Fri, 11 Dec 2009 00:57:30 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB0vU4n080313; Fri, 11 Dec 2009 00:57:30 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912110057.nBB0vU4n080313@svn.freebsd.org> From: Andrew Thompson Date: Fri, 11 Dec 2009 00:57: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: r200376 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 00:57:30 -0000 Author: thompsa Date: Fri Dec 11 00:57:30 2009 New Revision: 200376 URL: http://svn.freebsd.org/changeset/base/200376 Log: Revert r199331, the UM175 is in fact a cdc-acm device handled by umodem(4). Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Dec 11 00:38:13 2009 (r200375) +++ head/sys/dev/usb/serial/u3g.c Fri Dec 11 00:57:30 2009 (r200376) @@ -173,7 +173,6 @@ MODULE_DEPEND(u3g, usb, 1, 1, 1); static const struct usb_device_id u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } - U3G_DEV(CURITEL, UM175, 0), /* OEM: Huawei */ U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:06:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EA26106566B; Fri, 11 Dec 2009 01:06:04 +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 7D2288FC0C; Fri, 11 Dec 2009 01:06:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB1649P080588; Fri, 11 Dec 2009 01:06:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1642S080586; Fri, 11 Dec 2009 01:06:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110106.nBB1642S080586@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 01:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200377 - head/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:06:04 -0000 Author: dougb Date: Fri Dec 11 01:06:04 2009 New Revision: 200377 URL: http://svn.freebsd.org/changeset/base/200377 Log: Update to the December 12, 2008 version of this file. The one substantive change is to add the IPv6 address of L. The other changes are all CAPS LOCK related. Modified: head/etc/namedb/named.root Modified: head/etc/namedb/named.root ============================================================================== --- head/etc/namedb/named.root Fri Dec 11 00:57:30 2009 (r200376) +++ head/etc/namedb/named.root Fri Dec 11 01:06:04 2009 (r200377) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Feb 04, 2008 -; related version of root zone: 2008020400 +; last update: Dec 12, 2008 +; related version of root zone: 2008121200 ; ; formerly NS.INTERNIC.NET ; @@ -22,68 +22,69 @@ A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4 A.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:BA3E::2:30 ; -; formerly NS1.ISI.EDU +; FORMERLY NS1.ISI.EDU ; . 3600000 NS B.ROOT-SERVERS.NET. B.ROOT-SERVERS.NET. 3600000 A 192.228.79.201 ; -; formerly C.PSI.NET +; FORMERLY C.PSI.NET ; . 3600000 NS C.ROOT-SERVERS.NET. C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12 ; -; formerly TERP.UMD.EDU +; FORMERLY TERP.UMD.EDU ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 ; -; formerly NS.NASA.GOV +; FORMERLY NS.NASA.GOV ; . 3600000 NS E.ROOT-SERVERS.NET. E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10 ; -; formerly NS.ISC.ORG +; FORMERLY NS.ISC.ORG ; . 3600000 NS F.ROOT-SERVERS.NET. F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241 -F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2f::f +F.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2F::F ; -; formerly NS.NIC.DDN.MIL +; FORMERLY NS.NIC.DDN.MIL ; . 3600000 NS G.ROOT-SERVERS.NET. G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4 ; -; formerly AOS.ARL.ARMY.MIL +; FORMERLY AOS.ARL.ARMY.MIL ; . 3600000 NS H.ROOT-SERVERS.NET. H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53 -H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803f:235 +H.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:1::803F:235 ; -; formerly NIC.NORDU.NET +; FORMERLY NIC.NORDU.NET ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 ; -; operated by VeriSign, Inc. +; OPERATED BY VERISIGN, INC. ; . 3600000 NS J.ROOT-SERVERS.NET. J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30 J.ROOT-SERVERS.NET. 3600000 AAAA 2001:503:C27::2:30 ; -; operated by RIPE NCC +; OPERATED BY RIPE NCC ; . 3600000 NS K.ROOT-SERVERS.NET. K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129 -K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7fd::1 +K.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FD::1 ; -; operated by ICANN +; OPERATED BY ICANN ; . 3600000 NS L.ROOT-SERVERS.NET. L.ROOT-SERVERS.NET. 3600000 A 199.7.83.42 +L.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:3::42 ; -; operated by WIDE +; OPERATED BY WIDE ; . 3600000 NS M.ROOT-SERVERS.NET. M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33 -M.ROOT-SERVERS.NET. 3600000 AAAA 2001:dc3::35 +M.ROOT-SERVERS.NET. 3600000 AAAA 2001:DC3::35 ; End of File From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:06:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29BD81065741; Fri, 11 Dec 2009 01:06:31 +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 F2B928FC14; Fri, 11 Dec 2009 01:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB16UwV080630; Fri, 11 Dec 2009 01:06:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB16UJK080628; Fri, 11 Dec 2009 01:06:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110106.nBB16UJK080628@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200378 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:06:31 -0000 Author: mav Date: Fri Dec 11 01:06:30 2009 New Revision: 200378 URL: http://svn.freebsd.org/changeset/base/200378 Log: MFC r199846: Add two Cirrus Logic codec IDs. Add GPIO setting quirk for Apple MacBookPro5,5. Submitted by: ed Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:06:04 2009 (r200377) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:06:30 2009 (r200378) @@ -315,6 +315,7 @@ SND_DECLARE_FILE("$FreeBSD$"); * (see HDA_CODEC_STAC9221 below). */ #define APPLE_INTEL_MAC 0x76808384 +#define APPLE_MACBOOKPRO55 0xcb7910de /* LG Electronics */ #define LG_VENDORID 0x1854 @@ -605,6 +606,11 @@ static const struct { #define HDA_CODEC_CONSTRUCT(vendor, id) \ (((uint32_t)(vendor##_VENDORID) << 16) | ((id) & 0xffff)) +/* Cirrus Logic */ +#define CIRRUSLOGIC_VENDORID 0x1013 +#define HDA_CODEC_CS4206 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206) +#define HDA_CODEC_CS4207 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207) + /* Realtek */ #define REALTEK_VENDORID 0x10ec #define HDA_CODEC_ALC260 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260) @@ -804,6 +810,8 @@ static const struct { uint32_t id; char *name; } hdac_codecs[] = { + { HDA_CODEC_CS4206, "Cirrus Logic CS4206" }, + { HDA_CODEC_CS4207, "Cirrus Logic CS4207" }, { HDA_CODEC_ALC260, "Realtek ALC260" }, { HDA_CODEC_ALC262, "Realtek ALC262" }, { HDA_CODEC_ALC267, "Realtek ALC267" }, @@ -4667,6 +4675,8 @@ static const struct { HDA_QUIRK_GPIO0 | HDA_QUIRK_OVREF50, 0}, { APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDA_QUIRK_GPIO0 | HDA_QUIRK_GPIO1, 0 }, + { APPLE_MACBOOKPRO55, HDA_CODEC_CS4206, + HDA_QUIRK_GPIO1 | HDA_QUIRK_GPIO3, 0 }, { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_QUIRK_GPIO0, 0 }, { DELL_V1400_SUBVENDOR, HDA_CODEC_STAC9228X, From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:11:56 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5190106566C; Fri, 11 Dec 2009 01:11:56 +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 79BCD8FC17; Fri, 11 Dec 2009 01:11: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 nBB1BucE080880; Fri, 11 Dec 2009 01:11:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1Bu1H080876; Fri, 11 Dec 2009 01:11:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110111.nBB1Bu1H080876@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200379 - stable/7/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:11:56 -0000 Author: mav Date: Fri Dec 11 01:11:56 2009 New Revision: 200379 URL: http://svn.freebsd.org/changeset/base/200379 Log: MFC r196762: Improve HDA controller capabilities logging. Modified: stable/7/sys/dev/sound/pci/hda/hdac.c stable/7/sys/dev/sound/pci/hda/hdac_private.h stable/7/sys/dev/sound/pci/hda/hdac_reg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:06:30 2009 (r200378) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:11:56 2009 (r200379) @@ -1516,7 +1516,7 @@ hdac_get_capabilities(struct hdac_softc sc->num_iss = HDAC_GCAP_ISS(gcap); sc->num_oss = HDAC_GCAP_OSS(gcap); sc->num_bss = HDAC_GCAP_BSS(gcap); - + sc->num_sdo = HDAC_GCAP_NSDO(gcap); sc->support_64bit = HDA_FLAG_MATCH(gcap, HDAC_GCAP_64OK); corbsize = HDAC_READ_1(&sc->mem, HDAC_CORBSIZE); @@ -1551,11 +1551,12 @@ hdac_get_capabilities(struct hdac_softc return (ENXIO); } - HDA_BOOTHVERBOSE( - device_printf(sc->dev, " CORB size: %d\n", sc->corb_size); - device_printf(sc->dev, " RIRB size: %d\n", sc->rirb_size); - device_printf(sc->dev, " Streams: ISS=%d OSS=%d BSS=%d\n", - sc->num_iss, sc->num_oss, sc->num_bss); + HDA_BOOTVERBOSE( + device_printf(sc->dev, "Caps: OSS %d, ISS %d, BSS %d, " + "NSDO %d%s, CORB %d, RIRB %d\n", + sc->num_oss, sc->num_iss, sc->num_bss, 1 << sc->num_sdo, + sc->support_64bit ? ", 64bit" : "", + sc->corb_size, sc->rirb_size); ); return (0); Modified: stable/7/sys/dev/sound/pci/hda/hdac_private.h ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac_private.h Fri Dec 11 01:06:30 2009 (r200378) +++ stable/7/sys/dev/sound/pci/hda/hdac_private.h Fri Dec 11 01:11:56 2009 (r200379) @@ -339,6 +339,7 @@ struct hdac_softc { int num_iss; int num_oss; int num_bss; + int num_sdo; int support_64bit; int streamcnt; Modified: stable/7/sys/dev/sound/pci/hda/hdac_reg.h ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac_reg.h Fri Dec 11 01:06:30 2009 (r200378) +++ stable/7/sys/dev/sound/pci/hda/hdac_reg.h Fri Dec 11 01:11:56 2009 (r200379) @@ -136,6 +136,8 @@ (((gcap) & HDAC_GCAP_ISS_MASK) >> HDAC_GCAP_ISS_SHIFT) #define HDAC_GCAP_OSS(gcap) \ (((gcap) & HDAC_GCAP_OSS_MASK) >> HDAC_GCAP_OSS_SHIFT) +#define HDAC_GCAP_NSDO(gcap) \ + (((gcap) & HDAC_GCAP_NSDO_MASK) >> HDAC_GCAP_NSDO_SHIFT) /* GCTL - Global Control */ #define HDAC_GCTL_CRST 0x00000001 From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:13:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD344106568B; Fri, 11 Dec 2009 01:13: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 A211A8FC18; Fri, 11 Dec 2009 01:13: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 nBB1DmYK080979; Fri, 11 Dec 2009 01:13:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1DmI6080977; Fri, 11 Dec 2009 01:13:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110113.nBB1DmI6080977@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200380 - stable/7/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:13:48 -0000 Author: mav Date: Fri Dec 11 01:13:48 2009 New Revision: 200380 URL: http://svn.freebsd.org/changeset/base/200380 Log: MFC r197017, r197018 Add Intel 82801JD (one more ICH10) HDA controller ID. Add NVidia MCP89 HDA controller IDs. Modified: stable/7/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:11:56 2009 (r200379) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:13:48 2009 (r200380) @@ -142,7 +142,8 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) #define HDA_INTEL_82801H HDA_MODEL_CONSTRUCT(INTEL, 0x284b) #define HDA_INTEL_82801I HDA_MODEL_CONSTRUCT(INTEL, 0x293e) -#define HDA_INTEL_82801J HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_82801JI HDA_MODEL_CONSTRUCT(INTEL, 0x3a3e) +#define HDA_INTEL_82801JD HDA_MODEL_CONSTRUCT(INTEL, 0x3a6e) #define HDA_INTEL_PCH HDA_MODEL_CONSTRUCT(INTEL, 0x3b56) #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) @@ -167,6 +168,10 @@ SND_DECLARE_FILE("$FreeBSD$"); #define HDA_NVIDIA_MCP79_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac1) #define HDA_NVIDIA_MCP79_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac2) #define HDA_NVIDIA_MCP79_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0ac3) +#define HDA_NVIDIA_MCP89_1 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d94) +#define HDA_NVIDIA_MCP89_2 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d95) +#define HDA_NVIDIA_MCP89_3 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d96) +#define HDA_NVIDIA_MCP89_4 HDA_MODEL_CONSTRUCT(NVIDIA, 0x0d97) #define HDA_NVIDIA_ALL HDA_MODEL_CONSTRUCT(NVIDIA, 0xffff) /* ATI */ @@ -482,7 +487,8 @@ static const struct { { HDA_INTEL_82801G, "Intel 82801G", 0 }, { HDA_INTEL_82801H, "Intel 82801H", 0 }, { HDA_INTEL_82801I, "Intel 82801I", 0 }, - { HDA_INTEL_82801J, "Intel 82801J", 0 }, + { HDA_INTEL_82801JI, "Intel 82801JI", 0 }, + { HDA_INTEL_82801JD, "Intel 82801JD", 0 }, { HDA_INTEL_PCH, "Intel PCH", 0 }, { HDA_INTEL_SCH, "Intel SCH", 0 }, { HDA_NVIDIA_MCP51, "NVidia MCP51", HDAC_NO_MSI }, @@ -503,6 +509,10 @@ static const struct { { HDA_NVIDIA_MCP79_2, "NVidia MCP79", 0 }, { HDA_NVIDIA_MCP79_3, "NVidia MCP79", 0 }, { HDA_NVIDIA_MCP79_4, "NVidia MCP79", 0 }, + { HDA_NVIDIA_MCP89_1, "NVidia MCP89", 0 }, + { HDA_NVIDIA_MCP89_2, "NVidia MCP89", 0 }, + { HDA_NVIDIA_MCP89_3, "NVidia MCP89", 0 }, + { HDA_NVIDIA_MCP89_4, "NVidia MCP89", 0 }, { HDA_ATI_SB450, "ATI SB450", 0 }, { HDA_ATI_SB600, "ATI SB600", 0 }, { HDA_ATI_RS600, "ATI RS600", 0 }, From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:15:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE8DE106566B; Fri, 11 Dec 2009 01:15:53 +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 9BF218FC17; Fri, 11 Dec 2009 01:15: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 nBB1FrSg081082; Fri, 11 Dec 2009 01:15:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1FrVD081079; Fri, 11 Dec 2009 01:15:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110115.nBB1FrVD081079@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:15:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200381 - stable/7/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:15:53 -0000 Author: mav Date: Fri Dec 11 01:15:53 2009 New Revision: 200381 URL: http://svn.freebsd.org/changeset/base/200381 Log: MFC r197611, r197640: Add some bits of HDMI/DisplayPort support from later specification updates. It may be not enough to make them work, but at least should give some information about these beasts. Add Realtek ALC887 codec ID. Modified: stable/7/sys/dev/sound/pci/hda/hda_reg.h stable/7/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sound/pci/hda/hda_reg.h ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hda_reg.h Fri Dec 11 01:13:48 2009 (r200380) +++ stable/7/sys/dev/sound/pci/hda/hda_reg.h Fri Dec 11 01:15:53 2009 (r200381) @@ -660,13 +660,49 @@ #define HDA_CMD_VERB_GET_STRIPE_CONTROL 0xf24 #define HDA_CMD_VERB_SET_STRIPE_CONTROL 0x724 -#define HDA_CMD_SET_STRIPE_CONTROL(cad, nid) \ +#define HDA_CMD_GET_STRIPE_CONTROL(cad, nid) \ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_GET_STRIPE_CONTROL, 0x0)) -#define HDA_CMD_GET_STRIPE_CONTROL(cad, nid, payload) \ +#define HDA_CMD_SET_STRIPE_CONTROL(cad, nid, payload) \ (HDA_CMD_12BIT((cad), (nid), \ HDA_CMD_VERB_SET_STRIPE_CONTROL, (payload))) +/* Channel Count Control */ +#define HDA_CMD_VERB_GET_CONV_CHAN_COUNT 0xf2d +#define HDA_CMD_VERB_SET_CONV_CHAN_COUNT 0x72d + +#define HDA_CMD_GET_CONV_CHAN_COUNT(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_CONV_CHAN_COUNT, 0x0)) +#define HDA_CMD_SET_CONV_CHAN_COUNT(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_CONV_CHAN_COUNT, (payload))) + +#define HDA_CMD_VERB_GET_HDMI_DIP_SIZE 0xf2e +#define HDA_CMD_VERB_GET_HDMI_ELDD 0xf2f + +#define HDA_CMD_VERB_GET_HDMI_DIP_INDEX 0xf30 +#define HDA_CMD_VERB_SET_HDMI_DIP_INDEX 0x730 + +#define HDA_CMD_VERB_GET_HDMI_DIP_DATA 0xf31 +#define HDA_CMD_VERB_SET_HDMI_DIP_DATA 0x731 + +#define HDA_CMD_VERB_GET_HDMI_DIP_XMIT 0xf32 +#define HDA_CMD_VERB_SET_HDMI_DIP_XMIT 0x732 + +#define HDA_CMD_VERB_GET_HDMI_CP_CTRL 0xf33 +#define HDA_CMD_VERB_SET_HDMI_CP_CTRL 0x733 + +#define HDA_CMD_VERB_GET_HDMI_CHAN_SLOT 0xf34 +#define HDA_CMD_VERB_SET_HDMI_CHAN_SLOT 0x734 + +#define HDA_CMD_GET_HDMI_CHAN_SLOT(cad, nid) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_GET_HDMI_CHAN_SLOT, 0x0)) +#define HDA_CMD_SET_HDMI_CHAN_SLOT(cad, nid, payload) \ + (HDA_CMD_12BIT((cad), (nid), \ + HDA_CMD_VERB_SET_HDMI_CHAN_SLOT, (payload))) + /* Function Reset */ #define HDA_CMD_VERB_FUNCTION_RESET 0x7ff @@ -779,6 +815,10 @@ #define HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_SHIFT 20 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_MASK 0x000f0000 #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_SHIFT 16 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_MASK 0x0000e000 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_SHIFT 13 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CP_MASK 0x00001000 +#define HDA_PARAM_AUDIO_WIDGET_CAP_CP_SHIFT 12 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_MASK 0x00000800 #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_SHIFT 11 #define HDA_PARAM_AUDIO_WIDGET_CAP_POWER_CTRL_MASK 0x00000400 @@ -810,6 +850,14 @@ #define HDA_PARAM_AUDIO_WIDGET_CAP_DELAY(param) \ (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_MASK) >> \ HDA_PARAM_AUDIO_WIDGET_CAP_DELAY_SHIFT) +#define HDA_PARAM_AUDIO_WIDGET_CAP_CC(param) \ + ((((param) & HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_MASK) >> \ + (HDA_PARAM_AUDIO_WIDGET_CAP_CC_EXT_SHIFT - 1)) | \ + (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_MASK) >> \ + HDA_PARAM_AUDIO_WIDGET_CAP_STEREO_SHIFT)) +#define HDA_PARAM_AUDIO_WIDGET_CAP_CP(param) \ + (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_CP_MASK) >> \ + HDA_PARAM_AUDIO_WIDGET_CAP_CP_SHIFT) #define HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP(param) \ (((param) & HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_MASK) >> \ HDA_PARAM_AUDIO_WIDGET_CAP_LR_SWAP_SHIFT) @@ -971,6 +1019,10 @@ /* Pin Capabilities */ #define HDA_PARAM_PIN_CAP 0x0c +#define HDA_PARAM_PIN_CAP_HBR_MASK 0x08000000 +#define HDA_PARAM_PIN_CAP_HBR_SHIFT 27 +#define HDA_PARAM_PIN_CAP_DP_MASK 0x01000000 +#define HDA_PARAM_PIN_CAP_DP_SHIFT 24 #define HDA_PARAM_PIN_CAP_EAPD_CAP_MASK 0x00010000 #define HDA_PARAM_PIN_CAP_EAPD_CAP_SHIFT 16 #define HDA_PARAM_PIN_CAP_VREF_CTRL_MASK 0x0000ff00 @@ -985,6 +1037,8 @@ #define HDA_PARAM_PIN_CAP_VREF_CTRL_50_SHIFT 9 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_MASK 0x00000100 #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_SHIFT 8 +#define HDA_PARAM_PIN_CAP_HDMI_MASK 0x00000080 +#define HDA_PARAM_PIN_CAP_HDMI_SHIFT 7 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_MASK 0x00000040 #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_SHIFT 6 #define HDA_PARAM_PIN_CAP_INPUT_CAP_MASK 0x00000020 @@ -1000,6 +1054,12 @@ #define HDA_PARAM_PIN_CAP_IMP_SENSE_CAP_MASK 0x00000001 #define HDA_PARAM_PIN_CAP_IMP_SENSE_CAP_SHIFT 0 +#define HDA_PARAM_PIN_CAP_HBR(param) \ + (((param) & HDA_PARAM_PIN_CAP_HBR_MASK) >> \ + HDA_PARAM_PIN_CAP_HBR_SHIFT) +#define HDA_PARAM_PIN_CAP_DP(param) \ + (((param) & HDA_PARAM_PIN_CAP_DP_MASK) >> \ + HDA_PARAM_PIN_CAP_DP_SHIFT) #define HDA_PARAM_PIN_CAP_EAPD_CAP(param) \ (((param) & HDA_PARAM_PIN_CAP_EAPD_CAP_MASK) >> \ HDA_PARAM_PIN_CAP_EAPD_CAP_SHIFT) @@ -1021,6 +1081,9 @@ #define HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ(param) \ (((param) & HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_MASK) >> \ HDA_PARAM_PIN_CAP_VREF_CTRL_HIZ_SHIFT) +#define HDA_PARAM_PIN_CAP_HDMI(param) \ + (((param) & HDA_PARAM_PIN_CAP_HDMI_MASK) >> \ + HDA_PARAM_PIN_CAP_HDMI_SHIFT) #define HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(param) \ (((param) & HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_MASK) >> \ HDA_PARAM_PIN_CAP_BALANCED_IO_PINS_SHIFT) Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:13:48 2009 (r200380) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:15:53 2009 (r200381) @@ -38,7 +38,6 @@ * 2) HDA Codecs support, which may include * - HDA * - Modem - * - HDMI * 3) Widget parser - the real magic of why this driver works on so * many hardwares with minimal vendor specific quirk. The original * parser was written using Ruby and can be found at @@ -83,7 +82,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090624_0136" +#define HDA_DRV_TEST_REV "20090929_0137" SND_DECLARE_FILE("$FreeBSD$"); @@ -619,6 +618,7 @@ static const struct { #define HDA_CODEC_ALC882 HDA_CODEC_CONSTRUCT(REALTEK, 0x0882) #define HDA_CODEC_ALC883 HDA_CODEC_CONSTRUCT(REALTEK, 0x0883) #define HDA_CODEC_ALC885 HDA_CODEC_CONSTRUCT(REALTEK, 0x0885) +#define HDA_CODEC_ALC887 HDA_CODEC_CONSTRUCT(REALTEK, 0x0887) #define HDA_CODEC_ALC888 HDA_CODEC_CONSTRUCT(REALTEK, 0x0888) #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) @@ -804,6 +804,7 @@ static const struct { { HDA_CODEC_ALC882, "Realtek ALC882" }, { HDA_CODEC_ALC883, "Realtek ALC883" }, { HDA_CODEC_ALC885, "Realtek ALC885" }, + { HDA_CODEC_ALC887, "Realtek ALC887" }, { HDA_CODEC_ALC888, "Realtek ALC888" }, { HDA_CODEC_ALC889, "Realtek ALC889" }, { HDA_CODEC_AD1882, "Analog Devices AD1882" }, @@ -3484,6 +3485,14 @@ hdac_stream_setup(struct hdac_chan *ch) } hdac_command(sc, HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch->io[i], c), cad); +#if 0 + hdac_command(sc, + HDA_CMD_SET_CONV_CHAN_COUNT(cad, ch->io[i], 1), cad); + hdac_command(sc, + HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x00), cad); + hdac_command(sc, + HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch->io[i], 0x11), cad); +#endif chn += HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap) ? 2 : 1; @@ -4491,7 +4500,7 @@ hdac_audio_as_parse(struct hdac_devinfo for (i = 0; i < max; i++) { as[i].hpredir = -1; as[i].chan = -1; - as[i].digital = 1; + as[i].digital = 0; } /* Scan associations skipping as=0. */ @@ -4546,8 +4555,14 @@ hdac_audio_as_parse(struct hdac_devinfo __func__, w->nid, j); as[cnt].enable = 0; } - if (!HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) - as[cnt].digital = 0; + if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { + if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap)) + as[cnt].digital = 3; + else if (HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + as[cnt].digital = 2; + else + as[cnt].digital = 1; + } /* Headphones with seq=15 may mean redirection. */ if (type == HDA_CONFIG_DEFAULTCONF_DEVICE_HP_OUT && seq == 15) @@ -6544,15 +6559,15 @@ hdac_create_pcms(struct hdac_devinfo *de devinfo->function.audio.devs[i].devinfo = devinfo; devinfo->function.audio.devs[i].play = -1; devinfo->function.audio.devs[i].rec = -1; - devinfo->function.audio.devs[i].digital = 2; + devinfo->function.audio.devs[i].digital = 255; } for (i = 0; i < devinfo->function.audio.ascnt; i++) { if (as[i].enable == 0) continue; for (j = 0; j < devinfo->function.audio.num_devs; j++) { - if (devinfo->function.audio.devs[j].digital != 2 && - devinfo->function.audio.devs[j].digital != - as[i].digital) + if (devinfo->function.audio.devs[j].digital != 255 && + (!devinfo->function.audio.devs[j].digital) != + (!as[i].digital)) continue; if (as[i].dir == HDA_CTL_IN) { if (devinfo->function.audio.devs[j].rec >= 0) @@ -6728,6 +6743,8 @@ hdac_dump_pin(struct hdac_softc *sc, str printf(" IN"); if (HDA_PARAM_PIN_CAP_BALANCED_IO_PINS(pincap)) printf(" BAL"); + if (HDA_PARAM_PIN_CAP_HDMI(pincap)) + printf(" HDMI"); if (HDA_PARAM_PIN_CAP_VREF_CTRL(pincap)) { printf(" VREF["); if (HDA_PARAM_PIN_CAP_VREF_CTRL_50(pincap)) @@ -6744,6 +6761,10 @@ hdac_dump_pin(struct hdac_softc *sc, str } if (HDA_PARAM_PIN_CAP_EAPD_CAP(pincap)) printf(" EAPD"); + if (HDA_PARAM_PIN_CAP_DP(pincap)) + printf(" DP"); + if (HDA_PARAM_PIN_CAP_HBR(pincap)) + printf(" HBR"); printf("\n"); device_printf(sc->dev, " Pin config: 0x%08x\n", w->wclass.pin.config); @@ -6851,8 +6872,11 @@ hdac_dump_nodes(struct hdac_devinfo *dev printf(" PROC"); if (HDA_PARAM_AUDIO_WIDGET_CAP_STRIPE(w->param.widget_cap)) printf(" STRIPE"); - if (HDA_PARAM_AUDIO_WIDGET_CAP_STEREO(w->param.widget_cap)) + j = HDA_PARAM_AUDIO_WIDGET_CAP_CC(w->param.widget_cap); + if (j == 1) printf(" STEREO"); + else if (j > 1) + printf(" %dCH", j + 1); printf("\n"); } if (w->bindas != -1) { @@ -7957,7 +7981,9 @@ hdac_pcm_probe(device_t dev) snprintf(buf, sizeof(buf), "HDA %s PCM #%d %s", hdac_codec_name(pdevinfo->devinfo->codec), pdevinfo->index, - pdevinfo->digital?"Digital":"Analog"); + (pdevinfo->digital == 3)?"DisplayPort": + ((pdevinfo->digital == 2)?"HDMI": + ((pdevinfo->digital)?"Digital":"Analog"))); device_set_desc_copy(dev, buf); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:17:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74460106566B; Fri, 11 Dec 2009 01:17:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9A48FC0C; Fri, 11 Dec 2009 01:17: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 nBB1HnME081176; Fri, 11 Dec 2009 01:17:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1Hnif081174; Fri, 11 Dec 2009 01:17:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110117.nBB1Hnif081174@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200382 - stable/7/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:17:49 -0000 Author: mav Date: Fri Dec 11 01:17:49 2009 New Revision: 200382 URL: http://svn.freebsd.org/changeset/base/200382 Log: MFC r199258, r199846: Add more codec IDs. Add two Cirrus Logic codec IDs. Add GPIO setting quirk for Apple MacBookPro5,5. Modified: stable/7/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:15:53 2009 (r200381) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Fri Dec 11 01:17:49 2009 (r200382) @@ -82,7 +82,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090929_0137" +#define HDA_DRV_TEST_REV "20091113_0138" SND_DECLARE_FILE("$FreeBSD$"); @@ -311,6 +311,7 @@ SND_DECLARE_FILE("$FreeBSD$"); * (see HDA_CODEC_STAC9221 below). */ #define APPLE_INTEL_MAC 0x76808384 +#define APPLE_MACBOOKPRO55 0xcb7910de /* LG Electronics */ #define LG_VENDORID 0x1854 @@ -601,6 +602,11 @@ static const struct { #define HDA_CODEC_CONSTRUCT(vendor, id) \ (((uint32_t)(vendor##_VENDORID) << 16) | ((id) & 0xffff)) +/* Cirrus Logic */ +#define CIRRUSLOGIC_VENDORID 0x1013 +#define HDA_CODEC_CS4206 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206) +#define HDA_CODEC_CS4207 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207) + /* Realtek */ #define REALTEK_VENDORID 0x10ec #define HDA_CODEC_ALC260 HDA_CODEC_CONSTRUCT(REALTEK, 0x0260) @@ -760,6 +766,16 @@ static const struct { #define HDA_CODEC_VT1702_5 HDA_CODEC_CONSTRUCT(VIA, 0x5398) #define HDA_CODEC_VT1702_6 HDA_CODEC_CONSTRUCT(VIA, 0x6398) #define HDA_CODEC_VT1702_7 HDA_CODEC_CONSTRUCT(VIA, 0x7398) +#define HDA_CODEC_VT1716S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0433) +#define HDA_CODEC_VT1716S_1 HDA_CODEC_CONSTRUCT(VIA, 0xa721) +#define HDA_CODEC_VT1718S_0 HDA_CODEC_CONSTRUCT(VIA, 0x0428) +#define HDA_CODEC_VT1718S_1 HDA_CODEC_CONSTRUCT(VIA, 0x4428) +#define HDA_CODEC_VT1812 HDA_CODEC_CONSTRUCT(VIA, 0x0448) +#define HDA_CODEC_VT1818S HDA_CODEC_CONSTRUCT(VIA, 0x0440) +#define HDA_CODEC_VT1828S HDA_CODEC_CONSTRUCT(VIA, 0x4441) +#define HDA_CODEC_VT2002P_0 HDA_CODEC_CONSTRUCT(VIA, 0x0438) +#define HDA_CODEC_VT2002P_1 HDA_CODEC_CONSTRUCT(VIA, 0x4438) +#define HDA_CODEC_VT2020 HDA_CODEC_CONSTRUCT(VIA, 0x0441) #define HDA_CODEC_VTXXXX HDA_CODEC_CONSTRUCT(VIA, 0xffff) /* ATI */ @@ -782,6 +798,7 @@ static const struct { #define HDA_CODEC_INTELG45_2 HDA_CODEC_CONSTRUCT(INTEL, 0x2802) #define HDA_CODEC_INTELG45_3 HDA_CODEC_CONSTRUCT(INTEL, 0x2803) #define HDA_CODEC_INTELG45_4 HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) +#define HDA_CODEC_INTELQ57 HDA_CODEC_CONSTRUCT(INTEL, 0x0054) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) /* Codecs */ @@ -789,6 +806,8 @@ static const struct { uint32_t id; char *name; } hdac_codecs[] = { + { HDA_CODEC_CS4206, "Cirrus Logic CS4206" }, + { HDA_CODEC_CS4207, "Cirrus Logic CS4207" }, { HDA_CODEC_ALC260, "Realtek ALC260" }, { HDA_CODEC_ALC262, "Realtek ALC262" }, { HDA_CODEC_ALC267, "Realtek ALC267" }, @@ -913,6 +932,16 @@ static const struct { { HDA_CODEC_VT1702_5, "VIA VT1702_5" }, { HDA_CODEC_VT1702_6, "VIA VT1702_6" }, { HDA_CODEC_VT1702_7, "VIA VT1702_7" }, + { HDA_CODEC_VT1716S_0, "VIA VT1716S_0" }, + { HDA_CODEC_VT1716S_1, "VIA VT1716S_1" }, + { HDA_CODEC_VT1718S_0, "VIA VT1718S_0" }, + { HDA_CODEC_VT1718S_1, "VIA VT1718S_1" }, + { HDA_CODEC_VT1812, "VIA VT1812" }, + { HDA_CODEC_VT1818S, "VIA VT1818S" }, + { HDA_CODEC_VT1828S, "VIA VT1828S" }, + { HDA_CODEC_VT2002P_0, "VIA VT2002P_0" }, + { HDA_CODEC_VT2002P_1, "VIA VT2002P_1" }, + { HDA_CODEC_VT2020, "VIA VT2020" }, { HDA_CODEC_ATIRS600_1,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS600_2,"ATI RS600 HDMI" }, { HDA_CODEC_ATIRS690, "ATI RS690/780 HDMI" }, @@ -926,6 +955,7 @@ static const struct { { HDA_CODEC_INTELG45_2, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_3, "Intel G45 HDMI" }, { HDA_CODEC_INTELG45_4, "Intel G45 HDMI" }, + { HDA_CODEC_INTELQ57, "Intel Q57 HDMI" }, { HDA_CODEC_SII1390, "Silicon Image SiI1390 HDMI" }, { HDA_CODEC_SII1392, "Silicon Image SiI1392 HDMI" }, /* Unknown codec */ @@ -4644,6 +4674,8 @@ static const struct { HDA_QUIRK_GPIO0 | HDA_QUIRK_OVREF50, 0}, { APPLE_INTEL_MAC, HDA_CODEC_STAC9221, HDA_QUIRK_GPIO0 | HDA_QUIRK_GPIO1, 0 }, + { APPLE_MACBOOKPRO55, HDA_CODEC_CS4206, + HDA_QUIRK_GPIO1 | HDA_QUIRK_GPIO3, 0 }, { DELL_D630_SUBVENDOR, HDA_CODEC_STAC9205X, HDA_QUIRK_GPIO0, 0 }, { DELL_V1400_SUBVENDOR, HDA_CODEC_STAC9228X, From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:23:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86D4E106566C; Fri, 11 Dec 2009 01:23:58 +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 728758FC1A; Fri, 11 Dec 2009 01:23: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 nBB1Nwcg081510; Fri, 11 Dec 2009 01:23:58 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1Nw5O081498; Fri, 11 Dec 2009 01:23:58 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110123.nBB1Nw5O081498@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 01:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200383 - in stable/8: contrib/bind9 contrib/bind9/bin/named contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns lib/bind X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:23:58 -0000 Author: dougb Date: Fri Dec 11 01:23:58 2009 New Revision: 200383 URL: http://svn.freebsd.org/changeset/base/200383 Log: MFC r199958: Update to BIND 9.6.1-P2. The vulnerability this is designed to fix is related to DNSSEC validation on a resolving name server that allows access to untrusted users. If your system does not fall into all 3 of these categories you do not need to update immediately. Modified: stable/8/contrib/bind9/CHANGES stable/8/contrib/bind9/bin/named/query.c stable/8/contrib/bind9/lib/dns/api stable/8/contrib/bind9/lib/dns/include/dns/types.h stable/8/contrib/bind9/lib/dns/masterdump.c stable/8/contrib/bind9/lib/dns/rbtdb.c stable/8/contrib/bind9/lib/dns/resolver.c stable/8/contrib/bind9/lib/dns/validator.c stable/8/contrib/bind9/version stable/8/lib/bind/config.h Directory Properties: stable/8/contrib/bind9/ (props changed) stable/8/lib/bind/ (props changed) Modified: stable/8/contrib/bind9/CHANGES ============================================================================== --- stable/8/contrib/bind9/CHANGES Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/CHANGES Fri Dec 11 01:23:58 2009 (r200383) @@ -1,3 +1,9 @@ + --- 9.6.1-P2 released --- + +2772. [security] When validating, track whether pending data was from + the additional section or not and only return it if + validates as secure. [RT #20438] + --- 9.6.1-P1 released --- 2640. [security] A specially crafted update packet will cause named Modified: stable/8/contrib/bind9/bin/named/query.c ============================================================================== --- stable/8/contrib/bind9/bin/named/query.c Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/bin/named/query.c Fri Dec 11 01:23:58 2009 (r200383) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.313.20.7 2009/03/13 01:38:51 marka Exp $ */ +/* $Id: query.c,v 1.313.20.7.12.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -116,6 +116,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + typedef struct client_additionalctx { ns_client_t *client; dns_rdataset_t *rdataset; @@ -1761,8 +1763,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -1801,8 +1803,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -2601,14 +2603,14 @@ query_addbestns(ns_client_t *client) { /* * Attempt to validate RRsets that are pending or that are glue. */ - if ((rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending)) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && - (client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0) + !PENDINGOK(client->query.dboptions)) goto cleanup; - if ((rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue)) && + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && SECURE(client) && WANTDNSSEC(client)) goto cleanup; @@ -3716,6 +3718,8 @@ query_find(ns_client_t *client, dns_fetc dns_rdataset_t *noqname; isc_boolean_t resuming; int line = -1; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -3933,9 +3937,49 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (validate(client, db, fname, rdataset, sigrdataset)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: stable/8/contrib/bind9/lib/dns/api ============================================================================== --- stable/8/contrib/bind9/lib/dns/api Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/lib/dns/api Fri Dec 11 01:23:58 2009 (r200383) @@ -1,3 +1,3 @@ -LIBINTERFACE = 52 +LIBINTERFACE = 53 LIBREVISION = 0 -LIBAGE = 2 +LIBAGE = 0 Modified: stable/8/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- stable/8/contrib/bind9/lib/dns/include/dns/types.h Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/lib/dns/include/dns/types.h Fri Dec 11 01:23:58 2009 (r200383) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.130.50.3 2009/01/29 22:40:35 jinmei Exp $ */ +/* $Id: types.h,v 1.130.50.3.12.1 2009/11/18 23:58:04 marka Exp $ */ #ifndef DNS_TYPES_H #define DNS_TYPES_H 1 @@ -258,40 +258,52 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /*% Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) + + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) /*% Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) /* Received in a referral response. */ - dns_trust_glue = 3, + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) /* Answer from a non-authoritative server */ - dns_trust_answer = 4, + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) /* Answer from an authoritative server */ - dns_trust_authanswer = 6, + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + + /*% * Name checking severities. */ Modified: stable/8/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/masterdump.c Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/lib/dns/masterdump.c Fri Dec 11 01:23:58 2009 (r200383) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.94.50.2 2009/01/18 23:47:40 tbox Exp $ */ +/* $Id: masterdump.c,v 1.94.50.2.12.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -775,7 +775,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: stable/8/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/rbtdb.c Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/lib/dns/rbtdb.c Fri Dec 11 01:23:58 2009 (r200383) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.270.12.6 2009/05/06 23:34:30 jinmei Exp $ */ +/* $Id: rbtdb.c,v 1.270.12.6.10.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -4005,7 +4005,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -4548,7 +4548,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: stable/8/contrib/bind9/lib/dns/resolver.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/resolver.c Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/lib/dns/resolver.c Fri Dec 11 01:23:58 2009 (r200383) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.384.14.14 2009/06/02 23:47:13 tbox Exp $ */ +/* $Id: resolver.c,v 1.384.14.14.8.1 2009/11/18 23:58:04 marka Exp $ */ /*! \file */ @@ -4293,6 +4293,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -4329,12 +4330,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation || !ANSWER(rdataset)) { addedrdataset = ardataset; result = dns_db_addrdataset(fctx->cache, node, @@ -4682,7 +4705,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: stable/8/contrib/bind9/lib/dns/validator.c ============================================================================== --- stable/8/contrib/bind9/lib/dns/validator.c Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/lib/dns/validator.c Fri Dec 11 01:23:58 2009 (r200383) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.164.12.9 2009/05/07 23:47:12 tbox Exp $ */ +/* $Id: validator.c,v 1.164.12.9.8.1 2009/11/18 23:58:04 marka Exp $ */ #include @@ -1607,7 +1607,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1622,7 +1622,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -2243,7 +2243,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -2256,7 +2256,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -3337,7 +3337,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: stable/8/contrib/bind9/version ============================================================================== --- stable/8/contrib/bind9/version Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/contrib/bind9/version Fri Dec 11 01:23:58 2009 (r200383) @@ -1,4 +1,4 @@ -# $Id: version,v 1.43.12.5.8.1 2009/07/28 14:18:08 marka Exp $ +# $Id: version,v 1.43.12.5.8.2 2009/11/18 23:58:04 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=6 PATCHVER=1 RELEASETYPE=-P -RELEASEVER=1 +RELEASEVER=2 Modified: stable/8/lib/bind/config.h ============================================================================== --- stable/8/lib/bind/config.h Fri Dec 11 01:17:49 2009 (r200382) +++ stable/8/lib/bind/config.h Fri Dec 11 01:23:58 2009 (r200383) @@ -277,6 +277,10 @@ int sigwait(const unsigned int *set, int /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + /* Defined if extern char *optarg is not declared. */ /* #undef NEED_OPTARG */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:25:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 651EC1065670; Fri, 11 Dec 2009 01:25:10 +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 535D28FC15; Fri, 11 Dec 2009 01:25: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 nBB1PATQ081604; Fri, 11 Dec 2009 01:25:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1PALt081602; Fri, 11 Dec 2009 01:25:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110125.nBB1PALt081602@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200384 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:25:10 -0000 Author: mav Date: Fri Dec 11 01:25:10 2009 New Revision: 200384 URL: http://svn.freebsd.org/changeset/base/200384 Log: MFC r188512: Fix spelling a bit. Modified: stable/7/share/man/man4/snd_hda.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/snd_hda.4 ============================================================================== --- stable/7/share/man/man4/snd_hda.4 Fri Dec 11 01:23:58 2009 (r200383) +++ stable/7/share/man/man4/snd_hda.4 Fri Dec 11 01:25:10 2009 (r200384) @@ -298,7 +298,7 @@ All codec pins are reversible (could be .Pp So high codec uniformity and flexibility allow driver to configure it in many different ways, depending on requested pins usage decribed by pins configuration. -Driver reports such default pin configuration when verbose messages enabled: +The driver reports such default pin configuration when verbose messages enabled: .Bd -literal hdac0: nid 20 0x01014020 as 2 seq 0 Line-out Jack jack 1 loc 1 color Green misc 0 hdac0: nid 21 0x99130110 as 1 seq 0 Speaker Fixed jack 3 loc 25 color Unknown misc 1 @@ -313,8 +313,8 @@ hdac0: nid 30 0x411111f0 as 15 seq 0 hdac0: nid 31 0x411111f0 as 15 seq 0 Speaker None jack 1 loc 1 color Black misc 1 .Ed .Pp -Here we can see, that the nodes with ID (nid) 25 and 27 are front pannel -connectors (Jack, loc 2), nids 20, 24 and 26 are rear pannel connectors +Here we can see, that the nodes with ID (nid) 25 and 27 are front panel +connectors (Jack, loc 2), nids 20, 24 and 26 are rear panel connectors (Jack, loc 1) and nid 21 is a built-in speaker (Fixed, loc 25). Pins with nids 22, 23, 28, 30 and 31 will be disabled by driver due to "None" connectivity. So the pin count and description matches to connectors that From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:26:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF4021065672; Fri, 11 Dec 2009 01:26:09 +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 BDB2B8FC1D; Fri, 11 Dec 2009 01:26: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 nBB1Q9Vf081667; Fri, 11 Dec 2009 01:26:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1Q9WA081665; Fri, 11 Dec 2009 01:26:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912110126.nBB1Q9WA081665@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 01:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200385 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:26:09 -0000 Author: mav Date: Fri Dec 11 01:26:09 2009 New Revision: 200385 URL: http://svn.freebsd.org/changeset/base/200385 Log: MFC r199247: Remove part that HDMI is not implemented. It had different meaning and confuse users. Extend BUGS section. Add some supported chipsets. Modified: stable/7/share/man/man4/snd_hda.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/snd_hda.4 ============================================================================== --- stable/7/share/man/man4/snd_hda.4 Fri Dec 11 01:25:10 2009 (r200384) +++ stable/7/share/man/man4/snd_hda.4 Fri Dec 11 01:26:09 2009 (r200385) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2009 +.Dd November 13, 2009 .Dt SND_HDA 4 .Os .Sh NAME @@ -59,7 +59,7 @@ driver that allows the generic audio dri to be used with this hardware. Only audio functions are supported by .Nm . -Modem, HDMI and other possible functions are not implemented. +Modem and other possible functions are not implemented. .Pp The .Nm @@ -500,6 +500,14 @@ nVidia MCP68 .It nVidia MCP69 .It +nVidia MCP73 +.It +nVidia MCP78 +.It +nVidia MCP79 +.It +nVidia MCP89 +.It SiS 966 .It VIA VT8251/8237A @@ -626,5 +634,11 @@ trying to fix problem that way, make sur and the PCM audio device you are using really corresponds to expected audio connector. .Pp +Some vendors use non-standardized General Purpose I/O (GPIO) pins of codec +to control external amplifiers. In some cases setting proper combination of +GPIO bits may be needed to make sound work on specific device. +.Pp +HDMI and DisplayPort audio may also require support from video driver. +.Pp Due to OSS limitation multichannel (not multidevice) playback is not supported. From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:26:26 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D130710656A3; Fri, 11 Dec 2009 01:26:26 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFB318FC25; Fri, 11 Dec 2009 01:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB1QQml081708; Fri, 11 Dec 2009 01:26:26 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1QQpm081706; Fri, 11 Dec 2009 01:26:26 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912110126.nBB1QQpm081706@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 11 Dec 2009 01:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200386 - stable/8/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:26:26 -0000 Author: marcel Date: Fri Dec 11 01:26:26 2009 New Revision: 200386 URL: http://svn.freebsd.org/changeset/base/200386 Log: MFC rev 200240: In exception_save, write-back ar.rnat after switching the backing-store. PR: ia64/120315 Modified: stable/8/sys/ia64/ia64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ia64/ia64/exception.S ============================================================================== --- stable/8/sys/ia64/ia64/exception.S Fri Dec 11 01:26:09 2009 (r200385) +++ stable/8/sys/ia64/ia64/exception.S Fri Dec 11 01:26:26 2009 (r200386) @@ -219,43 +219,42 @@ exception_save_restart: (p13) dep r20=r20,r21,0,9 // align dirty registers ;; } - // r20=bspstore, r22=iip, r23=ipsr + // r19=rnat, r20=bspstore, r22=iip, r23=ipsr { .mmi st8 [r31]=r23,16 // psr (p13) mov ar.bspstore=r20 nop 0 ;; } -{ .mmi +{ .mmb +(p13) mov ar.rnat=r19 mov r18=ar.bsp - ;; - mov r19=cr.ifs - sub r18=r18,r20 + nop 0 ;; } { .mmi + mov r19=cr.ifs st8.spill [r30]=gp,16 // gp - st8 [r31]=r18,16 // ndirty - nop 0 + sub r18=r18,r20 ;; } // r19=ifs, r22=iip -{ .mmi +{ .mmb + st8 [r31]=r18,16 // ndirty st8 [r30]=r19,16 // cfm - st8 [r31]=r22,16 // iip nop 0 ;; } { .mmi - st8 [r30]=r17 // ifa mov r18=cr.isr + st8 [r31]=r22,16 // iip add r29=16,r30 ;; } -{ .mmi - st8 [r31]=r18 // isr - add r30=8,r29 - add r31=16,r29 +{ .mmb + st8 [r30]=r17,24 // ifa + st8 [r31]=r18,24 // isr + nop 0 ;; } { .mmi From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:38:30 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5306106566C; Fri, 11 Dec 2009 01:38:30 +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 79C568FC0A; Fri, 11 Dec 2009 01:38: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 nBB1cU8O082022; Fri, 11 Dec 2009 01:38:30 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1cUDw082012; Fri, 11 Dec 2009 01:38:30 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110138.nBB1cUDw082012@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 01:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200387 - in vendor/bind9/dist-9.4: . bin/named lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:38:30 -0000 Author: dougb Date: Fri Dec 11 01:38:30 2009 New Revision: 200387 URL: http://svn.freebsd.org/changeset/base/200387 Log: Vendor import of BIND 9.4.3-P4 Modified: vendor/bind9/dist-9.4/CHANGES vendor/bind9/dist-9.4/bin/named/query.c vendor/bind9/dist-9.4/lib/dns/api vendor/bind9/dist-9.4/lib/dns/include/dns/types.h vendor/bind9/dist-9.4/lib/dns/masterdump.c vendor/bind9/dist-9.4/lib/dns/rbtdb.c vendor/bind9/dist-9.4/lib/dns/resolver.c vendor/bind9/dist-9.4/lib/dns/validator.c vendor/bind9/dist-9.4/version Modified: vendor/bind9/dist-9.4/CHANGES ============================================================================== --- vendor/bind9/dist-9.4/CHANGES Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/CHANGES Fri Dec 11 01:38:30 2009 (r200387) @@ -1,3 +1,9 @@ + --- 9.4.3-P4 released --- + +2772. [security] When validating, track whether pending data was from + the additional section or not and only return it if + validates as secure. [RT #20438] + --- 9.4.3-P3 released --- 2640. [security] A specially crafted update packet will cause named Modified: vendor/bind9/dist-9.4/bin/named/query.c ============================================================================== --- vendor/bind9/dist-9.4/bin/named/query.c Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/bin/named/query.c Fri Dec 11 01:38:30 2009 (r200387) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.257.18.46 2008/10/15 22:33:01 marka Exp $ */ +/* $Id: query.c,v 1.257.18.46.2.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -109,6 +109,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + typedef struct client_additionalctx { ns_client_t *client; dns_rdataset_t *rdataset; @@ -1721,8 +1723,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -1761,8 +1763,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -2547,14 +2549,14 @@ query_addbestns(ns_client_t *client) { /* * Attempt to validate RRsets that are pending or that are glue. */ - if ((rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending)) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && - (client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0) + !PENDINGOK(client->query.dboptions)) goto cleanup; - if ((rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue)) && + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && SECURE(client) && WANTDNSSEC(client)) goto cleanup; @@ -3344,6 +3346,8 @@ query_find(ns_client_t *client, dns_fetc isc_boolean_t empty_wild; dns_rdataset_t *noqname; isc_boolean_t resuming; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -3555,9 +3559,49 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (validate(client, db, fname, rdataset, sigrdataset)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: vendor/bind9/dist-9.4/lib/dns/api ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/api Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/lib/dns/api Fri Dec 11 01:38:30 2009 (r200387) @@ -1,3 +1,3 @@ -LIBINTERFACE = 36 -LIBREVISION = 2 +LIBINTERFACE = 38 +LIBREVISION = 0 LIBAGE = 0 Modified: vendor/bind9/dist-9.4/lib/dns/include/dns/types.h ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/include/dns/types.h Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/lib/dns/include/dns/types.h Fri Dec 11 01:38:30 2009 (r200387) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.109.18.12 2006/05/02 12:55:31 shane Exp $ */ +/* $Id: types.h,v 1.109.18.12.68.1 2009/11/19 00:25:18 marka Exp $ */ #ifndef DNS_TYPES_H #define DNS_TYPES_H 1 @@ -241,40 +241,52 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /*% Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) - + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) + + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) + /*% Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) - - /* Received in a referral response. */ - dns_trust_glue = 3, + + /* Received in a referral response. */ + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) - - /* Answser from a non-authoritative server */ - dns_trust_answer = 4, + + /* Answer from a non-authoritative server */ + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) - + /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) - /* Answser from an authoritative server */ - dns_trust_authanswer = 6, + /* Answer from an authoritative server */ + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) - - /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + + /* Successfully DNSSEC validated */ + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + + /*% * Name checking severites. */ Modified: vendor/bind9/dist-9.4/lib/dns/masterdump.c ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/masterdump.c Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/lib/dns/masterdump.c Fri Dec 11 01:38:30 2009 (r200387) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.73.18.16 2008/08/13 23:46:04 tbox Exp $ */ +/* $Id: masterdump.c,v 1.73.18.16.2.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -774,7 +774,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: vendor/bind9/dist-9.4/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/rbtdb.c Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/lib/dns/rbtdb.c Fri Dec 11 01:38:30 2009 (r200387) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.196.18.53 2008/01/31 23:46:05 tbox Exp $ */ +/* $Id: rbtdb.c,v 1.196.18.53.4.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -3072,7 +3072,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -3586,7 +3586,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: vendor/bind9/dist-9.4/lib/dns/resolver.c ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/resolver.c Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/lib/dns/resolver.c Fri Dec 11 01:38:30 2009 (r200387) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.284.18.79 2008/10/17 22:02:13 jinmei Exp $ */ +/* $Id: resolver.c,v 1.284.18.79.2.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -3887,6 +3887,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -3923,12 +3924,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation) addedrdataset = ardataset; else @@ -4276,7 +4299,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: vendor/bind9/dist-9.4/lib/dns/validator.c ============================================================================== --- vendor/bind9/dist-9.4/lib/dns/validator.c Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/lib/dns/validator.c Fri Dec 11 01:38:30 2009 (r200387) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.119.18.41.2.1 2009/03/17 02:23:49 marka Exp $ */ +/* $Id: validator.c,v 1.119.18.41.2.2 2009/11/19 00:25:18 marka Exp $ */ /*! \file */ @@ -1174,7 +1174,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1189,7 +1189,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -1805,7 +1805,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -1818,7 +1818,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -2667,7 +2667,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: vendor/bind9/dist-9.4/version ============================================================================== --- vendor/bind9/dist-9.4/version Fri Dec 11 01:26:26 2009 (r200386) +++ vendor/bind9/dist-9.4/version Fri Dec 11 01:38:30 2009 (r200387) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.23.2.3 2009/07/28 13:57:27 marka Exp $ +# $Id: version,v 1.29.134.23.2.4 2009/11/19 00:25:17 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=3 +RELEASEVER=4 From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:39:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5AC71065692; Fri, 11 Dec 2009 01:39:28 +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 89FF18FC08; Fri, 11 Dec 2009 01:39: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 nBB1dSYD082079; Fri, 11 Dec 2009 01:39:28 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB1dSwZ082078; Fri, 11 Dec 2009 01:39:28 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110139.nBB1dSwZ082078@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 01:39:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200388 - vendor/bind9/9.4.3-P4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:39:28 -0000 Author: dougb Date: Fri Dec 11 01:39:28 2009 New Revision: 200388 URL: http://svn.freebsd.org/changeset/base/200388 Log: Tag the 9.4.3-P4 release Added: vendor/bind9/9.4.3-P4/ - copied from r200387, vendor/bind9/dist-9.4/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 01:47:37 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55628106566B; Fri, 11 Dec 2009 01:47:37 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 15EEE8FC14; Fri, 11 Dec 2009 01:47:36 +0000 (UTC) Received: from [192.168.1.38] (S0106005004e13421.vs.shawcable.net [70.71.167.197]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id nBB1lYYd018094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Dec 2009 17:47:35 -0800 (PST) (envelope-from sobomax@FreeBSD.org) Message-ID: <4B21A4B9.3070005@FreeBSD.org> Date: Thu, 10 Dec 2009 17:47:37 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Alexander Motin References: <200912102351.nBANpOKc078607@svn.freebsd.org> In-Reply-To: <200912102351.nBANpOKc078607@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn: stable/8/sbin/geom/class/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 01:47:37 -0000 Alexander Motin wrote: > Author: mav > Date: Thu Dec 10 23:51:24 2009 > New Revision: 200373 > URL: http://svn.freebsd.org/changeset/base/200373 > > Log: > MFC r200282, r200290: > Change gmirror default balance algorithm from "split" to improved "load". > "split" is very ineffective for devices with rotating media as HDDs. > To be effective, it needs that transfer time reduction due to block > splitting was bigger then access time increase due to non-sequential > access. For modern HDDs I was able to reproduce it only with read sizes > of 2MB and above, which is almost not applicable in real life. > "load" algorithm same time is more universal and effective now. The other problem with real hard drives is that they usually read much more data than requested. Some suggest that they read as much as one track each time the data is not in cache even if one sector has been requested, therefore splitting request of any reasonable size is meaningless, as it would simply cause both drives to load essentially the same data, wasting half of available I/O bandwidth and in addition you cause both heads to do seek, which makes it even worse. -Maxim From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:00:18 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA3ED106566B; Fri, 11 Dec 2009 02:00:18 +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 7F2D98FC15; Fri, 11 Dec 2009 02:00: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 nBB20IwJ082584; Fri, 11 Dec 2009 02:00:18 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB20I14082583; Fri, 11 Dec 2009 02:00:18 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110200.nBB20I14082583@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 02:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200389 - in stable/7/contrib/bind9: . lib/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:00:18 -0000 Author: dougb Date: Fri Dec 11 02:00:18 2009 New Revision: 200389 URL: http://svn.freebsd.org/changeset/base/200389 Log: The mergeinfo on these 3 files has already been committed to contrib/bind9, so remove it from the individual files. Modified: Directory Properties: stable/7/contrib/bind9/CHANGES (props changed) stable/7/contrib/bind9/lib/dns/validator.c (props changed) stable/7/contrib/bind9/version (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:06:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A6BA106566C; Fri, 11 Dec 2009 02:06:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 796FD8FC12; Fri, 11 Dec 2009 02:06: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 nBB266MS082740; Fri, 11 Dec 2009 02:06:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB2665b082738; Fri, 11 Dec 2009 02:06:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912110206.nBB2665b082738@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 02:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200390 - vendor/expat/dist/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:06:06 -0000 Author: delphij Date: Fri Dec 11 02:06:06 2009 New Revision: 200390 URL: http://svn.freebsd.org/changeset/base/200390 Log: Apply a vendor fix (rev 1.165): Don't update next pointer since it could confuse tokenizer. Obtained from: expat CVS Security: CVE-2009-3720 Modified: vendor/expat/dist/lib/xmlparse.c Modified: vendor/expat/dist/lib/xmlparse.c ============================================================================== --- vendor/expat/dist/lib/xmlparse.c Fri Dec 11 02:00:18 2009 (r200389) +++ vendor/expat/dist/lib/xmlparse.c Fri Dec 11 02:06:06 2009 (r200390) @@ -3725,7 +3725,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:07:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73391106568B; Fri, 11 Dec 2009 02:07:21 +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 5F87A8FC08; Fri, 11 Dec 2009 02:07: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 nBB27LXK082804; Fri, 11 Dec 2009 02:07:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB27L7K082795; Fri, 11 Dec 2009 02:07:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912110207.nBB27L7K082795@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 02:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200391 - in vendor/expat/2.0.1_1: . contrib doc examples lib tests xmlwf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:07:21 -0000 Author: delphij Date: Fri Dec 11 02:07:21 2009 New Revision: 200391 URL: http://svn.freebsd.org/changeset/base/200391 Log: Tag the patched version as 2.0.1_1. Added: vendor/expat/2.0.1_1/ - copied from r200363, vendor/expat/dist/ vendor/expat/2.0.1_1/COPYING - copied unchanged from r200365, vendor/expat/dist/COPYING vendor/expat/2.0.1_1/Changes - copied unchanged from r200365, vendor/expat/dist/Changes vendor/expat/2.0.1_1/FREEBSD-upgrade - copied unchanged from r200365, vendor/expat/dist/FREEBSD-upgrade vendor/expat/2.0.1_1/MANIFEST - copied unchanged from r200365, vendor/expat/dist/MANIFEST vendor/expat/2.0.1_1/Makefile.in - copied unchanged from r200365, vendor/expat/dist/Makefile.in vendor/expat/2.0.1_1/README - copied unchanged from r200365, vendor/expat/dist/README vendor/expat/2.0.1_1/configure - copied unchanged from r200365, vendor/expat/dist/configure vendor/expat/2.0.1_1/configure.in - copied unchanged from r200365, vendor/expat/dist/configure.in vendor/expat/2.0.1_1/doc/ - copied from r200365, vendor/expat/dist/doc/ vendor/expat/2.0.1_1/examples/ - copied from r200365, vendor/expat/dist/examples/ vendor/expat/2.0.1_1/expat_config.h.in - copied unchanged from r200365, vendor/expat/dist/expat_config.h.in vendor/expat/2.0.1_1/lib/ - copied from r200365, vendor/expat/dist/lib/ vendor/expat/2.0.1_1/tests/ - copied from r200365, vendor/expat/dist/tests/ vendor/expat/2.0.1_1/xmlwf/ - copied from r200365, vendor/expat/dist/xmlwf/ Replaced: vendor/expat/2.0.1_1/lib/xmlparse.c - copied unchanged from r200390, vendor/expat/dist/lib/xmlparse.c vendor/expat/2.0.1_1/lib/xmltok_impl.c - copied unchanged from r200368, vendor/expat/dist/lib/xmltok_impl.c Deleted: vendor/expat/2.0.1_1/contrib/ Copied: vendor/expat/2.0.1_1/COPYING (from r200365, vendor/expat/dist/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/COPYING Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/COPYING) @@ -0,0 +1,22 @@ +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Copied: vendor/expat/2.0.1_1/Changes (from r200365, vendor/expat/dist/Changes) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/Changes Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/Changes) @@ -0,0 +1,169 @@ +Release 2.0.1 Tue June 5 2007 + - Fixed bugs #1515266, 1515600: The character data handler's calling + of XML_StopParser() was not handled properly; if the parser was + stopped and the handler set to NULL, the parser would segfault. + - Fixed bug #1690883: Expat failed on EBCDIC systems as it assumed + some character constants to be ASCII encoded. + - Minor cleanups of the test harness. + - Fixed xmlwf bug #1513566: "out of memory" error on file size zero. + - Fixed outline.c bug #1543233: missing a final XML_ParserFree() call. + - Fixes and improvements for Windows platform: + bugs #1409451, #1476160, 1548182, 1602769, 1717322. + - Build fixes for various platforms: + HP-UX, Tru64, Solaris 9: patch #1437840, bug #1196180. + All Unix: #1554618 (refreshed config.sub/config.guess). + #1490371, #1613457: support both, DESTDIR and INSTALL_ROOT, + without relying on GNU-Make specific features. + #1647805: Patched configure.in to work better with Intel compiler. + - Fixes to Makefile.in to have make check work correctly: + bugs #1408143, #1535603, #1536684. + - Added Open Watcom support: patch #1523242. + +Release 2.0.0 Wed Jan 11 2006 + - We no longer use the "check" library for C unit testing; we + always use the (partial) internal implementation of the API. + - Report XML_NS setting via XML_GetFeatureList(). + - Fixed headers for use from C++. + - XML_GetCurrentLineNumber() and XML_GetCurrentColumnNumber() + now return unsigned integers. + - Added XML_LARGE_SIZE switch to enable 64-bit integers for + byte indexes and line/column numbers. + - Updated to use libtool 1.5.22 (the most recent). + - Added support for AmigaOS. + - Some mostly minor bug fixes. SF issues include: 1006708, + 1021776, 1023646, 1114960, 1156398, 1221160, 1271642. + +Release 1.95.8 Fri Jul 23 2004 + - Major new feature: suspend/resume. Handlers can now request + that a parse be suspended for later resumption or aborted + altogether. See "Temporarily Stopping Parsing" in the + documentation for more details. + - Some mostly minor bug fixes, but compilation should no + longer generate warnings on most platforms. SF issues + include: 827319, 840173, 846309, 888329, 896188, 923913, + 928113, 961698, 985192. + +Release 1.95.7 Mon Oct 20 2003 + - Fixed enum XML_Status issue (reported on SourceForge many + times), so compilers that are properly picky will be happy. + - Introduced an XMLCALL macro to control the calling + convention used by the Expat API; this macro should be used + to annotate prototypes and definitions of callback + implementations in code compiled with a calling convention + other than the default convention for the host platform. + - Improved ability to build without the configure-generated + expat_config.h header. This is useful for applications + which embed Expat rather than linking in the library. + - Fixed a variety of bugs: see SF issues 458907, 609603, + 676844, 679754, 692878, 692964, 695401, 699323, 699487, + 820946. + - Improved hash table lookups. + - Added more regression tests and improved documentation. + +Release 1.95.6 Tue Jan 28 2003 + - Added XML_FreeContentModel(). + - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). + - Fixed a variety of bugs: see SF issues 615606, 616863, + 618199, 653180, 673791. + - Enhanced the regression test suite. + - Man page improvements: includes SF issue 632146. + +Release 1.95.5 Fri Sep 6 2002 + - Added XML_UseForeignDTD() for improved SAX2 support. + - Added XML_GetFeatureList(). + - Defined XML_Bool type and the values XML_TRUE and XML_FALSE. + - Use an incomplete struct instead of a void* for the parser + (may not retain). + - Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected. + - Finally fixed bug where default handler would report DTD + events that were already handled by another handler. + Initial patch contributed by Darryl Miles. + - Removed unnecessary DllMain() function that caused static + linking into a DLL to be difficult. + - Added VC++ projects for building static libraries. + - Reduced line-length for all source code and headers to be + no longer than 80 characters, to help with AS/400 support. + - Reduced memory copying during parsing (SF patch #600964). + - Fixed a variety of bugs: see SF issues 580793, 434664, + 483514, 580503, 581069, 584041, 584183, 584832, 585537, + 596555, 596678, 598352, 598944, 599715, 600479, 600971. + +Release 1.95.4 Fri Jul 12 2002 + - Added support for VMS, contributed by Craig Berry. See + vms/README.vms for more information. + - Added Mac OS (classic) support, with a makefile for MPW, + contributed by Thomas Wegner and Daryle Walker. + - Added Borland C++ Builder 5 / BCC 5.5 support, contributed + by Patrick McConnell (SF patch #538032). + - Fixed a variety of bugs: see SF issues 441449, 563184, + 564342, 566334, 566901, 569461, 570263, 575168, 579196. + - Made skippedEntityHandler conform to SAX2 (see source comment) + - Re-implemented WFC: Entity Declared from XML 1.0 spec and + added a new error "entity declared in parameter entity": + see SF bug report 569461 and SF patch 578161 + - Re-implemented section 5.1 from XML 1.0 spec: + see SF bug report 570263 and SF patch 578161 + +Release 1.95.3 Mon Jun 3 2002 + - Added a project to the MSVC workspace to create a wchar_t + version of the library; the DLLs are named libexpatw.dll. + - Changed the name of the Windows DLLs from expat.dll to + libexpat.dll; this fixes SF bug #432456. + - Added the XML_ParserReset() API function. + - Fixed XML_SetReturnNSTriplet() to work for element names. + - Made the XML_UNICODE builds usable (thanks, Karl!). + - Allow xmlwf to read from standard input. + - Install a man page for xmlwf on Unix systems. + - Fixed many bugs; see SF bug reports 231864, 461380, 464837, + 466885, 469226, 477667, 484419, 487840, 494749, 496505, + 547350. Other bugs which we can't test as easily may also + have been fixed, especially in the area of build support. + +Release 1.95.2 Fri Jul 27 2001 + - More changes to make MSVC happy with the build; add a single + workspace to support both the library and xmlwf application. + - Added a Windows installer for Windows users; includes + xmlwf.exe. + - Added compile-time constants that can be used to determine the + Expat version + - Removed a lot of GNU-specific dependencies to aide portability + among the various Unix flavors. + - Fix the UTF-8 BOM bug. + - Cleaned up warning messages for several compilers. + - Added the -Wall, -Wstrict-prototypes options for GCC. + +Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000 + - Changes to get expat to build under Microsoft compiler + - Removed all aborts and instead return an UNEXPECTED_STATE error. + - Fixed a bug where a stray '%' in an entity value would cause an + abort. + - Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for + finding this oversight. + - Changed default patterns in lib/Makefile.in to fit non-GNU makes + Thanks to robin@unrated.net for reporting and providing an + account to test on. + - The reference had the wrong label for XML_SetStartNamespaceDecl. + Reported by an anonymous user. + +Release 1.95.0 Fri Sep 29 2000 + - XML_ParserCreate_MM + Allows you to set a memory management suite to replace the + standard malloc,realloc, and free. + - XML_SetReturnNSTriplet + If you turn this feature on when namespace processing is in + effect, then qualified, prefixed element and attribute names + are returned as "uri|name|prefix" where '|' is whatever + separator character is used in namespace processing. + - Merged in features from perl-expat + o XML_SetElementDeclHandler + o XML_SetAttlistDeclHandler + o XML_SetXmlDeclHandler + o XML_SetEntityDeclHandler + o StartDoctypeDeclHandler takes 3 additional parameters: + sysid, pubid, has_internal_subset + o Many paired handler setters (like XML_SetElementHandler) + now have corresponding individual handler setters + o XML_GetInputContext for getting the input context of + the current parse position. + - Added reference material + - Packaged into a distribution that builds a sharable library Copied: vendor/expat/2.0.1_1/FREEBSD-upgrade (from r200365, vendor/expat/dist/FREEBSD-upgrade) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/FREEBSD-upgrade Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/FREEBSD-upgrade) @@ -0,0 +1,16 @@ +$FreeBSD$ + +eXpat from www.libexpat.org + +Imported by: + + tar zxvf expat-1.95.5.tar.gz + cd expat-1.95.5 + rm -rf bcb5 win32 vms conftools doc/valid-xhtml10.png + vi FREEBSD-upgrade + cvs import -m "Virgin import (trimmed) of eXpat version 1.95.5" \ + src/contrib/expat EXPAT v1_95_5 + +phk@FreeBSD.org + + Copied: vendor/expat/2.0.1_1/MANIFEST (from r200365, vendor/expat/dist/MANIFEST) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/MANIFEST Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/MANIFEST) @@ -0,0 +1,128 @@ +amiga/stdlib.c +amiga/launch.c +amiga/expat_vectors.c +amiga/expat_lib.c +amiga/expat.xml +amiga/README.txt +amiga/Makefile +amiga/include/proto/expat.h +amiga/include/libraries/expat.h +amiga/include/interfaces/expat.h +amiga/include/inline4/expat.h +bcb5/README.txt +bcb5/all_projects.bpg +bcb5/elements.bpf +bcb5/elements.bpr +bcb5/elements.mak +bcb5/expat.bpf +bcb5/expat.bpr +bcb5/expat.mak +bcb5/expat_static.bpf +bcb5/expat_static.bpr +bcb5/expat_static.mak +bcb5/expatw.bpf +bcb5/expatw.bpr +bcb5/expatw.mak +bcb5/expatw_static.bpf +bcb5/expatw_static.bpr +bcb5/expatw_static.mak +bcb5/libexpat_mtd.def +bcb5/libexpatw_mtd.def +bcb5/makefile.mak +bcb5/outline.bpf +bcb5/outline.bpr +bcb5/outline.mak +bcb5/setup.bat +bcb5/xmlwf.bpf +bcb5/xmlwf.bpr +bcb5/xmlwf.mak +doc/expat.png +doc/reference.html +doc/style.css +doc/valid-xhtml10.png +doc/xmlwf.1 +doc/xmlwf.sgml +COPYING +Changes +MANIFEST +Makefile.in +README +configure +configure.in +expat_config.h.in +expat.dsw +conftools/PrintPath +conftools/ac_c_bigendian_cross.m4 +conftools/config.guess +conftools/config.sub +conftools/expat.m4 +conftools/get-version.sh +conftools/install-sh +conftools/libtool.m4 +conftools/ltmain.sh +conftools/mkinstalldirs +examples/elements.c +examples/elements.dsp +examples/outline.c +examples/outline.dsp +lib/Makefile.MPW +lib/amigaconfig.h +lib/ascii.h +lib/asciitab.h +lib/expat.dsp +lib/expat.h +lib/expat_external.h +lib/expat_static.dsp +lib/expatw.dsp +lib/expatw_static.dsp +lib/iasciitab.h +lib/internal.h +lib/latin1tab.h +lib/libexpat.def +lib/libexpatw.def +lib/macconfig.h +lib/nametab.h +lib/utf8tab.h +lib/winconfig.h +lib/xmlparse.c +lib/xmlrole.c +lib/xmlrole.h +lib/xmltok.c +lib/xmltok.h +lib/xmltok_impl.c +lib/xmltok_impl.h +lib/xmltok_ns.c +tests/benchmark/README.txt +tests/benchmark/benchmark.c +tests/benchmark/benchmark.dsp +tests/benchmark/benchmark.dsw +tests/README.txt +tests/chardata.c +tests/chardata.h +tests/minicheck.c +tests/minicheck.h +tests/runtests.c +tests/runtestspp.cpp +tests/xmltest.sh +vms/README.vms +vms/descrip.mms +vms/expat_config.h +win32/MANIFEST.txt +win32/README.txt +win32/expat.iss +xmlwf/codepage.c +xmlwf/codepage.h +xmlwf/ct.c +xmlwf/filemap.h +xmlwf/readfilemap.c +xmlwf/unixfilemap.c +xmlwf/win32filemap.c +xmlwf/xmlfile.c +xmlwf/xmlfile.h +xmlwf/xmlmime.c +xmlwf/xmlmime.h +xmlwf/xmltchar.h +xmlwf/xmlurl.h +xmlwf/xmlwf.c +xmlwf/xmlwf.dsp +xmlwf/xmlwin32url.cxx Copied: vendor/expat/2.0.1_1/Makefile.in (from r200365, vendor/expat/dist/Makefile.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/Makefile.in Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/Makefile.in) @@ -0,0 +1,187 @@ +################################################################ +# Process this file with top-level configure script to produce Makefile +# +# Copyright 2000 Clark Cooper +# +# This file is part of EXPAT. +# +# EXPAT is free software; you can redistribute it and/or modify it +# under the terms of the License (based on the MIT/X license) contained +# in the file COPYING that comes with this distribution. +# +# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. +# + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +man1dir = @mandir@/man1 + +top_builddir = . + + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs + +MANFILE = $(srcdir)/doc/xmlwf.1 +APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h +LIBRARY = libexpat.la + +DESTDIR = $(INSTALL_ROOT) + +default: buildlib xmlwf/xmlwf + +buildlib: $(LIBRARY) + +all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline + +clean: + cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs + cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs + cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs + cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o + cd tests && rm -f chardata.o minicheck.o + rm -rf .libs libexpat.la + rm -f examples/core tests/core xmlwf/core + +clobber: clean + +distclean: clean + rm -f expat_config.h config.status config.log config.cache libtool + rm -f Makefile + +extraclean: distclean + rm -f expat_config.h.in configure + rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 + +check: tests/runtests tests/runtestspp + tests/runtests + tests/runtestspp + +install: xmlwf/xmlwf installlib + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf + $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) + +installlib: $(LIBRARY) $(APIHEADER) + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) + $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) + for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done + +uninstall: uninstalllib + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf + rm -f $(DESTDIR)$(man1dir)/xmlwf.1 + +uninstalllib: + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) + rm -f $(DESTDIR)$(includedir)/expat.h + rm -f $(DESTDIR)$(includedir)/expat_external.h + +# for VPATH builds (invoked by configure) +mkdir-init: + @for d in lib xmlwf examples tests ; do \ + (mkdir $$d 2> /dev/null || test 1) ; \ + done + +CC = @CC@ +CXX = @CXX@ +LIBTOOL = @LIBTOOL@ + +INCLUDES = -I$(srcdir)/lib -I. +LDFLAGS = @LDFLAGS@ +CPPFLAGS = @CPPFLAGS@ -DHAVE_EXPAT_CONFIG_H +CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ +VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ + +### autoconf this? +LTFLAGS = --silent + +COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS) +CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS) +LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) +LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ +LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ +LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@ + +LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo +$(LIBRARY): $(LIB_OBJS) + $(LINK_LIB) $(LIB_OBJS) + +lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ + $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h + +lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ + $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h + +lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ + lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ + lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ + $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h + + +XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o +xmlwf/xmlwf.o: xmlwf/xmlwf.c +xmlwf/xmlfile.o: xmlwf/xmlfile.c +xmlwf/codepage.o: xmlwf/codepage.c +xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c +xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) + $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) + +examples/elements.o: examples/elements.c +examples/elements: examples/elements.o $(LIBRARY) + $(LINK_EXE) $< $(LIBRARY) + +examples/outline.o: examples/outline.c +examples/outline: examples/outline.o $(LIBRARY) + $(LINK_EXE) $< $(LIBRARY) + +tests/chardata.o: tests/chardata.c tests/chardata.h +tests/minicheck.o: tests/minicheck.c tests/minicheck.h +tests/runtests.o: tests/runtests.c tests/chardata.h +tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY) + $(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY) +tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h +tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY) + $(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY) + +tests/xmlts.zip: + wget --output-document=tests/xmlts.zip \ + http://www.w3.org/XML/Test/xmlts20020606.zip + +tests/XML-Test-Suite: tests/xmlts.zip + cd tests && unzip -q xmlts.zip + +run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite + tests/xmltest.sh + +.SUFFIXES: .c .cpp .lo .o + +.cpp.o: + $(CXXCOMPILE) -o $@ -c $< +.c.o: + $(COMPILE) -o $@ -c $< +.c.lo: + $(LTCOMPILE) -o $@ -c $< + +.PHONY: buildlib all \ + clean distclean extraclean maintainer-clean \ + dist distdir \ + install uninstall Copied: vendor/expat/2.0.1_1/README (from r200365, vendor/expat/dist/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/README Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/README) @@ -0,0 +1,137 @@ + + Expat, Release 2.0.1 + +This is Expat, a C library for parsing XML, written by James Clark. +Expat is a stream-oriented XML parser. This means that you register +handlers with the parser before starting the parse. These handlers +are called when the parser discovers the associated structures in the +document being parsed. A start tag is an example of the kind of +structures for which you may register handlers. + +Windows users should use the expat_win32bin package, which includes +both precompiled libraries and executables, and source code for +developers. + +Expat is free software. You may copy, distribute, and modify it under +the terms of the License contained in the file COPYING distributed +with this package. This license is the same as the MIT/X Consortium +license. + +Versions of Expat that have an odd minor version (the middle number in +the release above), are development releases and should be considered +as beta software. Releases with even minor version numbers are +intended to be production grade software. + +If you are building Expat from a check-out from the CVS repository, +you need to run a script that generates the configure script using the +GNU autoconf and libtool tools. To do this, you need to have +autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred). +Run the script like this: + + ./buildconf.sh + +Once this has been done, follow the same instructions as for building +from a source distribution. + +To build Expat from a source distribution, you first run the +configuration shell script in the top level distribution directory: + + ./configure + +There are many options which you may provide to configure (which you +can discover by running configure with the --help option). But the +one of most interest is the one that sets the installation directory. +By default, the configure script will set things up to install +libexpat into /usr/local/lib, expat.h into /usr/local/include, and +xmlwf into /usr/local/bin. If, for example, you'd prefer to install +into /home/me/mystuff/lib, /home/me/mystuff/include, and +/home/me/mystuff/bin, you can tell configure about that with: + + ./configure --prefix=/home/me/mystuff + +Another interesting option is to enable 64-bit integer support for +line and column numbers and the over-all byte index: + + ./configure CPPFLAGS=-DXML_LARGE_SIZE + +However, such a modification would be a breaking change to the ABI +and is therefore not recommended for general use - e.g. as part of +a Linux distribution - but rather for builds with special requirements. + +After running the configure script, the "make" command will build +things and "make install" will install things into their proper +location. Have a look at the "Makefile" to learn about additional +"make" options. Note that you need to have write permission into +the directories into which things will be installed. + +If you are interested in building Expat to provide document +information in UTF-16 rather than the default UTF-8, follow these +instructions (after having run "make distclean"): + + 1. For UTF-16 output as unsigned short (and version/error + strings as char), run: + + ./configure CPPFLAGS=-DXML_UNICODE + + For UTF-16 output as wchar_t (incl. version/error strings), + run: + + ./configure CFLAGS="-g -O2 -fshort-wchar" \ + CPPFLAGS=-DXML_UNICODE_WCHAR_T + + 2. Edit the MakeFile, changing: + + LIBRARY = libexpat.la + + to: + + LIBRARY = libexpatw.la + + (Note the additional "w" in the library name.) + + 3. Run "make buildlib" (which builds the library only). + Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la". + + 4. Run "make installlib" (which installs the library only). + Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la". + +Using DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default +value for DESTDIR, and the rest of the make file using only DESTDIR. +It works as follows: + $ make install DESTDIR=/path/to/image +overrides the in-makefile set DESTDIR, while both + $ INSTALL_ROOT=/path/to/image make install + $ make install INSTALL_ROOT=/path/to/image +use DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the +environment, because variable-setting priority is +1) commandline +2) in-makefile +3) environment + +Note for Solaris users: The "ar" command is usually located in +"/usr/ccs/bin", which is not in the default PATH. You will need to +add this to your path for the "make" command, and probably also switch +to GNU make (the "make" found in /usr/ccs/bin does not seem to work +properly -- appearantly it does not understand .PHONY directives). If +you're using ksh or bash, use this command to build: + + PATH=/usr/ccs/bin:$PATH make + +When using Expat with a project using autoconf for configuration, you +can use the probing macro in conftools/expat.m4 to determine how to +include Expat. See the comments at the top of that file for more +information. + +A reference manual is available in the file doc/reference.html in this +distribution. + +The homepage for this project is http://www.libexpat.org/. There +are links there to connect you to the bug reports page. If you need +to report a bug when you don't have access to a browser, you may also +send a bug report by email to expat-bugs@mail.libexpat.org. + +Discussion related to the direction of future expat development takes +place on expat-discuss@mail.libexpat.org. Archives of this list and +other Expat-related lists may be found at: + + http://mail.libexpat.org/mailman/listinfo/ Copied: vendor/expat/2.0.1_1/configure (from r200365, vendor/expat/dist/configure) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/expat/2.0.1_1/configure Fri Dec 11 02:07:21 2009 (r200391, copy of r200365, vendor/expat/dist/configure) @@ -0,0 +1,22017 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for expat 2.0.1. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:09:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF86B106566C; Fri, 11 Dec 2009 02:09: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 BEA178FC16; Fri, 11 Dec 2009 02:09:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB29kkk082897; Fri, 11 Dec 2009 02:09:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB29kem082894; Fri, 11 Dec 2009 02:09:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912110209.nBB29kem082894@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 02:09: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: r200392 - head/contrib/expat/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:09:46 -0000 Author: delphij Date: Fri Dec 11 02:09:46 2009 New Revision: 200392 URL: http://svn.freebsd.org/changeset/base/200392 Log: Apply two vendor fixes for CVE-2009-3720. Security: CVE-2009-3720 MFC after: 3 days Modified: head/contrib/expat/lib/xmlparse.c head/contrib/expat/lib/xmltok_impl.c Directory Properties: head/contrib/expat/ (props changed) Modified: head/contrib/expat/lib/xmlparse.c ============================================================================== --- head/contrib/expat/lib/xmlparse.c Fri Dec 11 02:07:21 2009 (r200391) +++ head/contrib/expat/lib/xmlparse.c Fri Dec 11 02:09:46 2009 (r200392) @@ -3725,7 +3725,6 @@ doProlog(XML_Parser parser, return XML_ERROR_NO_ELEMENTS; default: tok = -tok; - next = end; break; } } Modified: head/contrib/expat/lib/xmltok_impl.c ============================================================================== --- head/contrib/expat/lib/xmltok_impl.c Fri Dec 11 02:07:21 2009 (r200391) +++ head/contrib/expat/lib/xmltok_impl.c Fri Dec 11 02:09:46 2009 (r200392) @@ -1744,7 +1744,7 @@ PREFIX(updatePosition)(const ENCODING *e const char *end, POSITION *pos) { - while (ptr != end) { + while (ptr < end) { switch (BYTE_TYPE(enc, ptr)) { #define LEAD_CASE(n) \ case BT_LEAD ## n: \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:23:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92EE7106568B; Fri, 11 Dec 2009 02:23:04 +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 7F8D08FC20; Fri, 11 Dec 2009 02:23:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB2N4t6083297; Fri, 11 Dec 2009 02:23:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB2N4hM083287; Fri, 11 Dec 2009 02:23:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110223.nBB2N4hM083287@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 02:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200393 - in stable/7/contrib/bind9: . bin/named lib/dns lib/dns/include/dns X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:23:04 -0000 Author: dougb Date: Fri Dec 11 02:23:04 2009 New Revision: 200393 URL: http://svn.freebsd.org/changeset/base/200393 Log: Update to version 9.4.3-P4. The vulnerability this is designed to fix is related to DNSSEC validation on a resolving name server that allows access to untrusted users. If your system does not fall into all 3 of these categories you do not need to update immediately. Modified: stable/7/contrib/bind9/CHANGES stable/7/contrib/bind9/bin/named/query.c stable/7/contrib/bind9/lib/dns/api stable/7/contrib/bind9/lib/dns/include/dns/types.h stable/7/contrib/bind9/lib/dns/masterdump.c stable/7/contrib/bind9/lib/dns/rbtdb.c stable/7/contrib/bind9/lib/dns/resolver.c stable/7/contrib/bind9/lib/dns/validator.c stable/7/contrib/bind9/version Directory Properties: stable/7/contrib/bind9/ (props changed) Modified: stable/7/contrib/bind9/CHANGES ============================================================================== --- stable/7/contrib/bind9/CHANGES Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/CHANGES Fri Dec 11 02:23:04 2009 (r200393) @@ -1,3 +1,9 @@ + --- 9.4.3-P4 released --- + +2772. [security] When validating, track whether pending data was from + the additional section or not and only return it if + validates as secure. [RT #20438] + --- 9.4.3-P3 released --- 2640. [security] A specially crafted update packet will cause named Modified: stable/7/contrib/bind9/bin/named/query.c ============================================================================== --- stable/7/contrib/bind9/bin/named/query.c Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/bin/named/query.c Fri Dec 11 02:23:04 2009 (r200393) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.257.18.46 2008/10/15 22:33:01 marka Exp $ */ +/* $Id: query.c,v 1.257.18.46.2.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -109,6 +109,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + typedef struct client_additionalctx { ns_client_t *client; dns_rdataset_t *rdataset; @@ -1721,8 +1723,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -1761,8 +1763,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -2547,14 +2549,14 @@ query_addbestns(ns_client_t *client) { /* * Attempt to validate RRsets that are pending or that are glue. */ - if ((rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending)) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && - (client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0) + !PENDINGOK(client->query.dboptions)) goto cleanup; - if ((rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue)) && + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && SECURE(client) && WANTDNSSEC(client)) goto cleanup; @@ -3344,6 +3346,8 @@ query_find(ns_client_t *client, dns_fetc isc_boolean_t empty_wild; dns_rdataset_t *noqname; isc_boolean_t resuming; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -3555,9 +3559,49 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (validate(client, db, fname, rdataset, sigrdataset)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: stable/7/contrib/bind9/lib/dns/api ============================================================================== --- stable/7/contrib/bind9/lib/dns/api Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/lib/dns/api Fri Dec 11 02:23:04 2009 (r200393) @@ -1,3 +1,3 @@ -LIBINTERFACE = 36 -LIBREVISION = 2 +LIBINTERFACE = 38 +LIBREVISION = 0 LIBAGE = 0 Modified: stable/7/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- stable/7/contrib/bind9/lib/dns/include/dns/types.h Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/lib/dns/include/dns/types.h Fri Dec 11 02:23:04 2009 (r200393) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: types.h,v 1.109.18.12 2006/05/02 12:55:31 shane Exp $ */ +/* $Id: types.h,v 1.109.18.12.68.1 2009/11/19 00:25:18 marka Exp $ */ #ifndef DNS_TYPES_H #define DNS_TYPES_H 1 @@ -241,40 +241,52 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /*% Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) - + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) + + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) + /*% Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) - - /* Received in a referral response. */ - dns_trust_glue = 3, + + /* Received in a referral response. */ + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) - - /* Answser from a non-authoritative server */ - dns_trust_answer = 4, + + /* Answer from a non-authoritative server */ + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) - + /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) - /* Answser from an authoritative server */ - dns_trust_authanswer = 6, + /* Answer from an authoritative server */ + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) - - /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + + /* Successfully DNSSEC validated */ + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + + /*% * Name checking severites. */ Modified: stable/7/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/masterdump.c Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/lib/dns/masterdump.c Fri Dec 11 02:23:04 2009 (r200393) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.73.18.16 2008/08/13 23:46:04 tbox Exp $ */ +/* $Id: masterdump.c,v 1.73.18.16.2.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -774,7 +774,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: stable/7/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/rbtdb.c Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/lib/dns/rbtdb.c Fri Dec 11 02:23:04 2009 (r200393) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.196.18.53 2008/01/31 23:46:05 tbox Exp $ */ +/* $Id: rbtdb.c,v 1.196.18.53.4.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -3072,7 +3072,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -3586,7 +3586,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: stable/7/contrib/bind9/lib/dns/resolver.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/resolver.c Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/lib/dns/resolver.c Fri Dec 11 02:23:04 2009 (r200393) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: resolver.c,v 1.284.18.79 2008/10/17 22:02:13 jinmei Exp $ */ +/* $Id: resolver.c,v 1.284.18.79.2.1 2009/11/19 00:25:17 marka Exp $ */ /*! \file */ @@ -3887,6 +3887,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -3923,12 +3924,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation) addedrdataset = ardataset; else @@ -4276,7 +4299,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: stable/7/contrib/bind9/lib/dns/validator.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/validator.c Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/lib/dns/validator.c Fri Dec 11 02:23:04 2009 (r200393) @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: validator.c,v 1.119.18.41.2.1 2009/03/17 02:23:49 marka Exp $ */ +/* $Id: validator.c,v 1.119.18.41.2.2 2009/11/19 00:25:18 marka Exp $ */ /*! \file */ @@ -1174,7 +1174,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1189,7 +1189,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -1805,7 +1805,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -1818,7 +1818,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -2667,7 +2667,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: stable/7/contrib/bind9/version ============================================================================== --- stable/7/contrib/bind9/version Fri Dec 11 02:09:46 2009 (r200392) +++ stable/7/contrib/bind9/version Fri Dec 11 02:23:04 2009 (r200393) @@ -1,4 +1,4 @@ -# $Id: version,v 1.29.134.23.2.3 2009/07/28 13:57:27 marka Exp $ +# $Id: version,v 1.29.134.23.2.4 2009/11/19 00:25:17 marka Exp $ # # This file must follow /bin/sh rules. It is imported directly via # configure. @@ -7,4 +7,4 @@ MAJORVER=9 MINORVER=4 PATCHVER=3 RELEASETYPE=-P -RELEASEVER=3 +RELEASEVER=4 From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:32:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AB921065676; Fri, 11 Dec 2009 02:32:54 +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 08FA18FC13; Fri, 11 Dec 2009 02:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB2Wrvs083507; Fri, 11 Dec 2009 02:32:53 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB2WrRO083505; Fri, 11 Dec 2009 02:32:53 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110232.nBB2WrRO083505@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 02:32:53 +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: r200394 - stable/6/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:32:54 -0000 Author: dougb Date: Fri Dec 11 02:32:53 2009 New Revision: 200394 URL: http://svn.freebsd.org/changeset/base/200394 Log: Add a big honkin' warning about not using DNSSEC with this version of BIND. Also point out that it's EOL and give suggestions on upgrading. Modified: stable/6/etc/namedb/named.conf Modified: stable/6/etc/namedb/named.conf ============================================================================== --- stable/6/etc/namedb/named.conf Fri Dec 11 02:23:04 2009 (r200393) +++ stable/6/etc/namedb/named.conf Fri Dec 11 02:32:53 2009 (r200394) @@ -8,6 +8,28 @@ // simple mistakes, you can break connectivity for affected parties, // or cause huge amounts of useless Internet traffic. +/* +************************************************************************* +* _ _____ _____ _____ _ _ _____ ___ ___ _ _ * +* / \|_ _|_ _| ____| \ | |_ _|_ _/ _ \| \ | | * +* / _ \ | | | | | _| | \| | | | | | | | | \| | * +* / ___ \| | | | | |___| |\ | | | | | |_| | |\ | * +* /_/ \_\_| |_| |_____|_| \_| |_| |___\___/|_| \_| * +* * +************************************************************************* + +The version of BIND in the RELENG_6 branch (FreeBSD 6.x) is NOT suitable +for use with DNSSEC, either as a validating resolver or an authoritative +name server. If you plan to use DNSSEC for any purpose you should use a +newer version of BIND, preferably version 9.6.x or higher. + +Additionally, this version of BIND (9.3.x) is beyond its End Of Life (EOL) +date and is no longer supported by ISC. + +Newer versions are available in the ports tree (e.g., /usr/ports/dns/bind96) +or by upgrading your FreeBSD installation to version 8.0 or higher. +*/ + options { // Relative to the chroot directory, if any directory "/etc/namedb"; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:44:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AEE71065672; Fri, 11 Dec 2009 02:44:15 +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 891BE8FC0C; Fri, 11 Dec 2009 02:44: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 nBB2iF56083751; Fri, 11 Dec 2009 02:44:15 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB2iFdC083746; Fri, 11 Dec 2009 02:44:15 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912110244.nBB2iFdC083746@svn.freebsd.org> From: Andrew Thompson Date: Fri, 11 Dec 2009 02:44: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: r200395 - in head/sys/dev/usb: . quirk serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:44:15 -0000 Author: thompsa Date: Fri Dec 11 02:44:15 2009 New Revision: 200395 URL: http://svn.freebsd.org/changeset/base/200395 Log: Add a quirk for the Curitel UM175 where setting multiplexing for call management over the data endpoint causes communication to die. Take this one step further and model it on the existing NetBSD quirk and import other device IDs from them. Obtained from: NetBSD Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Dec 11 02:32:53 2009 (r200394) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Dec 11 02:44:15 2009 (r200395) @@ -125,6 +125,24 @@ static struct usb_quirk_entry usb_quirks /* MS keyboards do weird things */ {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE, UQ_NONE)}, {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, + /* umodem(4) device quirks */ + {USB_QUIRK_ENTRY(USB_VENDOR_METRICOM, USB_PRODUCT_METRICOM_RICOCHET_GS, + 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_SANYO, USB_PRODUCT_SANYO_SCP4900, + 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_T720C, + 0x001, 0x001, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_EICON, USB_PRODUCT_EICON_DIVA852, + 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_SIEMENS2, USB_PRODUCT_SIEMENS2_ES75, + 0x000, 0x000, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_QUALCOMM, USB_PRODUCT_QUALCOMM_CDMA_MSM, + 0x0000, 0xFFFF, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_QUALCOMM2, USB_PRODUCT_QUALCOMM2_CDMA_MSM, + 0x0000, 0xFFFF, UQ_ASSUME_CM_OVER_DATA)}, + {USB_QUIRK_ENTRY(USB_VENDOR_CURITEL, USB_PRODUCT_CURITEL_UM175, + 0x0000, 0xFFFF, UQ_ASSUME_CM_OVER_DATA)}, + }; static const char *usb_quirk_str[USB_QUIRK_MAX] = { @@ -152,6 +170,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_CFG_INDEX_3] = "UQ_CFG_INDEX_3", [UQ_CFG_INDEX_4] = "UQ_CFG_INDEX_4", [UQ_CFG_INDEX_0] = "UQ_CFG_INDEX_0", + [UQ_ASSUME_CM_OVER_DATA]= "UQ_ASSUME_CM_OVER_DATA", }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Fri Dec 11 02:32:53 2009 (r200394) +++ head/sys/dev/usb/quirk/usb_quirk.h Fri Dec 11 02:44:15 2009 (r200395) @@ -53,6 +53,7 @@ enum { /* keep in sync with usb_quirk_st UQ_CFG_INDEX_3, /* select configuration index 3 by default */ UQ_CFG_INDEX_4, /* select configuration index 4 by default */ UQ_CFG_INDEX_0, /* select configuration index 0 by default */ + UQ_ASSUME_CM_OVER_DATA, /* modem device breaks on cm over data */ USB_QUIRK_MAX }; Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Fri Dec 11 02:32:53 2009 (r200394) +++ head/sys/dev/usb/serial/umodem.c Fri Dec 11 02:44:15 2009 (r200395) @@ -112,6 +112,7 @@ __FBSDID("$FreeBSD$"); #define USB_DEBUG_VAR umodem_debug #include #include +#include #include @@ -349,16 +350,20 @@ umodem_attach(device_t dev) } } - if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) { - if (sc->sc_acm_cap & USB_CDC_ACM_HAS_FEATURE) { + if (usb_test_quirk(uaa, UQ_ASSUME_CM_OVER_DATA)) { + sc->sc_cm_over_data = 1; + } else { + if (sc->sc_cm_cap & USB_CDC_CM_OVER_DATA) { + if (sc->sc_acm_cap & USB_CDC_ACM_HAS_FEATURE) { - error = umodem_set_comm_feature - (uaa->device, sc->sc_ctrl_iface_no, - UCDC_ABSTRACT_STATE, UCDC_DATA_MULTIPLEXED); + error = umodem_set_comm_feature + (uaa->device, sc->sc_ctrl_iface_no, + UCDC_ABSTRACT_STATE, UCDC_DATA_MULTIPLEXED); - /* ignore any errors */ + /* ignore any errors */ + } + sc->sc_cm_over_data = 1; } - sc->sc_cm_over_data = 1; } error = usbd_transfer_setup(uaa->device, sc->sc_iface_index, sc->sc_xfer, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Dec 11 02:32:53 2009 (r200394) +++ head/sys/dev/usb/usbdevs Fri Dec 11 02:44:15 2009 (r200395) @@ -1213,6 +1213,9 @@ product DRESDENELEKTRONIK WIRELESSHANDHE /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board +/* Eicon Networks */ +product EICON DIVA852 0x4905 Diva 852 ISDN TA + /* EIZO products */ product EIZO HUB 0x0000 hub product EIZO MONITOR 0x0001 monitor @@ -1827,6 +1830,7 @@ product MOSCHIP MCS7830 0x7830 MCS7830 /* Motorola products */ product MOTOROLA MC141555 0x1555 MC141555 hub controller product MOTOROLA SB4100 0x4100 SB4100 USB Cable Modem +product MOTOROLA2 T720C 0x2822 T720c product MOTOROLA2 A41XV32X 0x2a22 A41x/V32x Mobile Phones product MOTOROLA2 E398 0x4810 E398 Mobile Phone product MOTOROLA2 USBLAN 0x600c USBLAN From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 02:52:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A064E106568B; Fri, 11 Dec 2009 02:52:14 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D95A8FC19; Fri, 11 Dec 2009 02:52:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBB2qEfZ083932; Fri, 11 Dec 2009 02:52:14 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB2qEox083930; Fri, 11 Dec 2009 02:52:14 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912110252.nBB2qEox083930@svn.freebsd.org> From: Andrew Thompson Date: Fri, 11 Dec 2009 02:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200396 - head/sys/dev/usb/quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 02:52:14 -0000 Author: thompsa Date: Fri Dec 11 02:52:14 2009 New Revision: 200396 URL: http://svn.freebsd.org/changeset/base/200396 Log: Wrap long lines. Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Fri Dec 11 02:44:15 2009 (r200395) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Dec 11 02:52:14 2009 (r200396) @@ -80,51 +80,91 @@ struct usb_quirk_entry { static struct mtx usb_quirk_mtx; static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRKS_MAX] = { - {USB_QUIRK_ENTRY(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_LCM, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, 0x094, 0x094, UQ_SWAP_UNICODE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, 0x0a2, UQ_BAD_ADC, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, 0x0a2, 0x0a2, UQ_AU_NO_XU, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ADA70, 0x103, 0x103, UQ_BAD_ADC, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ASC495, 0x000, 0x000, UQ_BAD_AUDIO, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_QTRONIX, USB_PRODUCT_QTRONIX_980N, 0x110, 0x110, UQ_SPUR_BUT_UP, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_ALCOR2, USB_PRODUCT_ALCOR2_KBD_HUB, 0x001, 0x001, UQ_SPUR_BUT_UP, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MCT, USB_PRODUCT_MCT_HUB0100, 0x102, 0x102, UQ_BUS_POWERED, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232, 0x102, 0x102, UQ_BUS_POWERED, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_TI, USB_PRODUCT_TI_UTUSB41, 0x110, 0x110, UQ_POWER_CLAIM, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1, 0x009, 0x009, UQ_AU_NO_FRAC, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_SILICONPORTALS, USB_PRODUCT_SILICONPORTALS_YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_UN53B, 0x0000, 0xFFFF, UQ_NO_STRINGS, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_ELSA, USB_PRODUCT_ELSA_MODEM1, 0x0000, 0xFFFF, UQ_CFG_INDEX_1, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ASUS, USB_PRODUCT_ASUS_LCM, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_INSIDEOUT, USB_PRODUCT_INSIDEOUT_EDGEPORT4, + 0x094, 0x094, UQ_SWAP_UNICODE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, + 0x0a2, 0x0a2, UQ_BAD_ADC, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_DALLAS, USB_PRODUCT_DALLAS_J6502, + 0x0a2, 0x0a2, UQ_AU_NO_XU, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ADA70, + 0x103, 0x103, UQ_BAD_ADC, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ALTEC, USB_PRODUCT_ALTEC_ASC495, + 0x000, 0x000, UQ_BAD_AUDIO, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_QTRONIX, USB_PRODUCT_QTRONIX_980N, + 0x110, 0x110, UQ_SPUR_BUT_UP, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ALCOR2, USB_PRODUCT_ALCOR2_KBD_HUB, + 0x001, 0x001, UQ_SPUR_BUT_UP, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_MCT, USB_PRODUCT_MCT_HUB0100, + 0x102, 0x102, UQ_BUS_POWERED, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232, + 0x102, 0x102, UQ_BUS_POWERED, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_TI, USB_PRODUCT_TI_UTUSB41, + 0x110, 0x110, UQ_POWER_CLAIM, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_TELEX, USB_PRODUCT_TELEX_MIC1, + 0x009, 0x009, UQ_AU_NO_FRAC, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_SILICONPORTALS, + USB_PRODUCT_SILICONPORTALS_YAPPHONE, + 0x100, 0x100, UQ_AU_INP_ASYNC, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_LOGITECH, USB_PRODUCT_LOGITECH_UN53B, + 0x0000, 0xFFFF, UQ_NO_STRINGS, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ELSA, USB_PRODUCT_ELSA_MODEM1, + 0x0000, 0xFFFF, UQ_CFG_INDEX_1, UQ_NONE)}, /* * XXX The following quirks should have a more specific revision * number: */ - {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_895C, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_880C, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_815C, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_810C, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_830C, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_1220C, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_XEROX, USB_PRODUCT_XEROX_WCM15, 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_895C, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_880C, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_815C, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_810C, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_830C, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_HP, USB_PRODUCT_HP_1220C, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_XEROX, USB_PRODUCT_XEROX_WCM15, + 0x0000, 0xFFFF, UQ_BROKEN_BIDIR, UQ_NONE)}, /* Devices which should be ignored by uhid */ - {USB_QUIRK_ENTRY(USB_VENDOR_APC, USB_PRODUCT_APC_UPS, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F6C550AVR, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_CYBERPOWER, USB_PRODUCT_CYBERPOWER_1500CAVRLCD, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_ITUNERNET, USB_PRODUCT_ITUNERNET_USBLCD2X20, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_ITUNERNET, USB_PRODUCT_ITUNERNET_USBLCD4X20, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS1, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS2, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_3G, 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_APC, USB_PRODUCT_APC_UPS, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F6C550AVR, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_CYBERPOWER, + USB_PRODUCT_CYBERPOWER_1500CAVRLCD, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ITUNERNET, USB_PRODUCT_ITUNERNET_USBLCD2X20, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_ITUNERNET, USB_PRODUCT_ITUNERNET_USBLCD4X20, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS1, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS2, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_3G, + 0x0000, 0xFFFF, UQ_HID_IGNORE, UQ_NONE)}, /* Devices which should be ignored by both ukbd and uhid */ - {USB_QUIRK_ENTRY(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_WISPY1A, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY1B, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_TENX, USB_PRODUCT_TENX_UAUDIO0, 0x0101, 0x0101, UQ_AUDIO_SWAP_LR, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_WISPY1A, + 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY1B, + 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_TENX, USB_PRODUCT_TENX_UAUDIO0, + 0x0101, 0x0101, UQ_AUDIO_SWAP_LR, UQ_NONE)}, /* MS keyboards do weird things */ - {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE, UQ_NONE)}, - {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_MICROSOFT, + USB_PRODUCT_MICROSOFT_WLINTELLIMOUSE, + 0x0000, 0xFFFF, UQ_MS_LEADING_BYTE, UQ_NONE)}, + {USB_QUIRK_ENTRY(USB_VENDOR_METAGEEK, USB_PRODUCT_METAGEEK_WISPY24X, + 0x0000, 0xFFFF, UQ_KBD_IGNORE, UQ_HID_IGNORE, UQ_NONE)}, /* umodem(4) device quirks */ {USB_QUIRK_ENTRY(USB_VENDOR_METRICOM, USB_PRODUCT_METRICOM_RICOCHET_GS, 0x100, 0x100, UQ_ASSUME_CM_OVER_DATA)}, From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 03:08:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC75A106568B; Fri, 11 Dec 2009 03:08:07 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2AD8FC13; Fri, 11 Dec 2009 03:08: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 nBB387s3084447; Fri, 11 Dec 2009 03:08:07 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB38787084445; Fri, 11 Dec 2009 03:08:07 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912110308.nBB38787084445@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 11 Dec 2009 03:08: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: r200397 - head/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 03:08:07 -0000 Author: marcel Date: Fri Dec 11 03:08:07 2009 New Revision: 200397 URL: http://svn.freebsd.org/changeset/base/200397 Log: Fix interrupt handling. It started off broken and grew worse over time. The rewrite of the interrupt handler includes: o loop until all pending interrupts are handled. This closes a race condition. o count the number of interrupt sources we handled so that we can properly return FILTER_HANDLED or FILTER_STRAY when we break out of the loop. o When matching the interrupt source to the devices that have that source pending, check only from the set of devices we found to have a pending interrupt. PR: kern/140947 MFC after: 3 days Modified: head/sys/dev/puc/puc.c Modified: head/sys/dev/puc/puc.c ============================================================================== --- head/sys/dev/puc/puc.c Fri Dec 11 02:52:14 2009 (r200396) +++ head/sys/dev/puc/puc.c Fri Dec 11 03:08:07 2009 (r200397) @@ -129,62 +129,78 @@ puc_intr(void *arg) { struct puc_port *port; struct puc_softc *sc = arg; - u_long dev, devs; - int i, idx, ipend, isrc; + u_long ds, dev, devs; + int i, idx, ipend, isrc, nints; uint8_t ilr; - devs = sc->sc_serdevs; - if (sc->sc_ilr == PUC_ILR_DIGI) { - idx = 0; - while (devs & (0xfful << idx)) { - ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); - devs &= ~0ul ^ ((u_long)ilr << idx); - idx += 8; - } - } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + nints = 0; + while (1) { /* - * Don't trust the value if it's the same as the option - * register. It may mean that the ILR is not active and - * we're reading the option register instead. This may - * lead to false positives on 8-port boards. + * Obtain the set of devices with pending interrupts. */ - ilr = bus_read_1(sc->sc_port[0].p_rres, 7); - if (ilr != (sc->sc_cfg_data & 0xff)) - devs &= (u_long)ilr; - } - - ipend = 0; - idx = 0, dev = 1UL; - while (devs != 0UL) { - while ((devs & dev) == 0UL) - idx++, dev <<= 1; - devs &= ~dev; - port = &sc->sc_port[idx]; - port->p_ipend = SERDEV_IPEND(port->p_dev); - ipend |= port->p_ipend; - } + devs = sc->sc_serdevs; + if (sc->sc_ilr == PUC_ILR_DIGI) { + idx = 0; + while (devs & (0xfful << idx)) { + ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7); + devs &= ~0ul ^ ((u_long)ilr << idx); + idx += 8; + } + } else if (sc->sc_ilr == PUC_ILR_QUATECH) { + /* + * Don't trust the value if it's the same as the option + * register. It may mean that the ILR is not active and + * we're reading the option register instead. This may + * lead to false positives on 8-port boards. + */ + ilr = bus_read_1(sc->sc_port[0].p_rres, 7); + if (ilr != (sc->sc_cfg_data & 0xff)) + devs &= (u_long)ilr; + } + if (devs == 0UL) + break; - i = 0, isrc = SER_INT_OVERRUN; - while (ipend) { - while (i < PUC_ISRCCNT && !(ipend & isrc)) - i++, isrc <<= 1; - KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); - ipend &= ~isrc; + /* + * Obtain the set of interrupt sources from those devices + * that have pending interrupts. + */ + ipend = 0; idx = 0, dev = 1UL; - devs = sc->sc_serdevs; - while (devs != 0UL) { - while ((devs & dev) == 0UL) + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) idx++, dev <<= 1; - devs &= ~dev; + ds &= ~dev; port = &sc->sc_port[idx]; - if (!(port->p_ipend & isrc)) - continue; - if (port->p_ihsrc[i] != NULL) - (*port->p_ihsrc[i])(port->p_iharg); + port->p_ipend = SERDEV_IPEND(port->p_dev); + ipend |= port->p_ipend; + } + if (ipend == 0) + break; + + i = 0, isrc = SER_INT_OVERRUN; + while (ipend) { + while (i < PUC_ISRCCNT && !(ipend & isrc)) + i++, isrc <<= 1; + KASSERT(i < PUC_ISRCCNT, ("%s", __func__)); + ipend &= ~isrc; + idx = 0, dev = 1UL; + ds = devs; + while (ds != 0UL) { + while ((ds & dev) == 0UL) + idx++, dev <<= 1; + ds &= ~dev; + port = &sc->sc_port[idx]; + if (!(port->p_ipend & isrc)) + continue; + if (port->p_ihsrc[i] != NULL) + (*port->p_ihsrc[i])(port->p_iharg); + nints++; + } } - return (FILTER_HANDLED); } - return (FILTER_STRAY); + + return ((nints > 0) ? FILTER_HANDLED : FILTER_STRAY); } int From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 04:14:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0710106566B; Fri, 11 Dec 2009 04:14:44 +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 AE4978FC0C; Fri, 11 Dec 2009 04:14: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 nBB4Eixf087113; Fri, 11 Dec 2009 04:14:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB4EiEq087110; Fri, 11 Dec 2009 04:14:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912110414.nBB4EiEq087110@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 04:14:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200398 - in vendor/bind9: dist dist-9.4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 04:14:44 -0000 Author: dougb Date: Fri Dec 11 04:14:44 2009 New Revision: 200398 URL: http://svn.freebsd.org/changeset/base/200398 Log: Update these files to match current reality. BIND 9.6 has diverged sufficiently from 9.4 to warrant slightly different procedures, so stop pretending that they are interchangable. Modified: vendor/bind9/dist-9.4/FREEBSD-Upgrade vendor/bind9/dist/FREEBSD-Upgrade Modified: vendor/bind9/dist-9.4/FREEBSD-Upgrade ============================================================================== --- vendor/bind9/dist-9.4/FREEBSD-Upgrade Fri Dec 11 03:08:07 2009 (r200397) +++ vendor/bind9/dist-9.4/FREEBSD-Upgrade Fri Dec 11 04:14:44 2009 (r200398) @@ -1,56 +1,54 @@ - FreeBSD maintainer's guide to updating BIND 9 - ============================================= + FreeBSD maintainer's guide to updating BIND 9.4.x + ================================================= 1) Obtain the latest source distribution from the ISC's FTP server (ftp://ftp.isc.org/isc/bind9/) 2) Check out the head of the subversion "vendor branch" - svn co $REPO/vendor/bind9/dist - - NOTE: For RELENG_6 (BIND 9.3.x) s/dist/dist-9.3/ throughout this file + svn co $REPO/vendor/bind9/dist-9.4 3) Unpack the tarball in a suitable directory: - tar zxvf bind-9..tar.gz -X dist/FREEBSD-Xlist + tar zxvf bind-9.4..tar.gz -X dist-9.4/FREEBSD-Xlist Check to see if any files have been added or deleted using - diff -ur dist bind-9. -x \.svn | grep 'Only in' + diff -ur dist-9.4 bind-9.4. -x \.svn | grep 'Only in' 4) Copy new files over the old ones: - cp -Rp bind-9./* dist/ + cp -Rp bind-9.4./* dist-9.4/ 5) Double-check for changes using 'svn status' 6) Use 'svn add' and 'svn rm' to bring dist up to date for files found above. Update FREEBSD-Xlist as needed. - The files in vendor/bind9/dist should now look exactly like those in the + The files in vendor/bind9/dist-9.4 should now look exactly like those in the ISC sources, minus the files/directories in FREEBSD-Xlist above. Carefully check the output of 'svn status' and 'svn diff' It's not if you're paranoid, it's if you are paranoid enough 7) Commit the update to the vendor files: - cd dist ; svn ci -m "Vendor import of BIND 9.X.Y" - svn cp $REPO/vendor/bind9/dist $REPO/vendor/bind9/${version} + cd dist-9.4 ; svn ci -m "Vendor import of BIND 9.4.X" + svn cp $REPO/vendor/bind9/dist-9.4 $REPO/vendor/bind9/${version} (this is a server-side operation, you dont have to check it out) -8) Update the files in src/contrib/bind9: +8) Update the files in stable/7/contrib/bind9: - cd head/contrib/bind9 + cd stable/7/contrib/bind9 Make sure you are up to date: svn update ; svn status - svn merge $REPO/vendor/bind9/dist . + svn merge $REPO/vendor/bind9/dist-9.4 . Resolve conflicts (if any) Carefully check the output of 'svn status' and 'svn diff' - NOTE: You may need 2 copies of head/contrib/bind9 at this point, + NOTE: You may need 2 copies of stable/7/contrib/bind9 at this point, one to do the work in steps 9 and 10 below, and a clean - version to commit in step 13. + version to commit in step 16. 9) Remove any references to the {bin,lib}/tests and docutil directories from the configure and Makefile templates: @@ -73,14 +71,14 @@ --with-openssl=/usr --with-randomdev=/dev/random Note that we intentionally disable IPv6 support on the configure - command line; src/lib/bind/config.mk will re-enable it at compile + command line; stable/7/lib/bind/config.mk will re-enable it at compile time if WITHOUT_INET6 is not defined. -11) Copy the following generated files to src/lib/bind: +11) Copy the following generated files to stable/7/lib/bind: - Path in src/contrib/bind9 Path in src/lib/bind + Path in stable/7/contrib/bind9 Path in stable/7/lib/bind ------------------------------------------------------------ - s=/usr/src/lib/bind + s=../../lib/bind cp config.h ${s}/config.h cp lib/bind/config.h ${s}/bind/config.h cp lib/bind/port_after.h ${s}/bind/port_after.h @@ -92,46 +90,46 @@ Do not commit any other file that was modified or created in steps 6) or 7). -12) cd src/lib/bind/dns && make -DMAINTAINER_MODE generate && rm gen +12) cd stable/7/lib/bind/dns && make -DMAINTAINER_MODE generate && rm gen 13) Test build the updated files with a clean /usr/obj and empty src.conf The following directories contain Makefiles for bits and pieces of BIND 9: - FreeBSD directory ISC directory + FreeBSD directory ISC directory ======================================================== - src/lib/bind bind9/lib - src/lib/bind/bind bind9/lib/bind - src/lib/bind/bind9 bind9/lib/bind9 - src/lib/bind/dns bind9/lib/dns - src/lib/bind/isc bind9/lib/isc - src/lib/bind/isccc bind9/lib/isccc - src/lib/bind/isccfg bind9/lib/isccfg - src/lib/bind/lwres bind9/lib/lwres - src/share/doc/bind9 bind9/doc/{arm,misc} - src/usr.bin/dig bind9/bin/dig - src/usr.bin/host bind9/bin/dig - src/usr.bin/nslookup bind9/bin/dig - src/usr.bin/nsupdate bind9/bin/nsupdate - src/usr.sbin/dnssec-keygen bind9/bin/dnssec - src/usr.sbin/dnssec-signzone bind9/bin/dnssec - src/usr.sbin/named bind9/bin/named - src/usr.sbin/named-checkconf bind9/bin/check - src/usr.sbin/named-checkzone bind9/bin/check - src/usr.sbin/rndc bind9/bin/rndc - src/usr.sbin/rndc-confgen bind9/bin/rndc + stable/7/lib/bind bind9/lib + stable/7/lib/bind/bind bind9/lib/bind + stable/7/lib/bind/bind9 bind9/lib/bind9 + stable/7/lib/bind/dns bind9/lib/dns + stable/7/lib/bind/isc bind9/lib/isc + stable/7/lib/bind/isccc bind9/lib/isccc + stable/7/lib/bind/isccfg bind9/lib/isccfg + stable/7/lib/bind/lwres bind9/lib/lwres + stable/7/share/doc/bind9 bind9/doc/{arm,misc} + stable/7/usr.bin/dig bind9/bin/dig + stable/7/usr.bin/host bind9/bin/dig + stable/7/usr.bin/nslookup bind9/bin/dig + stable/7/usr.bin/nsupdate bind9/bin/nsupdate + stable/7/usr.sbin/dnssec-keygen bind9/bin/dnssec + stable/7/usr.sbin/dnssec-signzone bind9/bin/dnssec + stable/7/usr.sbin/named bind9/bin/named + stable/7/usr.sbin/named-checkconf bind9/bin/check + stable/7/usr.sbin/named-checkzone bind9/bin/check + stable/7/usr.sbin/rndc bind9/bin/rndc + stable/7/usr.sbin/rndc-confgen bind9/bin/rndc Make sure that the lists of sources, headers and man pages in each FreeBSD Makefile accurately reflects those in the corresponding ISC Makefile. Please strive to keep those lists in the same order and with line breaks in the same places to ease future comparisons. -A) Build and test. +14) Build and test. -B) Lather, rinse, repeat. +15) Lather, rinse, repeat. -C) Commit when everything builds cleanly and works properly. +16) Commit when everything builds cleanly and works properly. -- des@FreeBSD.org -- dougb@FreeBSD.org Modified: vendor/bind9/dist/FREEBSD-Upgrade ============================================================================== --- vendor/bind9/dist/FREEBSD-Upgrade Fri Dec 11 03:08:07 2009 (r200397) +++ vendor/bind9/dist/FREEBSD-Upgrade Fri Dec 11 04:14:44 2009 (r200398) @@ -9,9 +9,6 @@ svn co $REPO/vendor/bind9/dist - NOTE: For RELENG_6 (BIND 9.3.x) s/dist/dist-9.3/ throughout this file - For RELENG_7 (BIND 9.4.x) s/dist/dist-9.4/ throughout this file - 3) Unpack the tarball in a suitable directory: tar zxvf bind-9..tar.gz -X dist/FREEBSD-Xlist @@ -51,7 +48,7 @@ NOTE: You may need 2 copies of head/contrib/bind9 at this point, one to do the work in steps 9 and 10 below, and a clean - version to commit in step 13. + version to commit in step 16. 9) Remove any references to the {bin,lib}/tests and docutil directories from the configure and Makefile templates: @@ -125,11 +122,11 @@ Makefile. Please strive to keep those lists in the same order and with line breaks in the same places to ease future comparisons. -A) Build and test. +14) Build and test. -B) Lather, rinse, repeat. +15) Lather, rinse, repeat. -C) Commit when everything builds cleanly and works properly. +16) Commit when everything builds cleanly and works properly. -- des@FreeBSD.org -- dougb@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 07:53:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3F5F106566B; Fri, 11 Dec 2009 07:53:44 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C21468FC1C; Fri, 11 Dec 2009 07:53: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 nBB7ritG099423; Fri, 11 Dec 2009 07:53:44 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBB7rib9099418; Fri, 11 Dec 2009 07:53:44 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912110753.nBB7rib9099418@svn.freebsd.org> From: Shteryana Shopova Date: Fri, 11 Dec 2009 07:53: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: r200399 - head/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 07:53:45 -0000 Author: syrinx Date: Fri Dec 11 07:53:44 2009 New Revision: 200399 URL: http://svn.freebsd.org/changeset/base/200399 Log: Add support for TACACS+ accounting to libtacplus(3). Submitted by: Michael Pounov misho@aitbg.com OKed by: emaste Modified: head/lib/libtacplus/libtacplus.3 head/lib/libtacplus/taclib.c head/lib/libtacplus/taclib.h head/lib/libtacplus/taclib_private.h Modified: head/lib/libtacplus/libtacplus.3 ============================================================================== --- head/lib/libtacplus/libtacplus.3 Fri Dec 11 04:14:44 2009 (r200398) +++ head/lib/libtacplus/libtacplus.3 Fri Dec 11 07:53:44 2009 (r200399) @@ -44,6 +44,8 @@ .Fn tac_create_authen "struct tac_handle *h" "int action" "int type" "int service" .Ft int .Fn tac_create_author "struct tac_handle *h" "int method" "int type" "int service" +.Ft int +.Fn tac_create_acct "struct tac_handle *h" "int acct" "int action" "int type" "int service" .Ft char * .Fn tac_get_av "struct tac_handle *h" "u_int index" .Ft char * @@ -59,6 +61,8 @@ .Ft int .Fn tac_send_author "struct tac_handle *h" .Ft int +.Fn tac_send_acct "struct tac_handle *h" +.Ft int .Fn tac_set_av "struct tac_handle *h" "u_int index" "const char *av_pair" .Ft int .Fn tac_set_data "struct tac_handle *h" "const void *data" "size_t data_len" @@ -193,6 +197,20 @@ TACACS+ protocol specification. The .In taclib.h header file contains symbolic constants for these values. +.Sh CREATING A TACACS+ ACCOUNTING REQUEST +To begin constructing a new accounting request, call +.Fn tac_create_acct . +The +.Va acct , +.Va action , +.Va type , +and +.Va service +arguments must be set to appropriate values as defined in the +TACACS+ protocol specification. +The +.In taclib.h +header file contains symbolic constants for these values. .Sh SETTING OPTIONAL PARAMETERS ON A REQUEST After creating a request, various optional parameters may be attached to it through calls to @@ -354,6 +372,29 @@ include: .Pp The number of AV pairs received is obtained using .Fn TAC_AUTHEN_AV_COUNT . +.Sh SENDING THE ACCOUNTING REQUEST AND RECEIVING THE RESPONSE +After the TACACS+ authorization request has been constructed, it +is sent by means of +.Fn tac_send_acct . +This function connects to a server if not already connected, sends +the request, and waits for a reply. +On failure, +.Fn tac_send_acct +returns \-1. +Otherwise, it returns the TACACS+ status code +Possible status codes, defined in +.In taclib.h , +include: +.Pp +.Bl -item -compact -offset indent +.It +.Dv TAC_ACCT_STATUS_SUCCESS +.It +.Dv TAC_ACCT_STATUS_ERROR +.It +.Dv TAC_ACCT_STATUS_FOLLOW +.El +.Pp .Sh EXTRACTING INFORMATION FROM THE SERVER'S AUTHORIZATION RESPONSE Like an authentication response packet, an authorization response packet from the @@ -418,10 +459,14 @@ which can be retrieved using .It .Fn tac_create_author .It +.Fn tac_create_acct +.It .Fn tac_send_authen .It .Fn tac_send_author .It +.Fn tac_send_acct +.It .Fn tac_set_av .It .Fn tac_set_data Modified: head/lib/libtacplus/taclib.c ============================================================================== --- head/lib/libtacplus/taclib.c Fri Dec 11 04:14:44 2009 (r200398) +++ head/lib/libtacplus/taclib.c Fri Dec 11 07:53:44 2009 (r200399) @@ -211,6 +211,8 @@ protocol_version(int msg_type, int var, } break; + case TAC_ACCT: + default: minor = 0; break; @@ -967,6 +969,23 @@ tac_create_author(struct tac_handle *h, return 0; } +int +tac_create_acct(struct tac_handle *h, int acct, int action, int type, int service) +{ + struct tac_acct_start *as; + + create_msg(h, TAC_ACCT, action, type); + + as = &h->request.u.acct_start; + as->action = acct; + as->authen_action = action; + as->priv_lvl = TAC_PRIV_LVL_USER; + as->authen_type = type; + as->authen_service = service; + + return 0; +} + static void create_msg(struct tac_handle *h, int msg_type, int var, int type) { @@ -1158,6 +1177,49 @@ tac_send_author(struct tac_handle *h) } int +tac_send_acct(struct tac_handle *h) +{ + register int i, current; + struct tac_acct_start *as = &h->request.u.acct_start; + struct tac_acct_reply *ar = &h->response.u.acct_reply; + + /* start */ + as = &h->request.u.acct_start; + h->request.length = htonl(offsetof(struct tac_acct_start, rest[0])); + for (as->av_cnt = 0, i = 0; i < MAXAVPAIRS; i++) + if (h->avs[i].len && h->avs[i].data) + as->av_cnt++; + h->request.length = ntohl(htonl(h->request.length) + as->av_cnt); + + if (add_str_8(h, &as->user_len, &h->user) == -1 || + add_str_8(h, &as->port_len, &h->port) == -1 || + add_str_8(h, &as->rem_addr_len, &h->rem_addr) == -1) + return -1; + + for (i = current = 0; i < MAXAVPAIRS; i++) + if (h->avs[i].len && h->avs[i].data) + if (add_str_8(h, &as->rest[current++], &(h->avs[i])) == -1) + return -1; + + /* send */ + if (send_msg(h) == -1 || recv_msg(h) == -1) + return -1; + + /* reply */ + h->srvr_pos = offsetof(struct tac_acct_reply, rest[0]); + if (get_srvr_str(h, "msg", &h->srvr_msg, ntohs(ar->msg_len)) == -1 || + get_srvr_str(h, "data", &h->srvr_data, ntohs(ar->data_len)) == -1 || + get_srvr_end(h) == -1) + return -1; + + /* Sanity checks */ + if (!h->single_connect) + close_connection(h); + + return ar->status; +} + +int tac_set_rem_addr(struct tac_handle *h, const char *addr) { return save_str(h, &h->rem_addr, addr, addr != NULL ? strlen(addr) : 0); Modified: head/lib/libtacplus/taclib.h ============================================================================== --- head/lib/libtacplus/taclib.h Fri Dec 11 04:14:44 2009 (r200398) +++ head/lib/libtacplus/taclib.h Fri Dec 11 07:53:44 2009 (r200399) @@ -103,6 +103,17 @@ struct tac_handle; #define TAC_AUTHOR_STATUS_FAIL 0x10 #define TAC_AUTHOR_STATUS_ERROR 0x11 +/* Accounting actions */ +#define TAC_ACCT_MORE 0x1 +#define TAC_ACCT_START 0x2 +#define TAC_ACCT_STOP 0x4 +#define TAC_ACCT_WATCHDOG 0x8 + +/* Accounting status */ +#define TAC_ACCT_STATUS_SUCCESS 0x1 +#define TAC_ACCT_STATUS_ERROR 0x2 +#define TAC_ACCT_STATUS_FOLLOW 0x21 + __BEGIN_DECLS int tac_add_server(struct tac_handle *, const char *, int, const char *, int, int); @@ -127,6 +138,8 @@ int tac_set_av(struct tac_handle *, u char *tac_get_av(struct tac_handle *, u_int); char *tac_get_av_value(struct tac_handle *, const char *); void tac_clear_avs(struct tac_handle *); +int tac_create_acct(struct tac_handle *, int, int, int, int); +int tac_send_acct(struct tac_handle *); __END_DECLS #endif /* _TACLIB_H_ */ Modified: head/lib/libtacplus/taclib_private.h ============================================================================== --- head/lib/libtacplus/taclib_private.h Fri Dec 11 04:14:44 2009 (r200398) +++ head/lib/libtacplus/taclib_private.h Fri Dec 11 07:53:44 2009 (r200399) @@ -132,6 +132,26 @@ struct tac_author_response { unsigned char rest[1]; }; +struct tac_acct_start { + u_int8_t action; + u_int8_t authen_action; + u_int8_t priv_lvl; + u_int8_t authen_type; + u_int8_t authen_service; + u_int8_t user_len; + u_int8_t port_len; + u_int8_t rem_addr_len; + u_int8_t av_cnt; + unsigned char rest[1]; +}; + +struct tac_acct_reply { + u_int16_t msg_len; + u_int16_t data_len; + u_int8_t status; + unsigned char rest[1]; +}; + struct tac_msg { u_int8_t version; u_int8_t type; @@ -145,6 +165,8 @@ struct tac_msg { struct tac_authen_cont authen_cont; struct tac_author_request author_request; struct tac_author_response author_response; + struct tac_acct_start acct_start; + struct tac_acct_reply acct_reply; unsigned char body[BODYSIZE]; } u; }; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 10:35:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA9991065672; Fri, 11 Dec 2009 10:35:58 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9B228FC1A; Fri, 11 Dec 2009 10:35: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 nBBAZws4005807; Fri, 11 Dec 2009 10:35:58 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBAZwYA005805; Fri, 11 Dec 2009 10:35:58 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912111035.nBBAZwYA005805@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 11 Dec 2009 10:35: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: r200403 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 10:35:58 -0000 Author: luigi Date: Fri Dec 11 10:35:58 2009 New Revision: 200403 URL: http://svn.freebsd.org/changeset/base/200403 Log: only export bio_cmd and flags to userland (bio_cmd are used by ggatectl, flags are potentially useful). Other parts are internal kernel data structures and should not be visible to userland. No API change involved. MFC after: 3 days Modified: head/sys/sys/bio.h Modified: head/sys/sys/bio.h ============================================================================== --- head/sys/sys/bio.h Fri Dec 11 07:56:37 2009 (r200402) +++ head/sys/sys/bio.h Fri Dec 11 10:35:58 2009 (r200403) @@ -40,6 +40,22 @@ #include +/* bio_cmd */ +#define BIO_READ 0x01 +#define BIO_WRITE 0x02 +#define BIO_DELETE 0x04 +#define BIO_GETATTR 0x08 +#define BIO_FLUSH 0x10 +#define BIO_CMD0 0x20 /* Available for local hacks */ +#define BIO_CMD1 0x40 /* Available for local hacks */ +#define BIO_CMD2 0x80 /* Available for local hacks */ + +/* bio_flags */ +#define BIO_ERROR 0x01 +#define BIO_DONE 0x02 +#define BIO_ONQUEUE 0x04 + +#ifdef _KERNEL struct disk; struct bio; @@ -95,23 +111,6 @@ struct bio { daddr_t bio_pblkno; /* physical block number */ }; -/* bio_cmd */ -#define BIO_READ 0x01 -#define BIO_WRITE 0x02 -#define BIO_DELETE 0x04 -#define BIO_GETATTR 0x08 -#define BIO_FLUSH 0x10 -#define BIO_CMD0 0x20 /* Available for local hacks */ -#define BIO_CMD1 0x40 /* Available for local hacks */ -#define BIO_CMD2 0x80 /* Available for local hacks */ - -/* bio_flags */ -#define BIO_ERROR 0x01 -#define BIO_DONE 0x02 -#define BIO_ONQUEUE 0x04 - -#ifdef _KERNEL - struct uio; struct devstat; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 11:07:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030321065672; Fri, 11 Dec 2009 11:07: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 E53C58FC0C; Fri, 11 Dec 2009 11: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 nBBB75rV006493; Fri, 11 Dec 2009 11:07:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBB75gE006491; Fri, 11 Dec 2009 11:07:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912111107.nBBB75gE006491@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Dec 2009 11:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200404 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 11:07:06 -0000 Author: kib Date: Fri Dec 11 11:07:05 2009 New Revision: 200404 URL: http://svn.freebsd.org/changeset/base/200404 Log: MFC r200111: Add several syscall compat32 entries for acl manipulation. Modified: stable/8/sys/compat/freebsd32/syscalls.master Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/8/sys/compat/freebsd32/syscalls.master Fri Dec 11 10:35:58 2009 (r200403) +++ stable/8/sys/compat/freebsd32/syscalls.master Fri Dec 11 11:07:05 2009 (r200404) @@ -740,10 +740,14 @@ struct freebsd32_ucontext *oucp, \ const struct freebsd32_ucontext *ucp); } 424 AUE_SWAPOFF UNIMPL swapoff -425 AUE_NULL UNIMPL __acl_get_link -426 AUE_NULL UNIMPL __acl_set_link -427 AUE_NULL UNIMPL __acl_delete_link -428 AUE_NULL UNIMPL __acl_aclcheck_link +425 AUE_NULL NOPROTO { int __acl_get_link(const char *path, \ + acl_type_t type, struct acl *aclp); } +426 AUE_NULL NOPROTO { int __acl_set_link(const char *path, \ + acl_type_t type, struct acl *aclp); } +427 AUE_NULL NOPROTO { int __acl_delete_link(const char *path, \ + acl_type_t type); } +428 AUE_NULL NOPROTO { int __acl_aclcheck_link(const char *path, \ + acl_type_t type, struct acl *aclp); } 429 AUE_SIGWAIT NOPROTO { int sigwait(const sigset_t *set, \ int *sig); } 430 AUE_NULL UNIMPL thr_create; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 11:07:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4268E106568D; Fri, 11 Dec 2009 11:07:49 +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 2FF918FC13; Fri, 11 Dec 2009 11: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 nBBB7ngC006540; Fri, 11 Dec 2009 11:07:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBB7n5Q006535; Fri, 11 Dec 2009 11:07:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912111107.nBBB7n5Q006535@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Dec 2009 11:07:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200405 - stable/8/sys/compat/freebsd32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 11:07:49 -0000 Author: kib Date: Fri Dec 11 11:07:48 2009 New Revision: 200405 URL: http://svn.freebsd.org/changeset/base/200405 Log: Regen Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Fri Dec 11 11:07:05 2009 (r200404) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Fri Dec 11 11:07:48 2009 (r200405) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Fri Dec 11 11:07:05 2009 (r200404) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Fri Dec 11 11:07:48 2009 (r200405) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -311,6 +311,10 @@ #define FREEBSD32_SYS_freebsd32_getcontext 421 #define FREEBSD32_SYS_freebsd32_setcontext 422 #define FREEBSD32_SYS_freebsd32_swapcontext 423 +#define FREEBSD32_SYS___acl_get_link 425 +#define FREEBSD32_SYS___acl_set_link 426 +#define FREEBSD32_SYS___acl_delete_link 427 +#define FREEBSD32_SYS___acl_aclcheck_link 428 #define FREEBSD32_SYS_sigwait 429 #define FREEBSD32_SYS_thr_exit 431 #define FREEBSD32_SYS_thr_self 432 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Fri Dec 11 11:07:05 2009 (r200404) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Fri Dec 11 11:07:48 2009 (r200405) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib */ const char *freebsd32_syscallnames[] = { @@ -432,10 +432,10 @@ const char *freebsd32_syscallnames[] = { "freebsd32_setcontext", /* 422 = freebsd32_setcontext */ "freebsd32_swapcontext", /* 423 = freebsd32_swapcontext */ "#424", /* 424 = swapoff */ - "#425", /* 425 = __acl_get_link */ - "#426", /* 426 = __acl_set_link */ - "#427", /* 427 = __acl_delete_link */ - "#428", /* 428 = __acl_aclcheck_link */ + "__acl_get_link", /* 425 = __acl_get_link */ + "__acl_set_link", /* 426 = __acl_set_link */ + "__acl_delete_link", /* 427 = __acl_delete_link */ + "__acl_aclcheck_link", /* 428 = __acl_aclcheck_link */ "sigwait", /* 429 = sigwait */ "#430", /* 430 = thr_create; */ "thr_exit", /* 431 = thr_exit */ Modified: stable/8/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/8/sys/compat/freebsd32/freebsd32_sysent.c Fri Dec 11 11:07:05 2009 (r200404) +++ stable/8/sys/compat/freebsd32/freebsd32_sysent.c Fri Dec 11 11:07:48 2009 (r200405) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 195468 2009-07-08 16:26:43Z trasz + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 200404 2009-12-11 11:07:05Z kib */ #include "opt_compat.h" @@ -469,10 +469,10 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_setcontext_args), (sy_call_t *)freebsd32_setcontext, AUE_NULL, NULL, 0, 0, 0 }, /* 422 = freebsd32_setcontext */ { AS(freebsd32_swapcontext_args), (sy_call_t *)freebsd32_swapcontext, AUE_NULL, NULL, 0, 0, 0 }, /* 423 = freebsd32_swapcontext */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 424 = swapoff */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 425 = __acl_get_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 426 = __acl_set_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 427 = __acl_delete_link */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 428 = __acl_aclcheck_link */ + { AS(__acl_get_link_args), (sy_call_t *)__acl_get_link, AUE_NULL, NULL, 0, 0, 0 }, /* 425 = __acl_get_link */ + { AS(__acl_set_link_args), (sy_call_t *)__acl_set_link, AUE_NULL, NULL, 0, 0, 0 }, /* 426 = __acl_set_link */ + { AS(__acl_delete_link_args), (sy_call_t *)__acl_delete_link, AUE_NULL, NULL, 0, 0, 0 }, /* 427 = __acl_delete_link */ + { AS(__acl_aclcheck_link_args), (sy_call_t *)__acl_aclcheck_link, AUE_NULL, NULL, 0, 0, 0 }, /* 428 = __acl_aclcheck_link */ { AS(sigwait_args), (sy_call_t *)sigwait, AUE_SIGWAIT, NULL, 0, 0, 0 }, /* 429 = sigwait */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 430 = thr_create; */ { AS(thr_exit_args), (sy_call_t *)thr_exit, AUE_NULL, NULL, 0, 0, 0 }, /* 431 = thr_exit */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 11:57:15 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E085106566B; Fri, 11 Dec 2009 11:57:15 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 056A88FC08; Fri, 11 Dec 2009 11:57:14 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 1F9916D41D; Fri, 11 Dec 2009 11:57:13 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id E9DFA844E9; Fri, 11 Dec 2009 12:57:12 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Roman Divacky References: <200912031802.nB3I2txS021472@svn.freebsd.org> <20091210163118.GA66146@lizard.fafoe.narf.at> <20091210173231.GA93327@freebsd.org> Date: Fri, 11 Dec 2009 12:57:12 +0100 In-Reply-To: <20091210173231.GA93327@freebsd.org> (Roman Divacky's message of "Thu, 10 Dec 2009 18:32:31 +0100") Message-ID: <86k4wtn2p3.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Stefan Farfeleder , src-committers@FreeBSD.org Subject: Re: svn commit: r200068 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 11:57:15 -0000 Roman Divacky writes: > Stefan Farfeleder wrote: > > For me this breaks the ooo-3 build with: > >=20 > > unzip: -n, -o and -u are contradictory > >=20 > > The failing command is 'unzip -quo jurt_src.zip'. > > I dont see a reason why this check is there: > > if (n_opt + o_opt + u_opt > 1) > errorx("-n, -o and -u are contradictory"); > > > dag, can you comment? s/dag/des/, please. The bug is in OOo. If you look at extract_file(), you'll see that these three options are handled in three separate branches of a multi-branch if. -n means "never overwrite" -o means "always overwrite" -u means "sometimes overwrite" so -uo does not make much sense, and -n along with either -u or -o does not make any sense whatsoever. > /usr/local/bin/unzip seems to accept those together happilly.. You should check if: a) -uo gives the same result as -u b) -uo gives the same result as -o c) -ou gives the same result as -u d) -ou gives the same result as -o e) -uo and -ou give the same result My guess would be either bc or bde. In either case, there is a risk that this is not what the user wanted, so IMHO the best solution is to not do anything at all. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 12:36:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4624E1065701; Fri, 11 Dec 2009 12:36:03 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 327E28FC15; Fri, 11 Dec 2009 12:36: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 nBBCa3cR008579; Fri, 11 Dec 2009 12:36:03 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBCa3rY008576; Fri, 11 Dec 2009 12:36:03 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912111236.nBBCa3rY008576@svn.freebsd.org> From: Fabien Thomas Date: Fri, 11 Dec 2009 12:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200406 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:36:03 -0000 Author: fabient Date: Fri Dec 11 12:36:02 2009 New Revision: 200406 URL: http://svn.freebsd.org/changeset/base/200406 Log: MFC 196739: Add counters for the i7 architecture which were accidentally left out of the original commit of i7 support. These are all the counters on pages A-32 and A-33 of the _Intel(R) 64 and IA32 Architectures Software Developer's Manual Vol 3B_, June 2009. Almost all of these counters relate to operations on the L2 cache. Modified: stable/8/sys/dev/hwpmc/hwpmc_core.c stable/8/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/8/sys/dev/hwpmc/hwpmc_core.c Fri Dec 11 11:07:48 2009 (r200405) +++ stable/8/sys/dev/hwpmc/hwpmc_core.c Fri Dec 11 12:36:02 2009 (r200406) @@ -1182,6 +1182,29 @@ static struct iap_event_descr iap_events IAPDESCR(DBH_01H, 0xDB, 0x01, IAP_F_FM | IAP_F_I7), IAPDESCR(E4H_01H, 0xE4, 0x01, IAP_F_FM | IAP_F_I7), IAPDESCR(E5H_01H, 0xE5, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(E6H_01H, 0xE6, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(E6H_02H, 0xE6, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_01H, 0xE8, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_02H, 0xE8, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_03H, 0xE8, 0x03, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_01H, 0xF0, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_02H, 0xF0, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_04H, 0xF0, 0x04, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_08H, 0xF0, 0x08, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_10H, 0xF0, 0x10, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_20H, 0xF0, 0x20, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_40H, 0xF0, 0x40, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_80H, 0xF0, 0x80, IAP_F_FM | IAP_F_I7), + IAPDESCR(F1H_02H, 0xF1, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(F1H_04H, 0xF1, 0x04, IAP_F_FM | IAP_F_I7), + IAPDESCR(F1H_07H, 0xF1, 0x07, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_01H, 0xF2, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_02H, 0xF2, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_04H, 0xF2, 0x04, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_08H, 0xF2, 0x08, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_0FH, 0xF2, 0x0F, IAP_F_FM | IAP_F_I7), + IAPDESCR(F3H_01H, 0xF3, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(F3H_02H, 0xF3, 0x02, IAP_F_FM | IAP_F_I7), IAPDESCR(F3H_04H, 0xF3, 0x04, IAP_F_FM | IAP_F_I7), IAPDESCR(F3H_08H, 0xF3, 0x08, IAP_F_FM | IAP_F_I7), IAPDESCR(F3H_10H, 0xF3, 0x10, IAP_F_FM | IAP_F_I7), Modified: stable/8/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/8/sys/dev/hwpmc/pmc_events.h Fri Dec 11 11:07:48 2009 (r200405) +++ stable/8/sys/dev/hwpmc/pmc_events.h Fri Dec 11 12:36:02 2009 (r200406) @@ -29,8 +29,18 @@ #ifndef _DEV_HWPMC_PMC_EVENTS_H_ #define _DEV_HWPMC_PMC_EVENTS_H_ -/* - * PMC event codes. +/* + * Note: Documentation on adding events can be found both in + * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms + * as well as on-line at: + * + * http://wiki.freebsd.org/PmcTools/PmcHardwareHowTo + * + * Please refer to those resources before you attempt to modify + * this file or the hwpmc driver/subsystem. + */ + +/* * PMC event codes. * * __PMC_EV(CLASS, SYMBOLIC-NAME) * @@ -973,7 +983,30 @@ __PMC_EV(IAP, EVENT_FDH_04H) \ __PMC_EV(IAP, EVENT_FDH_08H) \ __PMC_EV(IAP, EVENT_FDH_10H) \ __PMC_EV(IAP, EVENT_FDH_20H) \ -__PMC_EV(IAP, EVENT_FDH_40H) +__PMC_EV(IAP, EVENT_FDH_40H) \ +__PMC_EV(IAP, EVENT_E6H_02H) \ +__PMC_EV(IAP, EVENT_E8H_01H) \ +__PMC_EV(IAP, EVENT_E8H_02H) \ +__PMC_EV(IAP, EVENT_E8H_03H) \ +__PMC_EV(IAP, EVENT_F0H_01H) \ +__PMC_EV(IAP, EVENT_F0H_02H) \ +__PMC_EV(IAP, EVENT_F0H_04H) \ +__PMC_EV(IAP, EVENT_F0H_08H) \ +__PMC_EV(IAP, EVENT_F0H_10H) \ +__PMC_EV(IAP, EVENT_F0H_20H) \ +__PMC_EV(IAP, EVENT_F0H_40H) \ +__PMC_EV(IAP, EVENT_F0H_80H) \ +__PMC_EV(IAP, EVENT_F1H_02H) \ +__PMC_EV(IAP, EVENT_F1H_04H) \ +__PMC_EV(IAP, EVENT_F1H_07H) \ +__PMC_EV(IAP, EVENT_F2H_01H) \ +__PMC_EV(IAP, EVENT_F2H_02H) \ +__PMC_EV(IAP, EVENT_F2H_04H) \ +__PMC_EV(IAP, EVENT_F2H_08H) \ +__PMC_EV(IAP, EVENT_F2H_0FH) \ +__PMC_EV(IAP, EVENT_F3H_01H) \ +__PMC_EV(IAP, EVENT_F3H_02H) + #define PMC_EV_IAP_FIRST PMC_EV_IAP_EVENT_02H_81H #define PMC_EV_IAP_LAST PMC_EV_IAP_EVENT_FDH_40H @@ -1894,6 +1927,29 @@ __PMC_EV_ALIAS("UOP_UNFUSION", IAP_EV __PMC_EV_ALIAS("BR_INST_DECODED", IAP_EVENT_E0H_01H) \ __PMC_EV_ALIAS("BOGUS_BR", IAP_EVENT_E4H_01H) \ __PMC_EV_ALIAS("BPU_MISSED_CALL_RET", IAP_EVENT_E5H_01H) \ +__PMC_EV_ALIAS("BACLEAR.CLEAR", IAP_EVENT_E6H_01H) \ +__PMC_EV_ALIAS("BACLEAR.BAD_TARGET", IAP_EVENT_E6H_02H) \ +__PMC_EV_ALIAS("BPU_CLEARS.EARLY", IAP_EVENT_E8H_01H) \ +__PMC_EV_ALIAS("BPU_CLEARS.LATE", IAP_EVENT_E8H_02H) \ +__PMC_EV_ALIAS("BPU_CLEARS.ANY", IAP_EVENT_E8H_03H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.LOAD", IAP_EVENT_F0H_01H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.RFO", IAP_EVENT_F0H_02H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.IFETCH", IAP_EVENT_F0H_04H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.PREFETCH", IAP_EVENT_F0H_08H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.L1D_WB", IAP_EVENT_F0H_10H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.FILL", IAP_EVENT_F0H_20H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.WB", IAP_EVENT_F0H_40H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.ANY", IAP_EVENT_F0H_80H) \ +__PMC_EV_ALIAS("L2_LINES_IN.S_STATE", IAP_EVENT_F1H_02H) \ +__PMC_EV_ALIAS("L2_LINES_IN.E_STATE", IAP_EVENT_F1H_04H) \ +__PMC_EV_ALIAS("L2_LINES_IN.ANY", IAP_EVENT_F1H_07H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_01H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRTY", IAP_EVENT_F2H_02H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.PREFETCH_CLEAN", IAP_EVENT_F2H_04H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.PREFETCH_DIRTY", IAP_EVENT_F2H_08H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.ANY", IAP_EVENT_F2H_0FH) \ +__PMC_EV_ALIAS("L2_HW_PREFETCH.HIT", IAP_EVENT_F3H_01H) \ +__PMC_EV_ALIAS("L2_HW_PREFETCH.ALLOC", IAP_EVENT_F3H_02H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.DATA_TRIGGER", IAP_EVENT_F3H_04H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.CODE_TRIGGER", IAP_EVENT_F3H_08H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.DCA_TRIGGER", IAP_EVENT_F3H_10H) \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 12:36:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AF6D10656A5; Fri, 11 Dec 2009 12:36:59 +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 68D908FC26; Fri, 11 Dec 2009 12:36: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 nBBCaxHb008647; Fri, 11 Dec 2009 12:36:59 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBCaxgn008638; Fri, 11 Dec 2009 12:36:59 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912111236.nBBCaxgn008638@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 11 Dec 2009 12:36: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: r200407 - head/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:36:59 -0000 Author: nyan Date: Fri Dec 11 12:36:59 2009 New Revision: 200407 URL: http://svn.freebsd.org/changeset/base/200407 Log: 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. MFC after: 1 week Modified: head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/boot2/bios.S head/sys/boot/pc98/boot2/boot.c head/sys/boot/pc98/boot2/boot.h head/sys/boot/pc98/boot2/disk.c head/sys/boot/pc98/boot2/io.c head/sys/boot/pc98/boot2/serial_16550.S head/sys/boot/pc98/boot2/sys.c Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/Makefile Fri Dec 11 12:36:59 2009 (r200407) @@ -28,6 +28,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: head/sys/boot/pc98/boot2/bios.S ============================================================================== --- head/sys/boot/pc98/boot2/bios.S Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/bios.S Fri Dec 11 12:36:59 2009 (r200407) @@ -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: head/sys/boot/pc98/boot2/boot.c ============================================================================== --- head/sys/boot/pc98/boot2/boot.c Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/boot.c Fri Dec 11 12:36:59 2009 (r200407) @@ -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: head/sys/boot/pc98/boot2/boot.h ============================================================================== --- head/sys/boot/pc98/boot2/boot.h Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/boot.h Fri Dec 11 12:36:59 2009 (r200407) @@ -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: head/sys/boot/pc98/boot2/disk.c ============================================================================== --- head/sys/boot/pc98/boot2/disk.c Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/disk.c Fri Dec 11 12:36:59 2009 (r200407) @@ -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: head/sys/boot/pc98/boot2/io.c ============================================================================== --- head/sys/boot/pc98/boot2/io.c Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/io.c Fri Dec 11 12:36:59 2009 (r200407) @@ -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: head/sys/boot/pc98/boot2/serial_16550.S ============================================================================== --- head/sys/boot/pc98/boot2/serial_16550.S Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/serial_16550.S Fri Dec 11 12:36:59 2009 (r200407) @@ -67,7 +67,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFT .file "serial.S" -#include #include "asm.h" .text Modified: head/sys/boot/pc98/boot2/sys.c ============================================================================== --- head/sys/boot/pc98/boot2/sys.c Fri Dec 11 12:36:02 2009 (r200406) +++ head/sys/boot/pc98/boot2/sys.c Fri Dec 11 12:36:59 2009 (r200407) @@ -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-all@FreeBSD.ORG Fri Dec 11 12:38:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D9810656A6; Fri, 11 Dec 2009 12:38:16 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1418FC2D; Fri, 11 Dec 2009 12:38: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 nBBCcG2P008708; Fri, 11 Dec 2009 12:38:16 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBCcGIs008705; Fri, 11 Dec 2009 12:38:16 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912111238.nBBCcGIs008705@svn.freebsd.org> From: Fabien Thomas Date: Fri, 11 Dec 2009 12:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200408 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:38:16 -0000 Author: fabient Date: Fri Dec 11 12:38:15 2009 New Revision: 200408 URL: http://svn.freebsd.org/changeset/base/200408 Log: MFC 196739: Add counters for the i7 architecture which were accidentally left out of the original commit of i7 support. These are all the counters on pages A-32 and A-33 of the _Intel(R) 64 and IA32 Architectures Software Developer's Manual Vol 3B_, June 2009. Almost all of these counters relate to operations on the L2 cache. Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c stable/7/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_core.c Fri Dec 11 12:36:59 2009 (r200407) +++ stable/7/sys/dev/hwpmc/hwpmc_core.c Fri Dec 11 12:38:15 2009 (r200408) @@ -1182,6 +1182,29 @@ static struct iap_event_descr iap_events IAPDESCR(DBH_01H, 0xDB, 0x01, IAP_F_FM | IAP_F_I7), IAPDESCR(E4H_01H, 0xE4, 0x01, IAP_F_FM | IAP_F_I7), IAPDESCR(E5H_01H, 0xE5, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(E6H_01H, 0xE6, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(E6H_02H, 0xE6, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_01H, 0xE8, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_02H, 0xE8, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(E8H_03H, 0xE8, 0x03, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_01H, 0xF0, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_02H, 0xF0, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_04H, 0xF0, 0x04, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_08H, 0xF0, 0x08, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_10H, 0xF0, 0x10, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_20H, 0xF0, 0x20, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_40H, 0xF0, 0x40, IAP_F_FM | IAP_F_I7), + IAPDESCR(F0H_80H, 0xF0, 0x80, IAP_F_FM | IAP_F_I7), + IAPDESCR(F1H_02H, 0xF1, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(F1H_04H, 0xF1, 0x04, IAP_F_FM | IAP_F_I7), + IAPDESCR(F1H_07H, 0xF1, 0x07, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_01H, 0xF2, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_02H, 0xF2, 0x02, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_04H, 0xF2, 0x04, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_08H, 0xF2, 0x08, IAP_F_FM | IAP_F_I7), + IAPDESCR(F2H_0FH, 0xF2, 0x0F, IAP_F_FM | IAP_F_I7), + IAPDESCR(F3H_01H, 0xF3, 0x01, IAP_F_FM | IAP_F_I7), + IAPDESCR(F3H_02H, 0xF3, 0x02, IAP_F_FM | IAP_F_I7), IAPDESCR(F3H_04H, 0xF3, 0x04, IAP_F_FM | IAP_F_I7), IAPDESCR(F3H_08H, 0xF3, 0x08, IAP_F_FM | IAP_F_I7), IAPDESCR(F3H_10H, 0xF3, 0x10, IAP_F_FM | IAP_F_I7), Modified: stable/7/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/7/sys/dev/hwpmc/pmc_events.h Fri Dec 11 12:36:59 2009 (r200407) +++ stable/7/sys/dev/hwpmc/pmc_events.h Fri Dec 11 12:38:15 2009 (r200408) @@ -29,8 +29,18 @@ #ifndef _DEV_HWPMC_PMC_EVENTS_H_ #define _DEV_HWPMC_PMC_EVENTS_H_ -/* - * PMC event codes. +/* + * Note: Documentation on adding events can be found both in + * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms + * as well as on-line at: + * + * http://wiki.freebsd.org/PmcTools/PmcHardwareHowTo + * + * Please refer to those resources before you attempt to modify + * this file or the hwpmc driver/subsystem. + */ + +/* * PMC event codes. * * __PMC_EV(CLASS, SYMBOLIC-NAME) * @@ -973,7 +983,30 @@ __PMC_EV(IAP, EVENT_FDH_04H) \ __PMC_EV(IAP, EVENT_FDH_08H) \ __PMC_EV(IAP, EVENT_FDH_10H) \ __PMC_EV(IAP, EVENT_FDH_20H) \ -__PMC_EV(IAP, EVENT_FDH_40H) +__PMC_EV(IAP, EVENT_FDH_40H) \ +__PMC_EV(IAP, EVENT_E6H_02H) \ +__PMC_EV(IAP, EVENT_E8H_01H) \ +__PMC_EV(IAP, EVENT_E8H_02H) \ +__PMC_EV(IAP, EVENT_E8H_03H) \ +__PMC_EV(IAP, EVENT_F0H_01H) \ +__PMC_EV(IAP, EVENT_F0H_02H) \ +__PMC_EV(IAP, EVENT_F0H_04H) \ +__PMC_EV(IAP, EVENT_F0H_08H) \ +__PMC_EV(IAP, EVENT_F0H_10H) \ +__PMC_EV(IAP, EVENT_F0H_20H) \ +__PMC_EV(IAP, EVENT_F0H_40H) \ +__PMC_EV(IAP, EVENT_F0H_80H) \ +__PMC_EV(IAP, EVENT_F1H_02H) \ +__PMC_EV(IAP, EVENT_F1H_04H) \ +__PMC_EV(IAP, EVENT_F1H_07H) \ +__PMC_EV(IAP, EVENT_F2H_01H) \ +__PMC_EV(IAP, EVENT_F2H_02H) \ +__PMC_EV(IAP, EVENT_F2H_04H) \ +__PMC_EV(IAP, EVENT_F2H_08H) \ +__PMC_EV(IAP, EVENT_F2H_0FH) \ +__PMC_EV(IAP, EVENT_F3H_01H) \ +__PMC_EV(IAP, EVENT_F3H_02H) + #define PMC_EV_IAP_FIRST PMC_EV_IAP_EVENT_02H_81H #define PMC_EV_IAP_LAST PMC_EV_IAP_EVENT_FDH_40H @@ -1894,6 +1927,29 @@ __PMC_EV_ALIAS("UOP_UNFUSION", IAP_EV __PMC_EV_ALIAS("BR_INST_DECODED", IAP_EVENT_E0H_01H) \ __PMC_EV_ALIAS("BOGUS_BR", IAP_EVENT_E4H_01H) \ __PMC_EV_ALIAS("BPU_MISSED_CALL_RET", IAP_EVENT_E5H_01H) \ +__PMC_EV_ALIAS("BACLEAR.CLEAR", IAP_EVENT_E6H_01H) \ +__PMC_EV_ALIAS("BACLEAR.BAD_TARGET", IAP_EVENT_E6H_02H) \ +__PMC_EV_ALIAS("BPU_CLEARS.EARLY", IAP_EVENT_E8H_01H) \ +__PMC_EV_ALIAS("BPU_CLEARS.LATE", IAP_EVENT_E8H_02H) \ +__PMC_EV_ALIAS("BPU_CLEARS.ANY", IAP_EVENT_E8H_03H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.LOAD", IAP_EVENT_F0H_01H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.RFO", IAP_EVENT_F0H_02H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.IFETCH", IAP_EVENT_F0H_04H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.PREFETCH", IAP_EVENT_F0H_08H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.L1D_WB", IAP_EVENT_F0H_10H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.FILL", IAP_EVENT_F0H_20H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.WB", IAP_EVENT_F0H_40H) \ +__PMC_EV_ALIAS("L2_TRANSACTIONS.ANY", IAP_EVENT_F0H_80H) \ +__PMC_EV_ALIAS("L2_LINES_IN.S_STATE", IAP_EVENT_F1H_02H) \ +__PMC_EV_ALIAS("L2_LINES_IN.E_STATE", IAP_EVENT_F1H_04H) \ +__PMC_EV_ALIAS("L2_LINES_IN.ANY", IAP_EVENT_F1H_07H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_CLEAN", IAP_EVENT_F2H_01H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.DEMAND_DIRTY", IAP_EVENT_F2H_02H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.PREFETCH_CLEAN", IAP_EVENT_F2H_04H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.PREFETCH_DIRTY", IAP_EVENT_F2H_08H) \ +__PMC_EV_ALIAS("L2_LINES_OUT.ANY", IAP_EVENT_F2H_0FH) \ +__PMC_EV_ALIAS("L2_HW_PREFETCH.HIT", IAP_EVENT_F3H_01H) \ +__PMC_EV_ALIAS("L2_HW_PREFETCH.ALLOC", IAP_EVENT_F3H_02H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.DATA_TRIGGER", IAP_EVENT_F3H_04H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.CODE_TRIGGER", IAP_EVENT_F3H_08H) \ __PMC_EV_ALIAS("L2_HW_PREFETCH.DCA_TRIGGER", IAP_EVENT_F3H_10H) \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 12:44:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EA5B106566C; Fri, 11 Dec 2009 12:44:45 +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 1CB928FC08; Fri, 11 Dec 2009 12:44: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 nBBCij79009016; Fri, 11 Dec 2009 12:44:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBCiih6009014; Fri, 11 Dec 2009 12:44:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912111244.nBBCiih6009014@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 12:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200409 - stable/8/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:44:45 -0000 Author: mav Date: Fri Dec 11 12:44:44 2009 New Revision: 200409 URL: http://svn.freebsd.org/changeset/base/200409 Log: MFC r200353: Limit maximum I/O size, depending on command set supported by device. It is required to suppot non-LBA48 devices with MAXPHYS above 128K. Same is done in ada(4). Modified: stable/8/sys/dev/ata/ata-disk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-disk.c ============================================================================== --- stable/8/sys/dev/ata/ata-disk.c Fri Dec 11 12:38:15 2009 (r200408) +++ stable/8/sys/dev/ata/ata-disk.c Fri Dec 11 12:44:44 2009 (r200409) @@ -126,6 +126,10 @@ ad_attach(device_t dev) adp->disk->d_name = "ad"; adp->disk->d_drv1 = dev; adp->disk->d_maxsize = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS; + if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 65536 * DEV_BSIZE); + else /* 28bit ATA command limit */ + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 256 * DEV_BSIZE); adp->disk->d_sectorsize = DEV_BSIZE; adp->disk->d_mediasize = DEV_BSIZE * (off_t)adp->total_secs; adp->disk->d_fwsectors = adp->sectors; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 12:46:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3D28106566B; Fri, 11 Dec 2009 12:46:41 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A84658FC17; Fri, 11 Dec 2009 12:46: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 nBBCkfdp009132; Fri, 11 Dec 2009 12:46:41 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBCkfJ3009130; Fri, 11 Dec 2009 12:46:41 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <200912111246.nBBCkfJ3009130@svn.freebsd.org> From: Fabien Thomas Date: Fri, 11 Dec 2009 12:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200410 - stable/7/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:46:41 -0000 Author: fabient Date: Fri Dec 11 12:46:41 2009 New Revision: 200410 URL: http://svn.freebsd.org/changeset/base/200410 Log: MFC 193809: Fix parsing of Core2 event qualifiers. Modified: stable/7/lib/libpmc/libpmc.c Directory Properties: stable/7/lib/libpmc/ (props changed) Modified: stable/7/lib/libpmc/libpmc.c ============================================================================== --- stable/7/lib/libpmc/libpmc.c Fri Dec 11 12:44:44 2009 (r200409) +++ stable/7/lib/libpmc/libpmc.c Fri Dec 11 12:46:41 2009 (r200410) @@ -609,22 +609,22 @@ iap_allocate_pmc(enum pmc_event pe, char pmc_config->pm_caps |= PMC_CAP_USER; } else if (KWMATCH(p, IAP_KW_ANYTHREAD)) { pmc_config->pm_md.pm_iap.pm_iap_config |= IAP_ANY; - } else if (KWMATCH(p, IAP_KW_CORE)) { + } else if (KWPREFIXMATCH(p, IAP_KW_CORE "=")) { n = pmc_parse_mask(iap_core_mask, p, &evmask); if (n != 1) return (-1); - } else if (KWMATCH(p, IAP_KW_AGENT)) { + } else if (KWPREFIXMATCH(p, IAP_KW_AGENT "=")) { n = pmc_parse_mask(iap_agent_mask, p, &evmask); if (n != 1) return (-1); - } else if (KWMATCH(p, IAP_KW_PREFETCH)) { + } else if (KWPREFIXMATCH(p, IAP_KW_PREFETCH "=")) { n = pmc_parse_mask(iap_prefetch_mask, p, &evmask); if (n != 1) return (-1); - } else if (KWMATCH(p, IAP_KW_CACHESTATE)) { + } else if (KWPREFIXMATCH(p, IAP_KW_CACHESTATE "=")) { n = pmc_parse_mask(iap_cachestate_mask, p, &cachestate); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_CORE && - KWMATCH(p, IAP_KW_TRANSITION)) { + KWPREFIXMATCH(p, IAP_KW_TRANSITION "=")) { n = pmc_parse_mask(iap_transition_mask, p, &evmask); if (n != 1) return (-1); @@ -632,10 +632,10 @@ iap_allocate_pmc(enum pmc_event pe, char cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2 || cpu_info.pm_cputype == PMC_CPU_INTEL_CORE2EXTREME || cpu_info.pm_cputype == PMC_CPU_INTEL_COREI7) { - if (KWMATCH(p, IAP_KW_SNOOPRESPONSE)) { + if (KWPREFIXMATCH(p, IAP_KW_SNOOPRESPONSE "=")) { n = pmc_parse_mask(iap_snoopresponse_mask, p, &evmask); - } else if (KWMATCH(p, IAP_KW_SNOOPTYPE)) { + } else if (KWPREFIXMATCH(p, IAP_KW_SNOOPTYPE "=")) { n = pmc_parse_mask(iap_snooptype_mask, p, &evmask); } else From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 12:52:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D02106566C; Fri, 11 Dec 2009 12:52:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id CCE2D8FC1D; Fri, 11 Dec 2009 12:52:49 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4CC7741C6BB; Fri, 11 Dec 2009 13:52:48 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id chDQkc0qzgVp; Fri, 11 Dec 2009 13:52:47 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 7857641C6B4; Fri, 11 Dec 2009 13:52:47 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 699304448EC; Fri, 11 Dec 2009 12:52:28 +0000 (UTC) Date: Fri, 11 Dec 2009 12:52:28 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Shteryana Shopova In-Reply-To: <200912110753.nBB7rib9099418@svn.freebsd.org> Message-ID: <20091211124923.H83957@maildrop.int.zabbadoz.net> References: <200912110753.nBB7rib9099418@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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: r200399 - head/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:52:50 -0000 On Fri, 11 Dec 2009, Shteryana Shopova wrote: > Author: syrinx > Date: Fri Dec 11 07:53:44 2009 > New Revision: 200399 > URL: http://svn.freebsd.org/changeset/base/200399 > > Log: > Add support for TACACS+ accounting to libtacplus(3). > > Submitted by: Michael Pounov misho@aitbg.com > OKed by: emaste > > Modified: > head/lib/libtacplus/libtacplus.3 > head/lib/libtacplus/taclib.c > head/lib/libtacplus/taclib.h > head/lib/libtacplus/taclib_private.h > > Modified: head/lib/libtacplus/libtacplus.3 > ============================================================================== > --- head/lib/libtacplus/libtacplus.3 Fri Dec 11 04:14:44 2009 (r200398) > +++ head/lib/libtacplus/libtacplus.3 Fri Dec 11 07:53:44 2009 (r200399) Could you update the .Dd as well? /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 12:53:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61CB1065695; Fri, 11 Dec 2009 12:53:09 +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 B44558FC12; Fri, 11 Dec 2009 12:53: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 nBBCr9Qx009435; Fri, 11 Dec 2009 12:53:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBCr9FE009432; Fri, 11 Dec 2009 12:53:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912111253.nBBCr9FE009432@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 12:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200411 - in stable/8/sys/cam: . ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 12:53:09 -0000 Author: mav Date: Fri Dec 11 12:53:09 2009 New Revision: 200411 URL: http://svn.freebsd.org/changeset/base/200411 Log: MFC r200180: If we panicked with SIM lock held, do not try to flush caches. Extra lock recursing will not make debugging easier. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/cam_periph.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Fri Dec 11 12:46:41 2009 (r200410) +++ stable/8/sys/cam/ata/ata_da.c Fri Dec 11 12:53:09 2009 (r200411) @@ -1040,6 +1040,9 @@ adashutdown(void * arg, int howto) TAILQ_FOREACH(periph, &adadriver.units, unit_links) { union ccb ccb; + /* If we paniced with lock held - not recurse here. */ + if (cam_periph_owned(periph)) + continue; cam_periph_lock(periph); softc = (struct ada_softc *)periph->softc; /* Modified: stable/8/sys/cam/cam_periph.h ============================================================================== --- stable/8/sys/cam/cam_periph.h Fri Dec 11 12:46:41 2009 (r200410) +++ stable/8/sys/cam/cam_periph.h Fri Dec 11 12:53:09 2009 (r200411) @@ -190,5 +190,11 @@ cam_periph_unlock(struct cam_periph *per mtx_unlock(periph->sim->mtx); } +static __inline int +cam_periph_owned(struct cam_periph *periph) +{ + return (mtx_owned(periph->sim->mtx)); +} + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 13:05:09 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7892106566C; Fri, 11 Dec 2009 13:05:09 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A61E78FC12; Fri, 11 Dec 2009 13:05: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 nBBD59MS009855; Fri, 11 Dec 2009 13:05:09 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBD59TO009853; Fri, 11 Dec 2009 13:05:09 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912111305.nBBD59TO009853@svn.freebsd.org> From: Shteryana Shopova Date: Fri, 11 Dec 2009 13:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200412 - head/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 13:05:09 -0000 Author: syrinx Date: Fri Dec 11 13:05:09 2009 New Revision: 200412 URL: http://svn.freebsd.org/changeset/base/200412 Log: Bump the man page date to the date of the last update. Noticed by: bz Modified: head/lib/libtacplus/libtacplus.3 Modified: head/lib/libtacplus/libtacplus.3 ============================================================================== --- head/lib/libtacplus/libtacplus.3 Fri Dec 11 12:53:09 2009 (r200411) +++ head/lib/libtacplus/libtacplus.3 Fri Dec 11 13:05:09 2009 (r200412) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 1998 +.Dd December 11, 2009 .Dt LIBTACPLUS 3 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 13:14:15 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505741065676; Fri, 11 Dec 2009 13:14:15 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout0.freenet.de (mout0.freenet.de [IPv6:2001:748:100:40::2:2]) by mx1.freebsd.org (Postfix) with ESMTP id D656A8FC0C; Fri, 11 Dec 2009 13:14:14 +0000 (UTC) Received: from [195.4.92.25] (helo=15.mx.freenet.de) by mout0.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.70 #1) id 1NJ5K1-000634-HV; Fri, 11 Dec 2009 14:14:13 +0100 Received: from p57ae037d.dip0.t-ipconnect.de ([87.174.3.125]:31054 helo=ernst.jennejohn.org) by 15.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1NJ5K1-0001bi-2h; Fri, 11 Dec 2009 14:14:13 +0100 Date: Fri, 11 Dec 2009 14:14:12 +0100 From: Gary Jennejohn To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= Message-ID: <20091211141412.15afcf43@ernst.jennejohn.org> In-Reply-To: <86k4wtn2p3.fsf@ds4.des.no> References: <200912031802.nB3I2txS021472@svn.freebsd.org> <20091210163118.GA66146@lizard.fafoe.narf.at> <20091210173231.GA93327@freebsd.org> <86k4wtn2p3.fsf@ds4.des.no> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.16.2; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Roman Divacky , Stefan Farfeleder , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200068 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 13:14:15 -0000 On Fri, 11 Dec 2009 12:57:12 +0100 Dag-Erling Sm__rgrav wrote: > Roman Divacky writes: > > Stefan Farfeleder wrote: > > > For me this breaks the ooo-3 build with: > > > > > > unzip: -n, -o and -u are contradictory > > > > > > The failing command is 'unzip -quo jurt_src.zip'. > > > > I dont see a reason why this check is there: > > > > if (n_opt + o_opt + u_opt > 1) > > errorx("-n, -o and -u are contradictory"); > > > > > > dag, can you comment? > > s/dag/des/, please. > > The bug is in OOo. > > If you look at extract_file(), you'll see that these three options are > handled in three separate branches of a multi-branch if. > > -n means "never overwrite" > -o means "always overwrite" > -u means "sometimes overwrite" > > so -uo does not make much sense, and -n along with either -u or -o does > not make any sense whatsoever. > > > /usr/local/bin/unzip seems to accept those together happilly.. > > You should check if: > > a) -uo gives the same result as -u > b) -uo gives the same result as -o > c) -ou gives the same result as -u > d) -ou gives the same result as -o > e) -uo and -ou give the same result > > My guess would be either bc or bde. In either case, there is a risk > that this is not what the user wanted, so IMHO the best solution is to > not do anything at all. > root:ernst:~:bash:21> /usr/local/bin/unzip --help -u update files, create if necessary -n never overwrite existing files -o overwrite files WITHOUT prompting I deleted all but uon. -u has a totally different meaning. Evidently o and n can be combined without any problem. --- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 13:20:08 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18423106566C; Fri, 11 Dec 2009 13:20:08 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout2.freenet.de (mout2.freenet.de [IPv6:2001:748:100:40::2:4]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD788FC1E; Fri, 11 Dec 2009 13:20:07 +0000 (UTC) Received: from [195.4.92.18] (helo=8.mx.freenet.de) by mout2.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.70 #1) id 1NJ5Pi-0005NT-5J; Fri, 11 Dec 2009 14:20:06 +0100 Received: from p57ae037d.dip0.t-ipconnect.de ([87.174.3.125]:15484 helo=ernst.jennejohn.org) by 8.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1NJ5Ph-0007X1-LA; Fri, 11 Dec 2009 14:20:06 +0100 Date: Fri, 11 Dec 2009 14:20:04 +0100 From: Gary Jennejohn To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= Message-ID: <20091211142004.0ee07b93@ernst.jennejohn.org> In-Reply-To: <20091211141412.15afcf43@ernst.jennejohn.org> References: <200912031802.nB3I2txS021472@svn.freebsd.org> <20091210163118.GA66146@lizard.fafoe.narf.at> <20091210173231.GA93327@freebsd.org> <86k4wtn2p3.fsf@ds4.des.no> <20091211141412.15afcf43@ernst.jennejohn.org> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.16.2; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, Roman Divacky , Stefan, Farfeleder , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r200068 - head/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 13:20:08 -0000 On Fri, 11 Dec 2009 14:14:12 +0100 Gary Jennejohn wrote: > On Fri, 11 Dec 2009 12:57:12 +0100 > Dag-Erling Sm__rgrav wrote: > > > Roman Divacky writes: > > > Stefan Farfeleder wrote: > > > > For me this breaks the ooo-3 build with: > > > > > > > > unzip: -n, -o and -u are contradictory > > > > > > > > The failing command is 'unzip -quo jurt_src.zip'. > > > > > > I dont see a reason why this check is there: > > > > > > if (n_opt + o_opt + u_opt > 1) > > > errorx("-n, -o and -u are contradictory"); > > > > > > > > > dag, can you comment? > > > > s/dag/des/, please. > > > > The bug is in OOo. > > > > If you look at extract_file(), you'll see that these three options are > > handled in three separate branches of a multi-branch if. > > > > -n means "never overwrite" > > -o means "always overwrite" > > -u means "sometimes overwrite" > > > > so -uo does not make much sense, and -n along with either -u or -o does > > not make any sense whatsoever. > > > > > /usr/local/bin/unzip seems to accept those together happilly.. > > > > You should check if: > > > > a) -uo gives the same result as -u > > b) -uo gives the same result as -o > > c) -ou gives the same result as -u > > d) -ou gives the same result as -o > > e) -uo and -ou give the same result > > > > My guess would be either bc or bde. In either case, there is a risk > > that this is not what the user wanted, so IMHO the best solution is to > > not do anything at all. > > > > root:ernst:~:bash:21> /usr/local/bin/unzip --help > -u update files, create if necessary > -n never overwrite existing files > -o overwrite files WITHOUT prompting > > I deleted all but uon. > > -u has a totally different meaning. Evidently o and n can be combined without > any problem. > I meant to hit delete on this mail instead of send. I notice that -u actually means exactly the same thing for both versions. Too many buttons on claws-mail. --- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 13:31:03 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 626A71065676; Fri, 11 Dec 2009 13:31:03 +0000 (UTC) (envelope-from shteryana@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 984318FC12; Fri, 11 Dec 2009 13:31:02 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so290512eye.9 for ; Fri, 11 Dec 2009 05:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=D2PyfjgWE8cdeF7knQ8dXOa/tICHa0GI6uyGtA0x2uk=; b=BVLioyJzU2dfPcRm6ZkQo9WSOpXKBK4e1VZT4Q/kw2wzamOZaL6fQMY+dGc95X+QYC 6Ea5y0Qt9bITme06/3bVPtzwkOkWQV/Yw4GVrUbK+GOM7KV8916tul+fqs6z88d+xM2b 0t2yGqNqSE6nmbzodt5+kYe58rBY4wx/JdzUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=Wy8tJr4kerjpkHVubdodVznks5E8yD14+N2rh2bXC4E5G5/moYiw8mAuNV0BeAmFuk 1lhTrN9kLX1QOF2sD4MLwh8GXpYwdF9S3hcDxATsjx1sZfagqMzWpDXrr25YzvIiofkU pG2iohXA2x38FxQcwnHGohzSPVObrPRTJSpzc= MIME-Version: 1.0 Sender: shteryana@gmail.com Received: by 10.213.47.140 with SMTP id n12mr820499ebf.32.1260536840395; Fri, 11 Dec 2009 05:07:20 -0800 (PST) In-Reply-To: <20091211124923.H83957@maildrop.int.zabbadoz.net> References: <200912110753.nBB7rib9099418@svn.freebsd.org> <20091211124923.H83957@maildrop.int.zabbadoz.net> Date: Fri, 11 Dec 2009 15:07:20 +0200 X-Google-Sender-Auth: ef840673f70f17a3 Message-ID: <61b573980912110507g71152c29id0577d135b73cab3@mail.gmail.com> From: Shteryana Shopova To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200399 - head/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syrinx@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 13:31:03 -0000 On Fri, Dec 11, 2009 at 2:52 PM, Bjoern A. Zeeb wrote: > > > Could you update the .Dd as well? > Done, thanks! > From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 14:15:55 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE95C106566B; Fri, 11 Dec 2009 14:15:55 +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 CC36B8FC08; Fri, 11 Dec 2009 14:15: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 nBBEFtvP011308; Fri, 11 Dec 2009 14:15:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBEFtFg011303; Fri, 11 Dec 2009 14:15:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912111415.nBBEFtFg011303@svn.freebsd.org> From: Ed Schouten Date: Fri, 11 Dec 2009 14:15: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: r200413 - in head: . lib lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 14:15:56 -0000 Author: ed Date: Fri Dec 11 14:15:55 2009 New Revision: 200413 URL: http://svn.freebsd.org/changeset/base/200413 Log: Convert pam_lastlog(8) to libulog. The information used by the "Last login:"-line is obtained by using ulog_setutxfile(3) to switch to the lastlog database. Login and logout are performed using the utility functions ulog_login(3) and ulog_logout(3). This also means we must build libulog during bootstrap. Approved by: des Modified: head/Makefile.inc1 head/lib/Makefile head/lib/libpam/modules/pam_lastlog/Makefile head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Dec 11 13:05:09 2009 (r200412) +++ head/Makefile.inc1 Fri Dec 11 14:15:55 2009 (r200413) @@ -1103,8 +1103,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libkiconv lib/libkvm lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ - lib/libradius lib/libsbuf lib/libtacplus lib/libutil \ - ${_lib_libypclnt} lib/libz lib/msun \ + lib/libradius lib/libsbuf lib/libtacplus lib/libulog \ + lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} lib/libdwarf lib/libproc Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Fri Dec 11 13:05:09 2009 (r200412) +++ head/lib/Makefile Fri Dec 11 14:15:55 2009 (r200413) @@ -21,6 +21,7 @@ # librpcsvc must be built before libpam. # libsbuf must be built before libcam. # libtacplus must be built before libpam. +# libulog must be built before libpam. # libutil must be built before libpam. # libypclnt must be built before libpam. # libgssapi must be built before librpcsec_gss @@ -30,8 +31,8 @@ SUBDIR= ${_csu} libc libbsm libauditd libcom_err libcrypt libelf libkvm msun \ libmd \ ncurses ${_libnetgraph} libradius librpcsvc libsbuf \ - libtacplus libutil ${_libypclnt} libalias libarchive ${_libatm} \ - libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \ + libtacplus libulog libutil ${_libypclnt} libalias libarchive \ + ${_libatm} libbegemot ${_libbluetooth} ${_libbsnmp} libbz2 \ libcalendar libcam libcompat libdevinfo libdevstat libdisk \ libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \ ${_libgssapi} ${_librpcsec_gss} libipsec \ @@ -40,8 +41,8 @@ SUBDIR= ${_csu} libc libbsm libauditd li ${_libpmc} libproc librt ${_libsdp} ${_libsm} ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} libstand ${_libtelnet} ${_libthr} libthread_db libufs \ - libugidfw libulog ${_libusbhid} ${_libusb} ${_libvgl} libwrap \ - liby libz ${_bind} + libugidfw ${_libusbhid} ${_libusb} ${_libvgl} libwrap liby libz \ + ${_bind} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf Modified: head/lib/libpam/modules/pam_lastlog/Makefile ============================================================================== --- head/lib/libpam/modules/pam_lastlog/Makefile Fri Dec 11 13:05:09 2009 (r200412) +++ head/lib/libpam/modules/pam_lastlog/Makefile Fri Dec 11 14:15:55 2009 (r200413) @@ -28,7 +28,7 @@ LIB= pam_lastlog SRCS= pam_lastlog.c MAN= pam_lastlog.8 -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBULOG} +LDADD= -lulog .include Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Fri Dec 11 13:05:09 2009 (r200412) +++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Fri Dec 11 14:15:55 2009 (r200413) @@ -46,19 +46,9 @@ __FBSDID("$FreeBSD$"); #define _BSD_SOURCE -#include - -#include -#include -#include #include -#include -#include -#include -#include #include -#include -#include +#include #define PAM_SM_SESSION @@ -71,13 +61,11 @@ pam_sm_open_session(pam_handle_t *pamh, int argc __unused, const char *argv[] __unused) { struct passwd *pwd; - struct utmp utmp; - struct lastlog ll; + struct ulog_utmpx *utx; time_t t; const char *user; const void *rhost, *tty; - off_t llpos; - int fd, pam_err; + int pam_err; pam_err = pam_get_user(pamh, &user, NULL); if (pam_err != PAM_SUCCESS) @@ -101,72 +89,29 @@ pam_sm_open_session(pam_handle_t *pamh, pam_err = PAM_SERVICE_ERR; goto err; } - if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0) - tty = (const char *)tty + strlen(_PATH_DEV); - if (*(const char *)tty == '\0') - return (PAM_SERVICE_ERR); - fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT, 0644); - if (fd == -1) { - PAM_LOG("Failed to open %s", _PATH_LASTLOG); - goto file_err; - } - - /* - * Record session in lastlog(5). - */ - llpos = (off_t)(pwd->pw_uid * sizeof(ll)); - if (lseek(fd, llpos, L_SET) != llpos) - goto file_err; if ((flags & PAM_SILENT) == 0) { - if (read(fd, &ll, sizeof ll) == sizeof ll && ll.ll_time != 0) { - t = ll.ll_time; - if (*ll.ll_host != '\0') - pam_info(pamh, "Last login: %.*s from %.*s", - 24 - 5, ctime(&t), - (int)sizeof(ll.ll_host), ll.ll_host); - else - pam_info(pamh, "Last login: %.*s on %.*s", - 24 - 5, ctime(&t), - (int)sizeof(ll.ll_line), ll.ll_line); + if (ulog_setutxfile(UTXF_LASTLOG, NULL) != 0) { + PAM_LOG("Failed to open lastlog database"); + } else { + utx = ulog_getutxuser(user); + if (utx != NULL && utx->ut_type == USER_PROCESS) { + t = utx->ut_tv.tv_sec; + if (*utx->ut_host != '\0') + pam_info(pamh, "Last login: %.*s from %s", + 24 - 5, ctime(&t), utx->ut_host); + else + pam_info(pamh, "Last login: %.*s on %s", + 24 - 5, ctime(&t), utx->ut_line); + } + ulog_endutxent(); } - if (lseek(fd, llpos, L_SET) != llpos) - goto file_err; } - bzero(&ll, sizeof(ll)); - ll.ll_time = time(NULL); - - /* note: does not need to be NUL-terminated */ - strncpy(ll.ll_line, tty, sizeof(ll.ll_line)); - if (rhost != NULL && *(const char *)rhost != '\0') - /* note: does not need to be NUL-terminated */ - strncpy(ll.ll_host, rhost, sizeof(ll.ll_host)); - - if (write(fd, (char *)&ll, sizeof(ll)) != sizeof(ll) || close(fd) != 0) - goto file_err; - - PAM_LOG("Login recorded in %s", _PATH_LASTLOG); - - /* - * Record session in utmp(5) and wtmp(5). - */ - bzero(&utmp, sizeof(utmp)); - utmp.ut_time = time(NULL); - /* note: does not need to be NUL-terminated */ - strncpy(utmp.ut_name, user, sizeof(utmp.ut_name)); - if (rhost != NULL && *(const char *)rhost != '\0') - strncpy(utmp.ut_host, rhost, sizeof(utmp.ut_host)); - (void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); - login(&utmp); + ulog_login(tty, user, rhost); return (PAM_SUCCESS); -file_err: - syslog(LOG_ERR, "%s: %m", _PATH_LASTLOG); - if (fd != -1) - close(fd); - pam_err = PAM_SYSTEM_ERR; err: if (openpam_get_option(pamh, "no_fail")) return (PAM_SUCCESS); @@ -174,7 +119,7 @@ err: } PAM_EXTERN int -pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused, +pam_sm_close_session(pam_handle_t *pamh, int flags __unused, int argc __unused, const char *argv[] __unused) { const void *tty; @@ -188,14 +133,7 @@ pam_sm_close_session(pam_handle_t *pamh pam_err = PAM_SERVICE_ERR; goto err; } - if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0) - tty = (const char *)tty + strlen(_PATH_DEV); - if (*(const char *)tty == '\0') - return (PAM_SERVICE_ERR); - if (logout(tty) != 1) - syslog(LOG_ERR, "%s(): no utmp record for %s", - __func__, (const char *)tty); - logwtmp(tty, "", ""); + ulog_logout(tty); return (PAM_SUCCESS); err: From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 16:32:59 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5867106566C; Fri, 11 Dec 2009 16:32:59 +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 C4F298FC0C; Fri, 11 Dec 2009 16:32: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 nBBGWxFk014709; Fri, 11 Dec 2009 16:32:59 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBGWxEb014707; Fri, 11 Dec 2009 16:32:59 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912111632.nBBGWxEb014707@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Dec 2009 16:32: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: r200414 - head/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 16:32:59 -0000 Author: mav Date: Fri Dec 11 16:32:59 2009 New Revision: 200414 URL: http://svn.freebsd.org/changeset/base/200414 Log: CFA support doesn't exclude FLUSH support. Submitted by: Grzegorz Bernacki Modified: head/sys/dev/ata/ata-disk.c Modified: head/sys/dev/ata/ata-disk.c ============================================================================== --- head/sys/dev/ata/ata-disk.c Fri Dec 11 14:15:55 2009 (r200413) +++ head/sys/dev/ata/ata-disk.c Fri Dec 11 16:32:59 2009 (r200414) @@ -136,10 +136,10 @@ ad_attach(device_t dev) adp->disk->d_fwheads = adp->heads; adp->disk->d_unit = device_get_unit(dev); if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) - adp->disk->d_flags = DISKFLAG_CANFLUSHCACHE; + adp->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((atadev->param.support.command2 & ATA_SUPPORT_CFA) || atadev->param.config == ATA_PROTO_CFA) - adp->disk->d_flags = DISKFLAG_CANDELETE; + adp->disk->d_flags |= DISKFLAG_CANDELETE; strlcpy(adp->disk->d_ident, atadev->param.serial, sizeof(adp->disk->d_ident)); disk_create(adp->disk, DISK_VERSION); From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 18:20:13 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DABC51065676; Fri, 11 Dec 2009 18:20:13 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id 914B18FC15; Fri, 11 Dec 2009 18:20:13 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nBBIK7PD088230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Dec 2009 03:20:07 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sat, 12 Dec 2009 03:20:07 +0900 Message-ID: From: Hajimu UMEMOTO To: Ed Schouten In-Reply-To: <200912102225.nBAMPrZx076758@svn.freebsd.org> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-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.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Sat, 12 Dec 2009 03:20:08 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 18:20:13 -0000 Hi, >>>>> On Thu, 10 Dec 2009 22:25:53 +0000 (UTC) >>>>> Ed Schouten said: ed> Author: ed ed> Date: Thu Dec 10 22:25:53 2009 ed> New Revision: 200369 ed> URL: http://svn.freebsd.org/changeset/base/200369 ed> Log: ed> Update termcap entries for xterm. ed> ed> It turns out these entries do make Terminal.app behave a little better. ed> According to Thomas Dickey, Terminal.app should use TERM=nsterm anyway, ed> but we don't support this yet. Already having an improved termcap entry ed> helps, so I am going to MFC this change after all. ed> ed> Suggested by: Leonidas Tsampros ed> MFC after: 1 month ed> Modified: ed> head/etc/termcap.small ed> head/share/termcap/termcap.src It's great, thank!! I believe that our xterm entry was modified not to clear screen when applications such as less(1) are terminated. Are there any chance to back to the behavior? Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 19:36:10 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D626106568D; Fri, 11 Dec 2009 19:36:10 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE2A8FC22; Fri, 11 Dec 2009 19:36: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 nBBJaAGi018535; Fri, 11 Dec 2009 19:36:10 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBJaAQ3018533; Fri, 11 Dec 2009 19:36:10 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200912111936.nBBJaAQ3018533@svn.freebsd.org> From: Benedict Reuschling Date: Fri, 11 Dec 2009 19:36: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: r200415 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 19:36:10 -0000 Author: bcr (doc committer) Date: Fri Dec 11 19:36:10 2009 New Revision: 200415 URL: http://svn.freebsd.org/changeset/base/200415 Log: Reference the correct man page for firmware(9). PR: docs/140985 Submitted by: Glen Barber (glen dot j dot barber at gmail dot com) MFC after: 7 days Reviewed by: rpaulo Approved by: rpaulo, jkois (mentor) Modified: head/share/man/man4/iwnfw.4 Modified: head/share/man/man4/iwnfw.4 ============================================================================== --- head/share/man/man4/iwnfw.4 Fri Dec 11 16:32:59 2009 (r200414) +++ head/share/man/man4/iwnfw.4 Fri Dec 11 19:36:10 2009 (r200415) @@ -60,4 +60,4 @@ It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr iwn 4 , -.Xr firmware 8 +.Xr firmware 9 From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:03:36 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53AB2106566B; Fri, 11 Dec 2009 23:03:36 +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 296338FC14; Fri, 11 Dec 2009 23:03: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 nBBN3aVc022914; Fri, 11 Dec 2009 23:03:36 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBN3aer022912; Fri, 11 Dec 2009 23:03:36 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912112303.nBBN3aer022912@svn.freebsd.org> From: Doug Barton Date: Fri, 11 Dec 2009 23:03: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: r200416 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:03:36 -0000 Author: dougb Date: Fri Dec 11 23:03:35 2009 New Revision: 200416 URL: http://svn.freebsd.org/changeset/base/200416 Log: Simplify handling of MTREEFILE relative to DESTDIR Make the message about a missing MTREEFILE combined with -U more informative Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Fri Dec 11 19:36:10 2009 (r200415) +++ head/usr.sbin/mergemaster/mergemaster.sh Fri Dec 11 23:03:35 2009 (r200416) @@ -263,7 +263,7 @@ fi # Assign the location of the mtree database # -MTREEDB=${MTREEDB:-/var/db} +MTREEDB=${MTREEDB:-${DESTDIR}/var/db} MTREEFILE="${MTREEDB}/mergemaster.mtree" # Check the command line options @@ -351,9 +351,10 @@ fi case "${AUTO_UPGRADE}" in '') ;; # If the option is not set no need to run the test or warn the user *) - if [ ! -s "${DESTDIR}${MTREEFILE}" ]; then + if [ ! -s "${MTREEFILE}" ]; then echo '' - echo "*** Unable to find mtree database. Skipping auto-upgrade on this run." + echo "*** Unable to find mtree database (${MTREEFILE})." + echo " Skipping auto-upgrade on this run." echo " It will be created for the next run when this one is complete." echo '' press_to_continue @@ -463,9 +464,9 @@ MM_MAKE="make ${ARCHSTRING} -m ${SOURCED # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. # -if [ -n "${AUTO_UPGRADE}" -a -s "${DESTDIR}${MTREEFILE}" ]; then +if [ -n "${AUTO_UPGRADE}" -a -s "${MTREEFILE}" ]; then CHANGED=: - for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ + for file in `mtree -eqL -f ${MTREEFILE} -p ${DESTDIR}/ \ 2>/dev/null | awk '($2 == "changed") {print $1}'`; do if [ -f "${DESTDIR}/$file" ]; then CHANGED="${CHANGED}${DESTDIR}/${file}:" @@ -1061,8 +1062,8 @@ echo "*** Comparison complete" if [ -s "${MTREENEW}" ]; then echo "*** Saving mtree database for future upgrades" - test -e "${DESTDIR}${MTREEFILE}" && unlink ${DESTDIR}${MTREEFILE} - mv ${MTREENEW} ${DESTDIR}${MTREEFILE} + test -e "${MTREEFILE}" && unlink ${MTREEFILE} + mv ${MTREENEW} ${MTREEFILE} fi echo '' From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:20:02 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93FF4106566C; Fri, 11 Dec 2009 23:20:02 +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 7F4C38FC31; Fri, 11 Dec 2009 23:20: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 nBBNK2xv023282; Fri, 11 Dec 2009 23:20:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBNK2XG023270; Fri, 11 Dec 2009 23:20:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912112320.nBBNK2XG023270@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 23:20: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: r200417 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:20:02 -0000 Author: delphij Date: Fri Dec 11 23:20:02 2009 New Revision: 200417 URL: http://svn.freebsd.org/changeset/base/200417 Log: Remove unnecessary includes. Reviewed by: rodrigc Modified: head/usr.bin/make/arch.c head/usr.bin/make/dir.c head/usr.bin/make/for.c head/usr.bin/make/globals.h head/usr.bin/make/lst.c head/usr.bin/make/lst.h head/usr.bin/make/make.c head/usr.bin/make/str.c head/usr.bin/make/targ.c head/usr.bin/make/var.c Modified: head/usr.bin/make/arch.c ============================================================================== --- head/usr.bin/make/arch.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/arch.c Fri Dec 11 23:20:02 2009 (r200417) @@ -103,7 +103,6 @@ __FBSDID("$FreeBSD$"); #include "arch.h" #include "buf.h" -#include "config.h" #include "dir.h" #include "globals.h" #include "GNode.h" Modified: head/usr.bin/make/dir.c ============================================================================== --- head/usr.bin/make/dir.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/dir.c Fri Dec 11 23:20:02 2009 (r200417) @@ -90,7 +90,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "arch.h" #include "dir.h" @@ -98,7 +97,6 @@ __FBSDID("$FreeBSD$"); #include "GNode.h" #include "hash.h" #include "lst.h" -#include "make.h" #include "str.h" #include "targ.h" #include "util.h" Modified: head/usr.bin/make/for.c ============================================================================== --- head/usr.bin/make/for.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/for.c Fri Dec 11 23:20:02 2009 (r200417) @@ -50,11 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include "buf.h" -#include "dir.h" #include "for.h" #include "globals.h" #include "lst.h" -#include "make.h" #include "parse.h" #include "str.h" #include "util.h" Modified: head/usr.bin/make/globals.h ============================================================================== --- head/usr.bin/make/globals.h Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/globals.h Fri Dec 11 23:20:02 2009 (r200417) @@ -45,9 +45,6 @@ * Global Variables */ -#include -#include - #include "lst.h" #include "util.h" Modified: head/usr.bin/make/lst.c ============================================================================== --- head/usr.bin/make/lst.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/lst.c Fri Dec 11 23:20:02 2009 (r200417) @@ -41,7 +41,6 @@ #include #include "lst.h" -#include "make.h" #include "util.h" /** Modified: head/usr.bin/make/lst.h ============================================================================== --- head/usr.bin/make/lst.h Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/lst.h Fri Dec 11 23:20:02 2009 (r200417) @@ -48,8 +48,6 @@ * Header for using the list library */ -#include "util.h" - /* * Structure of a list node. */ Modified: head/usr.bin/make/make.c ============================================================================== --- head/usr.bin/make/make.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/make.c Fri Dec 11 23:20:02 2009 (r200417) @@ -72,10 +72,7 @@ __FBSDID("$FreeBSD$"); * and perform the .USE actions if so. */ -#include - #include "arch.h" -#include "config.h" #include "dir.h" #include "globals.h" #include "GNode.h" Modified: head/usr.bin/make/str.c ============================================================================== --- head/usr.bin/make/str.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/str.c Fri Dec 11 23:20:02 2009 (r200417) @@ -41,12 +41,10 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include "buf.h" -#include "globals.h" #include "str.h" #include "util.h" Modified: head/usr.bin/make/targ.c ============================================================================== --- head/usr.bin/make/targ.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/targ.c Fri Dec 11 23:20:02 2009 (r200417) @@ -78,13 +78,11 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include "dir.h" #include "globals.h" #include "GNode.h" #include "hash.h" -#include "make.h" #include "suff.h" #include "targ.h" #include "util.h" Modified: head/usr.bin/make/var.c ============================================================================== --- head/usr.bin/make/var.c Fri Dec 11 23:03:35 2009 (r200416) +++ head/usr.bin/make/var.c Fri Dec 11 23:20:02 2009 (r200417) @@ -84,7 +84,6 @@ __FBSDID("$FreeBSD$"); * XXX: There's a lot of duplication in these functions. */ -#include #include #include #include @@ -97,7 +96,6 @@ __FBSDID("$FreeBSD$"); #include "GNode.h" #include "job.h" #include "lst.h" -#include "make.h" #include "parse.h" #include "str.h" #include "targ.h" From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:23:57 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D093A1065670; Fri, 11 Dec 2009 23:23:57 +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 A3E1F8FC12; Fri, 11 Dec 2009 23: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 nBBNNvP4023410; Fri, 11 Dec 2009 23:23:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBNNvXB023400; Fri, 11 Dec 2009 23:23:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912112323.nBBNNvXB023400@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 23: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: r200418 - head/usr.bin/talk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:23:58 -0000 Author: delphij Date: Fri Dec 11 23:23:57 2009 New Revision: 200418 URL: http://svn.freebsd.org/changeset/base/200418 Log: Move unistd.h includes to individual .c files and remove unnecessary includes. Modified: head/usr.bin/talk/ctl_transact.c head/usr.bin/talk/display.c head/usr.bin/talk/get_addrs.c head/usr.bin/talk/get_iface.c head/usr.bin/talk/get_names.c head/usr.bin/talk/invite.c head/usr.bin/talk/look_up.c head/usr.bin/talk/talk.c head/usr.bin/talk/talk.h Modified: head/usr.bin/talk/ctl_transact.c ============================================================================== --- head/usr.bin/talk/ctl_transact.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/ctl_transact.c Fri Dec 11 23:23:57 2009 (r200418) @@ -42,7 +42,6 @@ static const char sccsid[] = "@(#)ctl_tr #include #include -#include #include "talk.h" #include "talk_ctl.h" Modified: head/usr.bin/talk/display.c ============================================================================== --- head/usr.bin/talk/display.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/display.c Fri Dec 11 23:23:57 2009 (r200418) @@ -44,6 +44,7 @@ static const char sccsid[] = "@(#)displa * displaying of text */ #include +#include #include "talk.h" Modified: head/usr.bin/talk/get_addrs.c ============================================================================== --- head/usr.bin/talk/get_addrs.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/get_addrs.c Fri Dec 11 23:23:57 2009 (r200418) @@ -42,6 +42,7 @@ static const char sccsid[] = "@(#)get_ad #include #include #include +#include #include "talk.h" #include "talk_ctl.h" Modified: head/usr.bin/talk/get_iface.c ============================================================================== --- head/usr.bin/talk/get_iface.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/get_iface.c Fri Dec 11 23:23:57 2009 (r200418) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "talk.h" Modified: head/usr.bin/talk/get_names.c ============================================================================== --- head/usr.bin/talk/get_names.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/get_names.c Fri Dec 11 23:23:57 2009 (r200418) @@ -45,6 +45,7 @@ static const char sccsid[] = "@(#)get_na #include #include #include +#include #include "talk.h" Modified: head/usr.bin/talk/invite.c ============================================================================== --- head/usr.bin/talk/invite.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/invite.c Fri Dec 11 23:23:57 2009 (r200418) @@ -47,6 +47,7 @@ static const char sccsid[] = "@(#)invite #include #include #include +#include #include "talk_ctl.h" #include "talk.h" Modified: head/usr.bin/talk/look_up.c ============================================================================== --- head/usr.bin/talk/look_up.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/look_up.c Fri Dec 11 23:23:57 2009 (r200418) @@ -45,6 +45,7 @@ static const char sccsid[] = "@(#)look_u #include #include +#include #include "talk_ctl.h" #include "talk.h" Modified: head/usr.bin/talk/talk.c ============================================================================== --- head/usr.bin/talk/talk.c Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/talk.c Fri Dec 11 23:23:57 2009 (r200418) @@ -46,6 +46,7 @@ static const char copyright[] = #endif #include +#include #include "talk.h" Modified: head/usr.bin/talk/talk.h ============================================================================== --- head/usr.bin/talk/talk.h Fri Dec 11 23:20:02 2009 (r200417) +++ head/usr.bin/talk/talk.h Fri Dec 11 23:23:57 2009 (r200418) @@ -42,7 +42,6 @@ #include #include #include -#include extern int sockt; extern int curses_initialized; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:30:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FF2C1065676; Fri, 11 Dec 2009 23:30:23 +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 4E93A8FC0C; Fri, 11 Dec 2009 23:30: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 nBBNUN4x023573; Fri, 11 Dec 2009 23:30:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBNUN77023564; Fri, 11 Dec 2009 23:30:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912112330.nBBNUN77023564@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 23:30: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: r200419 - head/usr.bin/tset X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:30:23 -0000 Author: delphij Date: Fri Dec 11 23:30:22 2009 New Revision: 200419 URL: http://svn.freebsd.org/changeset/base/200419 Log: Remove unnecessary termcap.h includes inherited from extern.h and other unneeded headers. While I'm there, make function definations ANSI prototypes. Modified: head/usr.bin/tset/extern.h head/usr.bin/tset/map.c head/usr.bin/tset/misc.c head/usr.bin/tset/set.c head/usr.bin/tset/term.c head/usr.bin/tset/tset.c head/usr.bin/tset/wrterm.c Modified: head/usr.bin/tset/extern.h ============================================================================== --- head/usr.bin/tset/extern.h Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/extern.h Fri Dec 11 23:30:22 2009 (r200419) @@ -34,8 +34,6 @@ * $FreeBSD$ */ -#include - extern struct termios mode, oldmode; extern int Columns, isreset, Lines; extern int erasech, intrchar, killch; Modified: head/usr.bin/tset/map.c ============================================================================== --- head/usr.bin/tset/map.c Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/map.c Fri Dec 11 23:30:22 2009 (r200419) @@ -75,9 +75,7 @@ MAP *cur, *maplist; * The baud rate tests are: >, <, @, =, ! */ void -add_mapping(port, arg) - const char *port; - char *arg; +add_mapping(const char *port, char *arg) { MAP *mapp; char *copy, *p, *termp; @@ -190,8 +188,7 @@ badmopt: errx(1, "illegal -m option for * 'type'. */ const char * -mapped(type) - const char *type; +mapped(const char *type) { MAP *mapp; int match; @@ -240,8 +237,7 @@ SPEEDS speeds[] = { }; speed_t -tset_baudrate(rate) - char *rate; +tset_baudrate(char *rate) { SPEEDS *sp; speed_t speed; Modified: head/usr.bin/tset/misc.c ============================================================================== --- head/usr.bin/tset/misc.c Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/misc.c Fri Dec 11 23:30:22 2009 (r200419) @@ -42,15 +42,12 @@ static const char sccsid[] = "@(#)misc.c #include #include #include -#include -#include #include #include "extern.h" void -cat(file) - char *file; +cat(char *file) { register int fd, nr, nw; char buf[1024]; @@ -67,8 +64,7 @@ cat(file) } int -outc(c) - int c; +outc(int c) { return putc(c, stderr); } Modified: head/usr.bin/tset/set.c ============================================================================== --- head/usr.bin/tset/set.c Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/set.c Fri Dec 11 23:30:22 2009 (r200419) @@ -40,6 +40,7 @@ static const char sccsid[] = "@(#)set.c #endif #include +#include #include #include @@ -54,7 +55,7 @@ int set_tabs(void); * a child program dies in raw mode. */ void -reset_mode() +reset_mode(void) { tcgetattr(STDERR_FILENO, &mode); @@ -155,7 +156,7 @@ reset_mode() * entry and command line and update their values in 'mode'. */ void -set_control_chars() +set_control_chars(void) { char *bp, *p, bs_char, buf[1024]; @@ -192,8 +193,7 @@ set_control_chars() * uppercase to internal lowercase. */ void -set_conversions(usingupper) - int usingupper; +set_conversions(int usingupper) { if (tgetflag("UC") || usingupper) { #ifdef IUCLC @@ -238,7 +238,7 @@ set_conversions(usingupper) /* Output startup string. */ void -set_init() +set_init(void) { char *bp, buf[1024]; int settle; @@ -282,7 +282,7 @@ set_init() * Return nonzero if we set any tab stops, zero if not. */ int -set_tabs() +set_tabs(void) { int c; char *capsp, *clear_tabs; Modified: head/usr.bin/tset/term.c ============================================================================== --- head/usr.bin/tset/term.c Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/term.c Fri Dec 11 23:30:22 2009 (r200419) @@ -45,6 +45,7 @@ static const char sccsid[] = "@(#)term.c #include #include #include +#include #include #include #include "extern.h" @@ -59,8 +60,7 @@ char *ttys(char *); * its termcap entry. */ const char * -get_termcap_entry(userarg, tcapbufp) - char *userarg, **tcapbufp; +get_termcap_entry(char *userarg, char **tcapbufp) { struct ttyent *t; int rval; @@ -125,8 +125,7 @@ found: if ((p = getenv("TERMCAP")) != NU /* Prompt the user for a terminal type. */ const char * -askuser(dflt) - const char *dflt; +askuser(const char *dflt) { static char answer[256]; char *p; Modified: head/usr.bin/tset/tset.c ============================================================================== --- head/usr.bin/tset/tset.c Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/tset.c Fri Dec 11 23:30:22 2009 (r200419) @@ -53,6 +53,7 @@ static const char sccsid[] = "@(#)tset.c #include #include #include +#include #include #include Modified: head/usr.bin/tset/wrterm.c ============================================================================== --- head/usr.bin/tset/wrterm.c Fri Dec 11 23:23:57 2009 (r200418) +++ head/usr.bin/tset/wrterm.c Fri Dec 11 23:30:22 2009 (r200419) @@ -53,8 +53,7 @@ static const char sccsid[] = "@(#)wrterm * shell problems and omitting empty fields. */ void -wrtermcap(bp) - char *bp; +wrtermcap(char *bp) { register int ch; register char *p; From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:35:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83CD4106566B; Fri, 11 Dec 2009 23:35:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ED558FC08; Fri, 11 Dec 2009 23:35: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 nBBNZeki023825; Fri, 11 Dec 2009 23:35:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBNZdRT023731; Fri, 11 Dec 2009 23:35:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200912112335.nBBNZdRT023731@svn.freebsd.org> From: Xin LI Date: Fri, 11 Dec 2009 23:35: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: r200420 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:35:40 -0000 Author: delphij Date: Fri Dec 11 23:35:38 2009 New Revision: 200420 URL: http://svn.freebsd.org/changeset/base/200420 Log: Remove unneeded header includes from usr.bin/ except contributed code. Tested with: make universe Modified: head/usr.bin/ar/util.c head/usr.bin/c89/c89.c head/usr.bin/calendar/calendar.c head/usr.bin/calendar/day.c head/usr.bin/calendar/ostern.c head/usr.bin/calendar/paskha.c head/usr.bin/cksum/Makefile head/usr.bin/cksum/crc.c head/usr.bin/cksum/crc32.c head/usr.bin/cksum/sum1.c head/usr.bin/cksum/sum2.c head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c head/usr.bin/colcrt/colcrt.c head/usr.bin/colrm/colrm.c head/usr.bin/compress/zopen.c head/usr.bin/cpuset/cpuset.c head/usr.bin/expand/expand.c head/usr.bin/fetch/fetch.c head/usr.bin/file2c/file2c.c head/usr.bin/find/find.c head/usr.bin/find/getdate.y head/usr.bin/find/ls.c head/usr.bin/find/main.c head/usr.bin/find/misc.c head/usr.bin/find/option.c head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/util.c head/usr.bin/fmt/fmt.c head/usr.bin/fold/fold.c head/usr.bin/gcore/gcore.c head/usr.bin/getopt/getopt.c head/usr.bin/hexdump/display.c head/usr.bin/hexdump/hexdump.c head/usr.bin/jot/jot.c head/usr.bin/killall/killall.c head/usr.bin/ktrace/subr.c head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/pathnames.h head/usr.bin/lastcomm/readrec.c head/usr.bin/limits/limits.c head/usr.bin/lock/lock.c head/usr.bin/login/login.c head/usr.bin/login/login_fbtab.c head/usr.bin/login/pathnames.h head/usr.bin/mesg/mesg.c head/usr.bin/mkfifo/mkfifo.c head/usr.bin/mklocale/yacc.y head/usr.bin/mktemp/mktemp.c head/usr.bin/ncal/ncal.c head/usr.bin/netstat/atalk.c head/usr.bin/netstat/bpf.c head/usr.bin/netstat/if.c head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/ipx.c head/usr.bin/netstat/main.c head/usr.bin/netstat/mbuf.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/pfkey.c head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c head/usr.bin/newgrp/newgrp.c head/usr.bin/newkey/update.c head/usr.bin/nfsstat/nfsstat.c head/usr.bin/nohup/nohup.c head/usr.bin/passwd/passwd.c head/usr.bin/paste/paste.c head/usr.bin/pr/egetopt.c head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_vm.c head/usr.bin/rev/rev.c head/usr.bin/rlogin/rlogin.c head/usr.bin/rpcgen/rpc_clntout.c head/usr.bin/rpcgen/rpc_hout.c head/usr.bin/rpcgen/rpc_tblout.c head/usr.bin/rpcgen/rpc_util.c head/usr.bin/ruptime/ruptime.c head/usr.bin/rwall/rwall.c head/usr.bin/sed/main.c head/usr.bin/sed/misc.c head/usr.bin/showmount/showmount.c head/usr.bin/su/su.c head/usr.bin/systat/fetch.c head/usr.bin/systat/icmp.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/main.c head/usr.bin/systat/mbufs.c head/usr.bin/systat/mode.c head/usr.bin/systat/netstat.c head/usr.bin/systat/swap.c head/usr.bin/systat/tcp.c head/usr.bin/systat/vmstat.c head/usr.bin/tar/getdate.c head/usr.bin/tee/tee.c head/usr.bin/time/time.c head/usr.bin/tput/tput.c head/usr.bin/tr/cmap.c head/usr.bin/tr/cmap.h head/usr.bin/tr/cset.c head/usr.bin/tr/cset.h head/usr.bin/tr/str.c head/usr.bin/tr/tr.c head/usr.bin/truss/main.c head/usr.bin/truss/setup.c head/usr.bin/tsort/tsort.c head/usr.bin/ul/ul.c head/usr.bin/unexpand/unexpand.c head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/vis/foldit.c head/usr.bin/w/pr_time.c head/usr.bin/w/w.c head/usr.bin/wall/ttymsg.c head/usr.bin/who/who.c head/usr.bin/xinstall/xinstall.c head/usr.bin/ypcat/ypcat.c head/usr.bin/ypmatch/ypmatch.c head/usr.bin/ypwhich/ypwhich.c Modified: head/usr.bin/ar/util.c ============================================================================== --- head/usr.bin/ar/util.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/ar/util.c Fri Dec 11 23:35:38 2009 (r200420) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/c89/c89.c ============================================================================== --- head/usr.bin/c89/c89.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/c89/c89.c Fri Dec 11 23:35:38 2009 (r200420) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/usr.bin/calendar/calendar.c ============================================================================== --- head/usr.bin/calendar/calendar.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/calendar/calendar.c Fri Dec 11 23:35:38 2009 (r200420) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" struct passwd *pw; Modified: head/usr.bin/calendar/day.c ============================================================================== --- head/usr.bin/calendar/day.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/calendar/day.c Fri Dec 11 23:35:38 2009 (r200420) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "pathnames.h" #include "calendar.h" struct tm *tp; Modified: head/usr.bin/calendar/ostern.c ============================================================================== --- head/usr.bin/calendar/ostern.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/calendar/ostern.c Fri Dec 11 23:35:38 2009 (r200420) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "calendar.h" Modified: head/usr.bin/calendar/paskha.c ============================================================================== --- head/usr.bin/calendar/paskha.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/calendar/paskha.c Fri Dec 11 23:35:38 2009 (r200420) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "calendar.h" Modified: head/usr.bin/cksum/Makefile ============================================================================== --- head/usr.bin/cksum/Makefile Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cksum/Makefile Fri Dec 11 23:35:38 2009 (r200420) @@ -5,5 +5,6 @@ PROG= cksum SRCS= cksum.c crc.c print.c sum1.c sum2.c crc32.c LINKS= ${BINDIR}/cksum ${BINDIR}/sum MLINKS= cksum.1 sum.1 +WARNS?= 6 .include Modified: head/usr.bin/cksum/crc.c ============================================================================== --- head/usr.bin/cksum/crc.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cksum/crc.c Fri Dec 11 23:35:38 2009 (r200420) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include "extern.h" Modified: head/usr.bin/cksum/crc32.c ============================================================================== --- head/usr.bin/cksum/crc32.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cksum/crc32.c Fri Dec 11 23:35:38 2009 (r200420) @@ -17,7 +17,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include "extern.h" Modified: head/usr.bin/cksum/sum1.c ============================================================================== --- head/usr.bin/cksum/sum1.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cksum/sum1.c Fri Dec 11 23:35:38 2009 (r200420) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "extern.h" Modified: head/usr.bin/cksum/sum2.c ============================================================================== --- head/usr.bin/cksum/sum2.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cksum/sum2.c Fri Dec 11 23:35:38 2009 (r200420) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "extern.h" Modified: head/usr.bin/cmp/regular.c ============================================================================== --- head/usr.bin/cmp/regular.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cmp/regular.c Fri Dec 11 23:35:38 2009 (r200420) @@ -45,12 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include "extern.h" Modified: head/usr.bin/cmp/special.c ============================================================================== --- head/usr.bin/cmp/special.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cmp/special.c Fri Dec 11 23:35:38 2009 (r200420) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "extern.h" Modified: head/usr.bin/colcrt/colcrt.c ============================================================================== --- head/usr.bin/colcrt/colcrt.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/colcrt/colcrt.c Fri Dec 11 23:35:38 2009 (r200420) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/colrm/colrm.c ============================================================================== --- head/usr.bin/colrm/colrm.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/colrm/colrm.c Fri Dec 11 23:35:38 2009 (r200420) @@ -48,12 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include -#include #include #include Modified: head/usr.bin/compress/zopen.c ============================================================================== --- head/usr.bin/compress/zopen.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/compress/zopen.c Fri Dec 11 23:35:38 2009 (r200420) @@ -67,13 +67,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include #include -#include #include "zopen.h" #define BITS 16 /* Default bits. */ Modified: head/usr.bin/cpuset/cpuset.c ============================================================================== --- head/usr.bin/cpuset/cpuset.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/cpuset/cpuset.c Fri Dec 11 23:35:38 2009 (r200420) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include int cflag; int gflag; Modified: head/usr.bin/expand/expand.c ============================================================================== --- head/usr.bin/expand/expand.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/expand/expand.c Fri Dec 11 23:35:38 2009 (r200420) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include /* * expand - expand tabs to equivalent spaces Modified: head/usr.bin/fetch/fetch.c ============================================================================== --- head/usr.bin/fetch/fetch.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/fetch/fetch.c Fri Dec 11 23:35:38 2009 (r200420) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/file2c/file2c.c ============================================================================== --- head/usr.bin/file2c/file2c.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/file2c/file2c.c Fri Dec 11 23:35:38 2009 (r200420) @@ -10,7 +10,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include Modified: head/usr.bin/find/find.c ============================================================================== --- head/usr.bin/find/find.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/find/find.c Fri Dec 11 23:35:38 2009 (r200420) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "find.h" Modified: head/usr.bin/find/getdate.y ============================================================================== --- head/usr.bin/find/getdate.y Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/find/getdate.y Fri Dec 11 23:35:38 2009 (r200420) @@ -15,7 +15,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include /* The code at the top of get_date which figures out the offset of the Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/find/ls.c Fri Dec 11 23:35:38 2009 (r200420) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/find/main.c ============================================================================== --- head/usr.bin/find/main.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/find/main.c Fri Dec 11 23:35:38 2009 (r200420) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/find/misc.c ============================================================================== --- head/usr.bin/find/misc.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/find/misc.c Fri Dec 11 23:35:38 2009 (r200420) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/find/option.c Fri Dec 11 23:35:38 2009 (r200420) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/finger/lprint.c ============================================================================== --- head/usr.bin/finger/lprint.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/finger/lprint.c Fri Dec 11 23:35:38 2009 (r200420) @@ -310,7 +310,7 @@ show_text(const char *directory, const c return(0); /* If short enough, and no newlines, show it on a single line.*/ - if (sb.st_size <= LINE_LEN - strlen(header) - 5) { + if (sb.st_size <= (int)(LINE_LEN - strlen(header) - 5)) { nr = read(fd, tbuf, sizeof(tbuf)); if (nr <= 0) { (void)close(fd); Modified: head/usr.bin/finger/net.c ============================================================================== --- head/usr.bin/finger/net.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/finger/net.c Fri Dec 11 23:35:38 2009 (r200420) @@ -230,7 +230,7 @@ trying(const struct addrinfo *ai) printf("Trying %s...\n", buf); } -void +static void cleanup(int sig __unused) { #define ERRSTR "Timed out.\n" Modified: head/usr.bin/finger/util.c ============================================================================== --- head/usr.bin/finger/util.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/finger/util.c Fri Dec 11 23:35:38 2009 (r200420) @@ -120,7 +120,7 @@ enter_lastlog(PERSON *pn) } if (fd == -1 || lseek(fd, (long)pn->uid * sizeof(ll), SEEK_SET) != - (long)pn->uid * sizeof(ll) || + (off_t)(pn->uid * sizeof(ll)) || read(fd, (char *)&ll, sizeof(ll)) != sizeof(ll)) { /* as if never logged in */ ll.ll_line[0] = ll.ll_host[0] = '\0'; Modified: head/usr.bin/fmt/fmt.c ============================================================================== --- head/usr.bin/fmt/fmt.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/fmt/fmt.c Fri Dec 11 23:35:38 2009 (r200420) @@ -180,7 +180,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.bin/fold/fold.c ============================================================================== --- head/usr.bin/fold/fold.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/fold/fold.c Fri Dec 11 23:35:38 2009 (r200420) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.bin/gcore/gcore.c ============================================================================== --- head/usr.bin/gcore/gcore.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/gcore/gcore.c Fri Dec 11 23:35:38 2009 (r200420) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "extern.h" Modified: head/usr.bin/getopt/getopt.c ============================================================================== --- head/usr.bin/getopt/getopt.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/getopt/getopt.c Fri Dec 11 23:35:38 2009 (r200420) @@ -7,7 +7,6 @@ __FBSDID("$FreeBSD$"); */ #include -#include #include int Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/hexdump/display.c Fri Dec 11 23:35:38 2009 (r200420) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "hexdump.h" enum _vflag vflag = FIRST; Modified: head/usr.bin/hexdump/hexdump.c ============================================================================== --- head/usr.bin/hexdump/hexdump.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/hexdump/hexdump.c Fri Dec 11 23:35:38 2009 (r200420) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "hexdump.h" Modified: head/usr.bin/jot/jot.c ============================================================================== --- head/usr.bin/jot/jot.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/jot/jot.c Fri Dec 11 23:35:38 2009 (r200420) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include /* Defaults */ Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/killall/killall.c Fri Dec 11 23:35:38 2009 (r200420) @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include #include Modified: head/usr.bin/ktrace/subr.c ============================================================================== --- head/usr.bin/ktrace/subr.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/ktrace/subr.c Fri Dec 11 23:35:38 2009 (r200420) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include "ktrace.h" void timevaladd(struct timeval *, struct timeval *); Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/lastcomm/lastcomm.c Fri Dec 11 23:35:38 2009 (r200420) @@ -51,9 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include #include #include Modified: head/usr.bin/lastcomm/pathnames.h ============================================================================== --- head/usr.bin/lastcomm/pathnames.h Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/lastcomm/pathnames.h Fri Dec 11 23:35:38 2009 (r200420) @@ -31,8 +31,8 @@ * SUCH DAMAGE. * * @(#)pathnames.h 8.1 (Berkeley) 6/6/93 + * + * $FreeBSD$ */ -#include - #define _PATH_ACCT "/var/account/acct" Modified: head/usr.bin/lastcomm/readrec.c ============================================================================== --- head/usr.bin/lastcomm/readrec.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/lastcomm/readrec.c Fri Dec 11 23:35:38 2009 (r200420) @@ -33,13 +33,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include -#include #include #include -#include #include int readrec_forward(FILE *f, struct acctv2 *av2); Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/limits/limits.c Fri Dec 11 23:35:38 2009 (r200420) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.bin/lock/lock.c ============================================================================== --- head/usr.bin/lock/lock.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/lock/lock.c Fri Dec 11 23:35:38 2009 (r200420) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/usr.bin/login/login.c ============================================================================== --- head/usr.bin/login/login.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/login/login.c Fri Dec 11 23:35:38 2009 (r200420) @@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include #include #include Modified: head/usr.bin/login/login_fbtab.c ============================================================================== --- head/usr.bin/login/login_fbtab.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/login/login_fbtab.c Fri Dec 11 23:35:38 2009 (r200420) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "login.h" #include "pathnames.h" static void login_protect(const char *, char *, int, uid_t, gid_t); Modified: head/usr.bin/login/pathnames.h ============================================================================== --- head/usr.bin/login/pathnames.h Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/login/pathnames.h Fri Dec 11 23:35:38 2009 (r200420) @@ -34,8 +34,6 @@ * $FreeBSD$ */ -#include - #define _PATH_HUSHLOGIN ".hushlogin" #define _PATH_MOTDFILE "/etc/motd" #define _PATH_FBTAB "/etc/fbtab" Modified: head/usr.bin/mesg/mesg.c ============================================================================== --- head/usr.bin/mesg/mesg.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/mesg/mesg.c Fri Dec 11 23:35:38 2009 (r200420) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static void usage(void); Modified: head/usr.bin/mkfifo/mkfifo.c ============================================================================== --- head/usr.bin/mkfifo/mkfifo.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/mkfifo/mkfifo.c Fri Dec 11 23:35:38 2009 (r200420) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #define BASEMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | \ Modified: head/usr.bin/mklocale/yacc.y ============================================================================== --- head/usr.bin/mklocale/yacc.y Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/mklocale/yacc.y Fri Dec 11 23:35:38 2009 (r200420) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/mktemp/mktemp.c ============================================================================== --- head/usr.bin/mktemp/mktemp.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/mktemp/mktemp.c Fri Dec 11 23:35:38 2009 (r200420) @@ -143,7 +143,7 @@ main(int argc, char **argv) } static void -usage() +usage(void) { fprintf(stderr, "usage: mktemp [-d] [-q] [-t prefix] [-u] template ...\n"); Modified: head/usr.bin/ncal/ncal.c ============================================================================== --- head/usr.bin/ncal/ncal.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/ncal/ncal.c Fri Dec 11 23:35:38 2009 (r200420) @@ -30,7 +30,6 @@ static const char rcsid[] = #endif /* not lint */ #include -#include #include #include #include Modified: head/usr.bin/netstat/atalk.c ============================================================================== --- head/usr.bin/netstat/atalk.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/atalk.c Fri Dec 11 23:35:38 2009 (r200420) @@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include Modified: head/usr.bin/netstat/bpf.c ============================================================================== --- head/usr.bin/netstat/bpf.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/bpf.c Fri Dec 11 23:35:38 2009 (r200420) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "netstat.h" Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/if.c Fri Dec 11 23:35:38 2009 (r200420) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "netstat.h" Modified: head/usr.bin/netstat/ipsec.c ============================================================================== --- head/usr.bin/netstat/ipsec.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/ipsec.c Fri Dec 11 23:35:38 2009 (r200420) @@ -111,8 +111,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include "netstat.h" #ifdef IPSEC Modified: head/usr.bin/netstat/ipx.c ============================================================================== --- head/usr.bin/netstat/ipx.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/ipx.c Fri Dec 11 23:35:38 2009 (r200420) @@ -64,8 +64,6 @@ __FBSDID("$FreeBSD$"); #define SANAMES #include -#include -#include #include #include #include Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/main.c Fri Dec 11 23:35:38 2009 (r200420) @@ -60,12 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include #include #include #include Modified: head/usr.bin/netstat/mbuf.c ============================================================================== --- head/usr.bin/netstat/mbuf.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/mbuf.c Fri Dec 11 23:35:38 2009 (r200420) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include "netstat.h" /* Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/netgraph.c Fri Dec 11 23:35:38 2009 (r200420) @@ -50,11 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include -#include #include #include "netstat.h" Modified: head/usr.bin/netstat/pfkey.c ============================================================================== --- head/usr.bin/netstat/pfkey.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/pfkey.c Fri Dec 11 23:35:38 2009 (r200420) @@ -83,8 +83,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include "netstat.h" #ifdef IPSEC Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/route.c Fri Dec 11 23:35:38 2009 (r200420) @@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "netstat.h" Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/netstat/sctp.c Fri Dec 11 23:35:38 2009 (r200420) @@ -52,13 +52,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include #include -#include #include "netstat.h" #ifdef SCTP Modified: head/usr.bin/newgrp/newgrp.c ============================================================================== --- head/usr.bin/newgrp/newgrp.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/newgrp/newgrp.c Fri Dec 11 23:35:38 2009 (r200420) @@ -34,10 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -#include #include #include #include Modified: head/usr.bin/newkey/update.c ============================================================================== --- head/usr.bin/newkey/update.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/newkey/update.c Fri Dec 11 23:35:38 2009 (r200420) @@ -58,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* YP */ -#include #include #include #include Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/nfsstat/nfsstat.c Fri Dec 11 23:35:38 2009 (r200420) @@ -62,7 +62,6 @@ static const char rcsid[] = #include #include -#include #include #include #include @@ -71,7 +70,6 @@ static const char rcsid[] = #include #include #include -#include #include struct nlist nl[] = { Modified: head/usr.bin/nohup/nohup.c ============================================================================== --- head/usr.bin/nohup/nohup.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/nohup/nohup.c Fri Dec 11 23:35:38 2009 (r200420) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include static void dofile(void); Modified: head/usr.bin/passwd/passwd.c ============================================================================== --- head/usr.bin/passwd/passwd.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/passwd/passwd.c Fri Dec 11 23:35:38 2009 (r200420) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/paste/paste.c ============================================================================== --- head/usr.bin/paste/paste.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/paste/paste.c Fri Dec 11 23:35:38 2009 (r200420) @@ -52,12 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include #include -#include #include #include Modified: head/usr.bin/pr/egetopt.c ============================================================================== --- head/usr.bin/pr/egetopt.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/pr/egetopt.c Fri Dec 11 23:35:38 2009 (r200420) @@ -46,11 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include -#include "extern.h" - /* * egetopt: get option letter from argument vector (an extended * version of getopt). Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/procstat/procstat_args.c Fri Dec 11 23:35:38 2009 (r200420) @@ -34,7 +34,6 @@ #include #include #include -#include #include #include "procstat.h" Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/procstat/procstat_basic.c Fri Dec 11 23:35:38 2009 (r200420) @@ -30,7 +30,6 @@ #include #include -#include #include #include Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/procstat/procstat_files.c Fri Dec 11 23:35:38 2009 (r200420) @@ -36,7 +36,6 @@ #include -#include #include #include #include Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/procstat/procstat_vm.c Fri Dec 11 23:35:38 2009 (r200420) @@ -30,7 +30,6 @@ #include #include -#include #include #include #include Modified: head/usr.bin/rev/rev.c ============================================================================== --- head/usr.bin/rev/rev.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rev/rev.c Fri Dec 11 23:35:38 2009 (r200420) @@ -49,11 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include -#include #include #include Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rlogin/rlogin.c Fri Dec 11 23:35:38 2009 (r200420) @@ -72,9 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include Modified: head/usr.bin/rpcgen/rpc_clntout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_clntout.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rpcgen/rpc_clntout.c Fri Dec 11 23:35:38 2009 (r200420) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1987, Sun Microsytsems, Inc. */ #include -#include #include #include "rpc_parse.h" #include "rpc_scan.h" Modified: head/usr.bin/rpcgen/rpc_hout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_hout.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rpcgen/rpc_hout.c Fri Dec 11 23:35:38 2009 (r200420) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1987, Sun Microsystems, Inc. */ #include -#include #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" Modified: head/usr.bin/rpcgen/rpc_tblout.c ============================================================================== --- head/usr.bin/rpcgen/rpc_tblout.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rpcgen/rpc_tblout.c Fri Dec 11 23:35:38 2009 (r200420) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); */ #include #include -#include #include "rpc_parse.h" #include "rpc_scan.h" #include "rpc_util.h" Modified: head/usr.bin/rpcgen/rpc_util.c ============================================================================== --- head/usr.bin/rpcgen/rpc_util.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rpcgen/rpc_util.c Fri Dec 11 23:35:38 2009 (r200420) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); * Copyright (C) 1989, Sun Microsystems, Inc. */ #include -#include #include #include #include Modified: head/usr.bin/ruptime/ruptime.c ============================================================================== --- head/usr.bin/ruptime/ruptime.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/ruptime/ruptime.c Fri Dec 11 23:35:38 2009 (r200420) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/rwall/rwall.c ============================================================================== --- head/usr.bin/rwall/rwall.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/rwall/rwall.c Fri Dec 11 23:35:38 2009 (r200420) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/sed/main.c Fri Dec 11 23:35:38 2009 (r200420) @@ -51,12 +51,10 @@ static const char sccsid[] = "@(#)main.c #include #include -#include #include #include #include #include -#include #include #include #include Modified: head/usr.bin/sed/misc.c ============================================================================== --- head/usr.bin/sed/misc.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/sed/misc.c Fri Dec 11 23:35:38 2009 (r200420) @@ -41,14 +41,8 @@ static const char sccsid[] = "@(#)misc.c #include #include -#include #include -#include #include -#include - -#include "defs.h" -#include "extern.h" /* * Return a string for a regular expression error passed. This is overkill, Modified: head/usr.bin/showmount/showmount.c ============================================================================== --- head/usr.bin/showmount/showmount.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/showmount/showmount.c Fri Dec 11 23:35:38 2009 (r200420) @@ -55,7 +55,6 @@ static const char rcsid[] = #include #include -#include #include #include #include Modified: head/usr.bin/su/su.c ============================================================================== --- head/usr.bin/su/su.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/su/su.c Fri Dec 11 23:35:38 2009 (r200420) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/usr.bin/systat/fetch.c ============================================================================== --- head/usr.bin/systat/fetch.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/systat/fetch.c Fri Dec 11 23:35:38 2009 (r200420) @@ -42,7 +42,6 @@ static const char sccsid[] = "@(#)fetch. #include #include -#include #include #include #include Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/systat/icmp.c Fri Dec 11 23:35:38 2009 (r200420) @@ -54,9 +54,7 @@ static char sccsid[] = "@(#)mbufs.c 8.1 #include #include -#include #include -#include #include "systat.h" #include "extern.h" #include "mode.h" Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/systat/iostat.c Fri Dec 11 23:35:38 2009 (r200420) @@ -73,7 +73,6 @@ static const char sccsid[] = "@(#)iostat #include #include #include -#include #include #include Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/systat/ip.c Fri Dec 11 23:35:38 2009 (r200420) @@ -55,10 +55,6 @@ static const char sccsid[] = "@(#)mbufs. #include #include -#include -#include -#include - #include "systat.h" #include "extern.h" #include "mode.h" Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/systat/main.c Fri Dec 11 23:35:38 2009 (r200420) @@ -53,7 +53,6 @@ static const char copyright[] = #include #include #include -#include #include #include #include Modified: head/usr.bin/systat/mbufs.c ============================================================================== --- head/usr.bin/systat/mbufs.c Fri Dec 11 23:30:22 2009 (r200419) +++ head/usr.bin/systat/mbufs.c Fri Dec 11 23:35:38 2009 (r200420) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:50:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF8A1065670; Fri, 11 Dec 2009 23:50:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id D4B1D8FC16; Fri, 11 Dec 2009 23:50:52 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 22B541CE3C; Sat, 12 Dec 2009 00:50:52 +0100 (CET) Date: Sat, 12 Dec 2009 00:50:52 +0100 From: Ed Schouten To: Xin LI Message-ID: <20091211235052.GM64905@hoeg.nl> References: <200912112335.nBBNZdRT023731@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7YWEqC0YJ2sNURQG" Content-Disposition: inline In-Reply-To: <200912112335.nBBNZdRT023731@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200420 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:50:53 -0000 --7YWEqC0YJ2sNURQG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Xin LI wrote: > Author: delphij > Date: Fri Dec 11 23:35:38 2009 > New Revision: 200420 > URL: http://svn.freebsd.org/changeset/base/200420 >=20 > Log: > Remove unneeded header includes from usr.bin/ except contributed code. Wow. Did you use any special tools to do this? --=20 Ed Schouten WWW: http://80386.nl/ --7YWEqC0YJ2sNURQG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksi2tsACgkQ52SDGA2eCwXVDgCeJDWRei1rV0HpiCDL5oXVgtAc LuQAn0n9Y3aNvzZf/fJ1dXc3xns0634u =D+sZ -----END PGP SIGNATURE----- --7YWEqC0YJ2sNURQG-- From owner-svn-src-all@FreeBSD.ORG Fri Dec 11 23:52:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C988B1065694; Fri, 11 Dec 2009 23:52:42 +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 B96F28FC0A; Fri, 11 Dec 2009 23:52: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 nBBNqgKB024163; Fri, 11 Dec 2009 23:52:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBBNqgR2024161; Fri, 11 Dec 2009 23:52:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912112352.nBBNqgR2024161@svn.freebsd.org> From: Ed Schouten Date: Fri, 11 Dec 2009 23:52: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: r200421 - head/lib/libulog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 23:52:42 -0000 Author: ed Date: Fri Dec 11 23:52:42 2009 New Revision: 200421 URL: http://svn.freebsd.org/changeset/base/200421 Log: The hostname passed to ulog_login(3) may be optional. Don't trip on a null pointer being passed to this function when performing a local login. Noticed by: dougb Modified: head/lib/libulog/ulog_login.c Modified: head/lib/libulog/ulog_login.c ============================================================================== --- head/lib/libulog/ulog_login.c Fri Dec 11 23:35:38 2009 (r200420) +++ head/lib/libulog/ulog_login.c Fri Dec 11 23:52:42 2009 (r200421) @@ -48,7 +48,8 @@ ulog_login(const char *line, const char utx.ut_type = USER_PROCESS; strncpy(utx.ut_line, line, sizeof utx.ut_line); strncpy(utx.ut_user, user, sizeof utx.ut_user); - strncpy(utx.ut_host, host, sizeof utx.ut_host); + if (host != NULL) + strncpy(utx.ut_host, host, sizeof utx.ut_host); gettimeofday(&utx.ut_tv, NULL); ulog_pututxline(&utx); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 00:06:44 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FDB9106566B; Sat, 12 Dec 2009 00:06:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F47F8FC18; Sat, 12 Dec 2009 00:06: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 nBC06imj024487; Sat, 12 Dec 2009 00:06:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC06iQ9024485; Sat, 12 Dec 2009 00:06:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912120006.nBC06iQ9024485@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 12 Dec 2009 00:06: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: r200422 - head/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 00:06:44 -0000 Author: yongari Date: Sat Dec 12 00:06:43 2009 New Revision: 200422 URL: http://svn.freebsd.org/changeset/base/200422 Log: Remove driver lock assertion in MII register access. This change was made in r199543 to remove MTX_RECURSE. These routines can be called in device attach phase(e.g. mii_phy_probe()) so checking assertion here is not right as caller does not hold a driver lock. Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Fri Dec 11 23:52:42 2009 (r200421) +++ head/sys/dev/vge/if_vge.c Sat Dec 12 00:06:43 2009 (r200422) @@ -378,7 +378,6 @@ vge_miibus_readreg(dev, phy, reg) if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) return(0); - VGE_LOCK_ASSERT(sc); vge_miipoll_stop(sc); /* Specify the register we want to read. */ @@ -417,7 +416,6 @@ vge_miibus_writereg(dev, phy, reg, data) if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) return(0); - VGE_LOCK_ASSERT(sc); vge_miipoll_stop(sc); /* Specify the register we want to write. */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 00:11:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC22A106568F; Sat, 12 Dec 2009 00:11:40 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBE4E8FC16; Sat, 12 Dec 2009 00:11: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 nBC0Bebg024622; Sat, 12 Dec 2009 00:11:40 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC0Be0I024620; Sat, 12 Dec 2009 00:11:40 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912120011.nBC0Be0I024620@svn.freebsd.org> From: Sean Farley Date: Sat, 12 Dec 2009 00:11: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: r200423 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 00:11:41 -0000 Author: scf Date: Sat Dec 12 00:11:40 2009 New Revision: 200423 URL: http://svn.freebsd.org/changeset/base/200423 Log: Remove a dead store. MFC after: 5 days Modified: head/lib/libutil/gr_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Sat Dec 12 00:06:43 2009 (r200422) +++ head/lib/libutil/gr_util.c Sat Dec 12 00:11:40 2009 (r200423) @@ -117,8 +117,8 @@ gr_make(const struct group *gr) /* Create the group line and fill it. */ if ((line = malloc(line_size)) == NULL) return (NULL); - line_size = snprintf(line, line_size, group_line_format, gr->gr_name, - gr->gr_passwd, (uintmax_t)gr->gr_gid); + snprintf(line, line_size, group_line_format, gr->gr_name, gr->gr_passwd, + (uintmax_t)gr->gr_gid); if (gr->gr_mem != NULL) for (ndx = 0; gr->gr_mem[ndx] != NULL; ndx++) { strcat(line, gr->gr_mem[ndx]); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 00:24:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07DC4106566C; Sat, 12 Dec 2009 00:24:31 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB91D8FC14; Sat, 12 Dec 2009 00:24: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 nBC0OUlc024956; Sat, 12 Dec 2009 00:24:30 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC0OUej024954; Sat, 12 Dec 2009 00:24:30 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912120024.nBC0OUej024954@svn.freebsd.org> From: Sean Farley Date: Sat, 12 Dec 2009 00:24: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: r200424 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 00:24:31 -0000 Author: scf Date: Sat Dec 12 00:24:30 2009 New Revision: 200424 URL: http://svn.freebsd.org/changeset/base/200424 Log: Fix libusb_open_device_with_vid_pid() to return a NULL if no device is found instead of the last device in its search list. Reviewed by: thompsa MFC after: 5 days Modified: head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Sat Dec 12 00:11:40 2009 (r200423) +++ head/lib/libusb/libusb10.c Sat Dec 12 00:24:30 2009 (r200424) @@ -379,8 +379,6 @@ libusb_open_device_with_vid_pid(libusb_c if ((i = libusb_get_device_list(ctx, &devs)) < 0) return (NULL); - pdev = NULL; - for (j = 0; j < i; j++) { pdev = devs[j]->os_priv; pdesc = libusb20_dev_get_device_desc(pdev); @@ -396,6 +394,8 @@ libusb_open_device_with_vid_pid(libusb_c break; } } + if (j == i) + pdev = NULL; libusb_free_device_list(devs, 1); DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid leave"); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 01:34:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C3811065774; Sat, 12 Dec 2009 01:34:37 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id 154908FC1A; Sat, 12 Dec 2009 01:34:36 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so302427qwb.7 for ; Fri, 11 Dec 2009 17:34:36 -0800 (PST) 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=nqwXjCIBf/BfwvmBoPQYQX12DX8d0qQNosQ6xnk11Ew=; b=jFxtzSqgyRv+qbCahYlW6UeumOgWDHJcFGanYcXajz/+izGNuhdMpLe29Rp1meCx5Y bM01TUr/nmRVwUhbSBtR7MCkKJKdHiHj/qyjvJ+vwQNwz8QfH69xiAq4F/93FaHvw3uB DF1bow0wHN7nF0Za6DCjs9D3nVwbt8FJQ0QUg= 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=pMN19oWKCBfYrwteV13vuGw5ZpkbQ0s6SVf0kjv1LLm3aV2n71QkTj2v4kD9nzdZ5H AasBN8Bj34BPGWZiV9XNbuBOe7Y3QbhtXEi200QX4xQysrrq/akKSunus+keTRMEihqd yG8egGTK6oR/aswsffLrudjCy9MLzm6ccUoOI= Received: by 10.224.105.26 with SMTP id r26mr1357247qao.0.1260581676116; Fri, 11 Dec 2009 17:34:36 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 4sm6129186qwe.35.2009.12.11.17.34.34 (version=SSLv3 cipher=RC4-MD5); Fri, 11 Dec 2009 17:34:35 -0800 (PST) Date: Fri, 11 Dec 2009 20:34:29 -0500 From: Alexander Kabaev To: Xin LI Message-ID: <20091211203429.1648657c@kan.dnsalias.net> In-Reply-To: <20091211235052.GM64905@hoeg.nl> References: <200912112335.nBBNZdRT023731@svn.freebsd.org> <20091211235052.GM64905@hoeg.nl> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.3; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/ucO8BBjOROZzVHH.=E/1Ul0"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200420 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 01:34:37 -0000 --Sig_/ucO8BBjOROZzVHH.=E/1Ul0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 12 Dec 2009 00:50:52 +0100 Ed Schouten wrote: > * Xin LI wrote: > > Author: delphij > > Date: Fri Dec 11 23:35:38 2009 > > New Revision: 200420 > > URL: http://svn.freebsd.org/changeset/base/200420 > >=20 > > Log: > > Remove unneeded header includes from usr.bin/ except contributed > > code. >=20 > Wow. Did you use any special tools to do this? >=20 > --=20 > Ed Schouten > WWW: http://80386.nl/ Better yet, could you share the criteria used to determine which include is required and which is not? --=20 Alexander Kabaev --Sig_/ucO8BBjOROZzVHH.=E/1Ul0 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD4DBQFLIvMpQ6z1jMm+XZYRAgMRAJj4iYIr6BdYLVVWRtcJvd4+yswiAKDVc66g IupVk3YaOMxElnxy9ZUiJQ== =gpru -----END PGP SIGNATURE----- --Sig_/ucO8BBjOROZzVHH.=E/1Ul0-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 02:19:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 468F7106566C; Sat, 12 Dec 2009 02:19: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 358018FC14; Sat, 12 Dec 2009 02:19:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBC2Jggn027160; Sat, 12 Dec 2009 02:19:42 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC2Jg1l027158; Sat, 12 Dec 2009 02:19:42 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912120219.nBC2Jg1l027158@svn.freebsd.org> From: Doug Barton Date: Sat, 12 Dec 2009 02:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200425 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 02:19:42 -0000 Author: dougb Date: Sat Dec 12 02:19:41 2009 New Revision: 200425 URL: http://svn.freebsd.org/changeset/base/200425 Log: Over time things that used to be files/directories/links can change to something else. So add code to detect when things don't match and give the user choices about how to fix it. If we're using -P and something in the above check needs to be moved we need to have the directory there for it, so create it at the beginning and delete empty versions of it at the end. The case where something used to be a file or link and now is supposed to be a directory (e.g., /etc/security) is especially dangerous, so make failure to install a necessary directory in $DESTDIR a fatal error. Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 12 00:24:30 2009 (r200424) +++ head/usr.sbin/mergemaster/mergemaster.sh Sat Dec 12 02:19:41 2009 (r200425) @@ -345,6 +345,7 @@ done # Don't force the user to set this in the mergemaster rc file if [ -n "${PRESERVE_FILES}" -a -z "${PRESERVE_FILES_DIR}" ]; then PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S` + mkdir -p ${PRESERVE_FILES_DIR} fi # Check for the mtree database in DESTDIR @@ -819,7 +820,8 @@ mm_install () { if [ -n "${DESTDIR}${INSTALL_DIR}" -a ! -d "${DESTDIR}${INSTALL_DIR}" ]; then DIR_MODE=`find_mode "${TEMPROOT}/${INSTALL_DIR}"` - install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" + install -d -o root -g wheel -m "${DIR_MODE}" "${DESTDIR}${INSTALL_DIR}" || + install_error $1 ${DESTDIR}${INSTALL_DIR} fi FILE_MODE=`find_mode "${1}"` @@ -968,6 +970,57 @@ if [ -r "${MM_PRE_COMPARE_SCRIPT}" ]; th . "${MM_PRE_COMPARE_SCRIPT}" fi +# Things that were files/directories/links in one version can sometimes +# change to something else in a newer version. So we need to explicitly +# test for this, and warn the user if what we find does not match. +# +for COMPFILE in `find .` ; do + if [ -e "${DESTDIR}${COMPFILE#.}" ]; then + INSTALLED_TYPE=`stat -f '%HT' ${DESTDIR}${COMPFILE#.}` + else + continue + fi + TEMPROOT_TYPE=`stat -f '%HT' $COMPFILE` + + if [ ! "$TEMPROOT_TYPE" = "$INSTALLED_TYPE" ]; then + [ "$COMPFILE" = '.' ] && continue + TEMPROOT_TYPE=`echo $TEMPROOT_TYPE | tr [:upper:] [:lower:]` + INSTALLED_TYPE=`echo $INSTALLED_TYPE | tr [:upper:] [:lower:]` + + echo "*** The installed file ${DESTDIR}${COMPFILE#.} has the type \"$INSTALLED_TYPE\"" + echo " but the new version has the type \"$TEMPROOT_TYPE\"" + echo '' + echo " How would you like to handle this?" + echo '' + echo " Use 'r' to remove ${DESTDIR}${COMPFILE#.}" + case "$TEMPROOT_TYPE" in + 'symbolic link') + TARGET=`readlink $COMPFILE` + echo " and create a link to $TARGET in its place" ;; + *) echo " You will be able to install it as a \"$TEMPROOT_TYPE\"" ;; + esac + echo '' + echo " Use 'i' to ignore this" + echo '' + echo -n " How to proceed? [i] " + read ANSWER + case "$ANSWER" in + [rR]) case "${PRESERVE_FILES}" in + [Yy][Ee][Ss]) + mv ${DESTDIR}${COMPFILE#.} ${PRESERVE_FILES_DIR}/ || exit 1 ;; + *) rm -rf ${DESTDIR}${COMPFILE#.} ;; + esac + case "$TEMPROOT_TYPE" in + 'symbolic link') ln -sf $TARGET ${DESTDIR}${COMPFILE#.} ;; + esac ;; + *) echo '' + echo "*** See the man page about adding ${COMPFILE#.} to the list of IGNORE_FILES" + press_to_continue ;; + esac + echo '' + fi +done + for COMPFILE in `find . -type f`; do # First, check to see if the file exists in DESTDIR. If not, the @@ -1269,5 +1322,9 @@ case "${PRE_WORLD}" in ;; esac -exit 0 +if [ -n "${PRESERVE_FILES}" ]; then + find -d $PRESERVE_FILES_DIR -type d -empty -delete 2>/dev/null + rmdir $PRESERVE_FILES_DIR 2>/dev/null +fi +exit 0 From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 02:31:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AA60106566B; Sat, 12 Dec 2009 02:31:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48C158FC15; Sat, 12 Dec 2009 02:31: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 nBC2VGgf027427; Sat, 12 Dec 2009 02:31:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC2VG7i027425; Sat, 12 Dec 2009 02:31:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912120231.nBC2VG7i027425@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 12 Dec 2009 02:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200426 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 02:31:16 -0000 Author: nwhitehorn Date: Sat Dec 12 02:31:16 2009 New Revision: 200426 URL: http://svn.freebsd.org/changeset/base/200426 Log: MFC r200083: The first argument of dcbz interprets r0 as a literal zero, not the second. This worked before by accident. Modified: stable/8/sys/powerpc/aim/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Sat Dec 12 02:19:41 2009 (r200425) +++ stable/8/sys/powerpc/aim/machdep.c Sat Dec 12 02:31:16 2009 (r200426) @@ -374,7 +374,7 @@ powerpc_init(u_int startkernel, u_int en for (cacheline_size = 0; cacheline_size < 0x100; cacheline_size++) cache_check[cacheline_size] = 0xff; - __asm __volatile("dcbz %0,0":: "r" (cache_check) : "memory"); + __asm __volatile("dcbz 0,%0":: "r" (cache_check) : "memory"); /* Find the first byte dcbz did not zero to get the cache line size */ for (cacheline_size = 0; cacheline_size < 0x100 && From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 02:34:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ACA6106566B; Sat, 12 Dec 2009 02:34:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 883A38FC17; Sat, 12 Dec 2009 02:34: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 nBC2Y0Bs027535; Sat, 12 Dec 2009 02:34:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC2Y08W027531; Sat, 12 Dec 2009 02:34:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200912120234.nBC2Y08W027531@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 12 Dec 2009 02:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200427 - stable/8/sys/dev/adb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 02:34:00 -0000 Author: nwhitehorn Date: Sat Dec 12 02:34:00 2009 New Revision: 200427 URL: http://svn.freebsd.org/changeset/base/200427 Log: MFC r199888: Add support for interpreting taps on ADB touchpads as a button click. Submitted by: Andreas Tobler Modified: stable/8/sys/dev/adb/adb.h stable/8/sys/dev/adb/adb_bus.c stable/8/sys/dev/adb/adb_mouse.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/adb/adb.h ============================================================================== --- stable/8/sys/dev/adb/adb.h Sat Dec 12 02:31:16 2009 (r200426) +++ stable/8/sys/dev/adb/adb.h Sat Dec 12 02:34:00 2009 (r200427) @@ -69,6 +69,7 @@ uint8_t adb_get_device_handler(device_t uint8_t adb_set_device_handler(device_t dev, uint8_t newhandler); size_t adb_read_register(device_t dev, u_char reg, void *data); +size_t adb_write_register(device_t dev, u_char reg, size_t len, void *data); /* Bits for implementing ADB host bus adapters */ extern devclass_t adb_devclass; Modified: stable/8/sys/dev/adb/adb_bus.c ============================================================================== --- stable/8/sys/dev/adb/adb_bus.c Sat Dec 12 02:31:16 2009 (r200426) +++ stable/8/sys/dev/adb/adb_bus.c Sat Dec 12 02:34:00 2009 (r200427) @@ -402,3 +402,21 @@ adb_read_register(device_t dev, u_char r return (result); } +size_t +adb_write_register(device_t dev, u_char reg, size_t len, void *data) +{ + struct adb_softc *sc; + struct adb_devinfo *dinfo; + size_t result; + + dinfo = device_get_ivars(dev); + sc = device_get_softc(device_get_parent(dev)); + + result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, + ADB_COMMAND_LISTEN, reg, len, (u_char *)data, NULL); + + result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, + ADB_COMMAND_TALK, reg, 0, NULL, NULL); + + return (result); +} Modified: stable/8/sys/dev/adb/adb_mouse.c ============================================================================== --- stable/8/sys/dev/adb/adb_mouse.c Sat Dec 12 02:31:16 2009 (r200426) +++ stable/8/sys/dev/adb/adb_mouse.c Sat Dec 12 02:34:00 2009 (r200427) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ static int adb_mouse_probe(device_t dev); static int adb_mouse_attach(device_t dev); static int adb_mouse_detach(device_t dev); +static void adb_init_trackpad(device_t dev); +static int adb_tapping_sysctl(SYSCTL_HANDLER_ARGS); static d_open_t ams_open; static d_close_t ams_close; @@ -77,6 +80,8 @@ struct adb_mouse_softc { u_char id[4]; int buttons; + u_int sc_tapping; + int button_buf; int last_buttons; int xdelta, ydelta; @@ -167,6 +172,8 @@ adb_mouse_attach(device_t dev) sc->mode.packetsize = 5; sc->buttons = 0; + sc->sc_tapping = 0; + sc->button_buf = 0; sc->last_buttons = 0; sc->packet_read_len = 0; @@ -205,6 +212,7 @@ adb_mouse_attach(device_t dev) case 3: sc->flags |= AMS_TOUCHPAD; sc->hw.type = MOUSE_PAD; + adb_init_trackpad(dev); description = "Touchpad"; break; } @@ -259,6 +267,70 @@ adb_mouse_detach(device_t dev) return (0); } +static void +adb_init_trackpad(device_t dev) +{ + struct adb_mouse_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + + size_t r1_len; + u_char r1[8]; + u_char r2[8]; + + sc = device_get_softc(dev); + + r1_len = adb_read_register(dev, 1, r1); + + /* An Extended Mouse register1 must return 8 bytes. */ + if (r1_len != 8) + return; + + if((r1[6] != 0x0d)) + { + r1[6] = 0x0d; + + adb_write_register(dev, 1, 8, r1); + + r1_len = adb_read_register(dev, 1, r1); + + if (r1[6] != 0x0d) + { + device_printf(dev, "ADB Mouse = 0x%x " + "(non-Extended Mode)\n", r1[6]); + return; + } else { + device_printf(dev, "ADB Mouse = 0x%x " + "(Extended Mode)\n", r1[6]); + + /* Set ADB Extended Features to default values, + enabled. */ + r2[0] = 0x19; /* Clicking: 0x19 disabled 0x99 enabled */ + r2[1] = 0x94; /* Dragging: 0x14 disabled 0x94 enabled */ + r2[2] = 0x19; + r2[3] = 0xff; /* DragLock: 0xff disabled 0xb2 enabled */ + r2[4] = 0xb2; + r2[5] = 0x8a; + r2[6] = 0x1b; + + r2[7] = 0x57; /* 0x57 bits 3:0 for W mode */ + + adb_write_register(dev, 2, 8, r2); + + } + } + + /* + * Set up sysctl + */ + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tapping", + CTLTYPE_INT | CTLFLAG_RW, sc, 0, adb_tapping_sysctl, + "I", "Tapping the pad causes button events"); + return; +} + static u_int adb_mouse_receive_packet(device_t dev, u_char status, u_char command, u_char reg, int len, u_char *data) @@ -266,7 +338,7 @@ adb_mouse_receive_packet(device_t dev, u struct adb_mouse_softc *sc; int i = 0; int xdelta, ydelta; - int buttons; + int buttons, tmp_buttons; sc = device_get_softc(dev); @@ -298,6 +370,30 @@ adb_mouse_receive_packet(device_t dev, u if (ydelta & (0x40 << 3*(len-2))) ydelta |= 0xffffffc0 << 3*(len - 2); + if ((sc->flags & AMS_TOUCHPAD) && (sc->sc_tapping == 1)) { + tmp_buttons = buttons; + if (buttons == 0x12) { + /* Map a double tap on button 3. + Keep the button state for the next sequence. + A double tap sequence is followed by a single tap + sequence. + */ + tmp_buttons = 0x3; + sc->button_buf = tmp_buttons; + } else if (buttons == 0x2) { + /* Map a single tap on button 2. But only if it is + not a successor from a double tap. + */ + if (sc->button_buf != 0x3) + tmp_buttons = 0x2; + else + tmp_buttons = 0; + + sc->button_buf = 0; + } + buttons = tmp_buttons; + } + /* * Some mice report high-numbered buttons on the wrong button number, * so set the highest-numbered real button as pressed if there are @@ -554,3 +650,36 @@ ams_ioctl(struct cdev *dev, u_long cmd, return (0); } +static int +adb_tapping_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct adb_mouse_softc *sc = arg1; + device_t dev; + int error; + u_char r2[8]; + u_int tapping; + + dev = sc->sc_dev; + tapping = sc->sc_tapping; + + error = sysctl_handle_int(oidp, &tapping, 0, req); + + if (error || !req->newptr) + return (error); + + if (tapping == 1) { + adb_read_register(dev, 2, r2); + r2[0] = 0x99; /* enable tapping. */ + adb_write_register(dev, 2, 8, r2); + sc->sc_tapping = 1; + } else if (tapping == 0) { + adb_read_register(dev, 2, r2); + r2[0] = 0x19; /* disable tapping. */ + adb_write_register(dev, 2, 8, r2); + sc->sc_tapping = 0; + } + else + return (EINVAL); + + return (0); +} From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 04:34:23 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38F031065679; Sat, 12 Dec 2009 04:34:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26FD18FC0C; Sat, 12 Dec 2009 04:34:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBC4YNDT041068; Sat, 12 Dec 2009 04:34:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC4YNg7041066; Sat, 12 Dec 2009 04:34:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912120434.nBC4YNg7041066@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 12 Dec 2009 04:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200429 - stable/8/sys/dev/iir X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 04:34:23 -0000 Author: marcel Date: Sat Dec 12 04:34:22 2009 New Revision: 200429 URL: http://svn.freebsd.org/changeset/base/200429 Log: MFC rev 200045: Include , to get the declarations of ostype and osrelease. Remove the duplicate declarations from this file. Modified: stable/8/sys/dev/iir/iir_ctrl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/iir/iir_ctrl.c ============================================================================== --- stable/8/sys/dev/iir/iir_ctrl.c Sat Dec 12 03:35:49 2009 (r200428) +++ stable/8/sys/dev/iir/iir_ctrl.c Sat Dec 12 04:34:22 2009 (r200429) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -83,8 +84,6 @@ static int iir_devsw_installed = 0; static int sdev_made = 0; #endif extern int gdt_cnt; -extern char ostype[]; -extern char osrelease[]; extern gdt_statist_t gdt_stat; /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 05:14:41 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 312EF106566B; Sat, 12 Dec 2009 05:14:41 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D4678FC1A; Sat, 12 Dec 2009 05:14: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 nBC5Ef5a042214; Sat, 12 Dec 2009 05:14:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBC5EeKt042203; Sat, 12 Dec 2009 05:14:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912120514.nBC5EeKt042203@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 12 Dec 2009 05:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200431 - in stable/8/sys/ia64: ia64 include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 05:14:41 -0000 Author: marcel Date: Sat Dec 12 05:14:40 2009 New Revision: 200431 URL: http://svn.freebsd.org/changeset/base/200431 Log: MFC rev 199893, 199941, 200200 and 200207: o Eliminate MAXCPU. o Revamp the PCPU structure. Modified: stable/8/sys/ia64/ia64/clock.c stable/8/sys/ia64/ia64/genassym.c stable/8/sys/ia64/ia64/interrupt.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/mp_machdep.c stable/8/sys/ia64/ia64/pmap.c stable/8/sys/ia64/include/kdb.h stable/8/sys/ia64/include/param.h stable/8/sys/ia64/include/pcpu.h stable/8/sys/ia64/include/pmap.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ia64/ia64/clock.c ============================================================================== --- stable/8/sys/ia64/ia64/clock.c Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/ia64/clock.c Sat Dec 12 05:14:40 2009 (r200431) @@ -64,9 +64,9 @@ void pcpu_initclock(void) { - PCPU_SET(clockadj, 0); - PCPU_SET(clock, ia64_get_itc()); - ia64_set_itm(PCPU_GET(clock) + ia64_clock_reload); + PCPU_SET(md.clockadj, 0); + PCPU_SET(md.clock, ia64_get_itc()); + ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload); ia64_set_itv(CLOCK_VECTOR); /* highest priority class */ ia64_srlz_d(); } Modified: stable/8/sys/ia64/ia64/genassym.c ============================================================================== --- stable/8/sys/ia64/ia64/genassym.c Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/ia64/genassym.c Sat Dec 12 05:14:40 2009 (r200431) @@ -91,7 +91,7 @@ ASSYM(MC_SPECIAL_RNAT, offsetof(mcontext ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_SIZE, PAGE_SIZE); -ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_current_pmap)); +ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_md.current_pmap)); ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread)); Modified: stable/8/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/8/sys/ia64/ia64/interrupt.c Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/ia64/interrupt.c Sat Dec 12 05:14:40 2009 (r200431) @@ -84,28 +84,6 @@ dummy_perf(unsigned long vector, struct void (*perf_irq)(unsigned long, struct trapframe *) = dummy_perf; -static unsigned int ints[MAXCPU]; -SYSCTL_OPAQUE(_debug, OID_AUTO, ints, CTLFLAG_RW, &ints, sizeof(ints), "IU", - ""); - -static unsigned int clks[MAXCPU]; -#ifdef SMP -SYSCTL_OPAQUE(_debug, OID_AUTO, clks, CTLFLAG_RW, &clks, sizeof(clks), "IU", - ""); -#else -SYSCTL_INT(_debug, OID_AUTO, clks, CTLFLAG_RW, clks, 0, ""); -#endif - -#ifdef SMP -static unsigned int asts[MAXCPU]; -SYSCTL_OPAQUE(_debug, OID_AUTO, asts, CTLFLAG_RW, &asts, sizeof(asts), "IU", - ""); - -static unsigned int rdvs[MAXCPU]; -SYSCTL_OPAQUE(_debug, OID_AUTO, rdvs, CTLFLAG_RW, &rdvs, sizeof(rdvs), "IU", - ""); -#endif - SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, "clock statistics"); static int adjust_edges = 0; @@ -139,6 +117,8 @@ interrupt(struct trapframe *tf) td = curthread; + PCPU_INC(cnt.v_intr); + vector = tf->tf_special.ifa; next: @@ -149,33 +129,35 @@ interrupt(struct trapframe *tf) * to add it to this switch-like construct. */ if (vector == 0) { + PCPU_INC(md.stats.pcs_nextints); inta = ib->ib_inta; - printf("ExtINT interrupt: vector=%u\n", (int)inta); if (inta == 15) { + PCPU_INC(md.stats.pcs_nstrays); __asm __volatile("mov cr.eoi = r0;; srlz.d"); goto stray; } vector = (int)inta; - } else if (vector == 15) + } else if (vector == 15) { + PCPU_INC(md.stats.pcs_nstrays); goto stray; + } if (vector == CLOCK_VECTOR) {/* clock interrupt */ /* CTR0(KTR_INTR, "clock interrupt"); */ itc = ia64_get_itc(); - PCPU_INC(cnt.v_intr); + PCPU_INC(md.stats.pcs_nclks); #ifdef EVCNT_COUNTERS clock_intr_evcnt.ev_count++; #else intrcnt[INTRCNT_CLOCK]++; #endif - clks[PCPU_GET(cpuid)]++; critical_enter(); - adj = PCPU_GET(clockadj); - clk = PCPU_GET(clock); + adj = PCPU_GET(md.clockadj); + clk = PCPU_GET(md.clock); delta = itc - clk; count = 0; while (delta >= ia64_clock_reload) { @@ -206,33 +188,36 @@ interrupt(struct trapframe *tf) adj = 0; adjust_excess++; } - PCPU_SET(clock, clk); - PCPU_SET(clockadj, adj); + PCPU_SET(md.clock, clk); + PCPU_SET(md.clockadj, adj); critical_exit(); ia64_srlz_d(); #ifdef SMP } else if (vector == ipi_vector[IPI_AST]) { - asts[PCPU_GET(cpuid)]++; + PCPU_INC(md.stats.pcs_nasts); CTR1(KTR_SMP, "IPI_AST, cpuid=%d", PCPU_GET(cpuid)); } else if (vector == ipi_vector[IPI_HIGH_FP]) { + PCPU_INC(md.stats.pcs_nhighfps); ia64_highfp_save_ipi(); } else if (vector == ipi_vector[IPI_RENDEZVOUS]) { - rdvs[PCPU_GET(cpuid)]++; + PCPU_INC(md.stats.pcs_nrdvs); CTR1(KTR_SMP, "IPI_RENDEZVOUS, cpuid=%d", PCPU_GET(cpuid)); enable_intr(); smp_rendezvous_action(); disable_intr(); } else if (vector == ipi_vector[IPI_STOP]) { + PCPU_INC(md.stats.pcs_nstops); cpumask_t mybit = PCPU_GET(cpumask); - savectx(PCPU_PTR(pcb)); + savectx(PCPU_PTR(md.pcb)); atomic_set_int(&stopped_cpus, mybit); while ((started_cpus & mybit) == 0) cpu_spinwait(); atomic_clear_int(&started_cpus, mybit); atomic_clear_int(&stopped_cpus, mybit); } else if (vector == ipi_vector[IPI_PREEMPT]) { + PCPU_INC(md.stats.pcs_npreempts); CTR1(KTR_SMP, "IPI_PREEMPT, cpuid=%d", PCPU_GET(cpuid)); __asm __volatile("mov cr.eoi = r0;; srlz.d"); enable_intr(); @@ -241,7 +226,7 @@ interrupt(struct trapframe *tf) goto stray; #endif } else { - ints[PCPU_GET(cpuid)]++; + PCPU_INC(md.stats.pcs_nhwints); atomic_add_int(&td->td_intr_nesting_level, 1); ia64_dispatch_intr(tf, vector); atomic_subtract_int(&td->td_intr_nesting_level, 1); Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/ia64/machdep.c Sat Dec 12 05:14:40 2009 (r200431) @@ -101,6 +101,8 @@ __FBSDID("$FreeBSD$"); #include +SYSCTL_NODE(_machdep, OID_AUTO, cpu, CTLFLAG_RD, 0, ""); + u_int64_t processor_frequency; u_int64_t bus_frequency; u_int64_t itc_frequency; @@ -139,8 +141,6 @@ SYSCTL_STRING(_hw, OID_AUTO, family, CTL extern vm_offset_t ksym_start, ksym_end; #endif -static void cpu_startup(void *); -SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); struct msgbuf *msgbufp = NULL; @@ -247,9 +247,11 @@ identifycpu(void) } static void -cpu_startup(dummy) - void *dummy; +cpu_startup(void *dummy) { + char nodename[16]; + struct pcpu *pc; + struct pcpu_stats *pcs; /* * Good {morning,afternoon,evening,night}. @@ -302,7 +304,68 @@ cpu_startup(dummy) */ ia64_probe_sapics(); ia64_mca_init(); + + /* + * Create sysctl tree for per-CPU information. + */ + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + snprintf(nodename, sizeof(nodename), "%u", pc->pc_cpuid); + sysctl_ctx_init(&pc->pc_md.sysctl_ctx); + pc->pc_md.sysctl_tree = SYSCTL_ADD_NODE(&pc->pc_md.sysctl_ctx, + SYSCTL_STATIC_CHILDREN(_machdep_cpu), OID_AUTO, nodename, + CTLFLAG_RD, NULL, ""); + if (pc->pc_md.sysctl_tree == NULL) + continue; + + pcs = &pc->pc_md.stats; + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nasts", CTLFLAG_RD, &pcs->pcs_nasts, + "Number of IPI_AST interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nclks", CTLFLAG_RD, &pcs->pcs_nclks, + "Number of clock interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nextints", CTLFLAG_RD, &pcs->pcs_nextints, + "Number of ExtINT interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nhighfps", CTLFLAG_RD, &pcs->pcs_nhighfps, + "Number of IPI_HIGH_FP interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nhwints", CTLFLAG_RD, &pcs->pcs_nhwints, + "Number of hardware (device) interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "npreempts", CTLFLAG_RD, &pcs->pcs_npreempts, + "Number of IPI_PREEMPT interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nrdvs", CTLFLAG_RD, &pcs->pcs_nrdvs, + "Number of IPI_RENDEZVOUS interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nstops", CTLFLAG_RD, &pcs->pcs_nstops, + "Number of IPI_STOP interrupts"); + + SYSCTL_ADD_ULONG(&pc->pc_md.sysctl_ctx, + SYSCTL_CHILDREN(pc->pc_md.sysctl_tree), OID_AUTO, + "nstrays", CTLFLAG_RD, &pcs->pcs_nstrays, + "Number of stray vectors"); + } } +SYSINIT(cpu_startup, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL); void cpu_boot(int howto) Modified: stable/8/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/mp_machdep.c Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/ia64/mp_machdep.c Sat Dec 12 05:14:40 2009 (r200431) @@ -76,7 +76,6 @@ void ia64_ap_startup(void); /* Variables used by os_boot_rendez and ia64_ap_startup */ struct pcpu *ap_pcpu; void *ap_stack; -uint64_t ap_vhpt; volatile int ap_delay; volatile int ap_awake; volatile int ap_spin; @@ -116,13 +115,15 @@ void ia64_ap_startup(void) { volatile struct ia64_interrupt_block *ib = IA64_INTERRUPT_BLOCK; + uint64_t vhpt; int vector; pcpup = ap_pcpu; ia64_set_k4((intptr_t)pcpup); - map_vhpt(ap_vhpt); - ia64_set_pta(ap_vhpt + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); + vhpt = PCPU_GET(md.vhpt); + map_vhpt(vhpt); + ia64_set_pta(vhpt + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); ia64_srlz_i(); ap_awake = 1; @@ -225,7 +226,7 @@ cpu_mp_add(u_int acpiid, u_int apicid, u pc = pcpup; pc->pc_acpi_id = acpiid; - pc->pc_lid = lid; + pc->pc_md.lid = lid; all_cpus |= (1UL << cpuid); } @@ -239,8 +240,8 @@ cpu_mp_announce() pc = pcpu_find(i); if (pc != NULL) { printf("cpu%d: ACPI Id=%x, SAPIC Id=%x, SAPIC Eid=%x", - i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_lid), - LID_SAPIC_EID(pc->pc_lid)); + i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_md.lid), + LID_SAPIC_EID(pc->pc_md.lid)); if (i == 0) printf(" (BSP)\n"); else @@ -257,13 +258,18 @@ cpu_mp_start() ap_spin = 1; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { - pc->pc_current_pmap = kernel_pmap; + pc->pc_md.current_pmap = kernel_pmap; pc->pc_other_cpus = all_cpus & ~pc->pc_cpumask; if (pc->pc_cpuid > 0) { ap_pcpu = pc; + pc->pc_md.vhpt = pmap_alloc_vhpt(); + if (pc->pc_md.vhpt == 0) { + printf("SMP: WARNING: unable to allocate VHPT" + " for cpu%d", pc->pc_cpuid); + continue; + } ap_stack = malloc(KSTACK_PAGES * PAGE_SIZE, M_SMP, M_WAITOK); - ap_vhpt = pmap_vhpt_base[pc->pc_cpuid]; ap_delay = 2000; ap_awake = 0; @@ -275,13 +281,13 @@ cpu_mp_start() do { DELAY(1000); } while (--ap_delay > 0); - pc->pc_awake = ap_awake; + pc->pc_md.awake = ap_awake; if (!ap_awake) printf("SMP: WARNING: cpu%d did not wake up\n", pc->pc_cpuid); } else - pc->pc_awake = 1; + pc->pc_md.awake = 1; } } @@ -298,7 +304,7 @@ cpu_mp_unleash(void *dummy) smp_cpus = 0; SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { cpus++; - if (pc->pc_awake) { + if (pc->pc_md.awake) { kproc_create(ia64_store_mca_state, (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, "mca %u", pc->pc_cpuid); @@ -361,7 +367,7 @@ ipi_send(struct pcpu *cpu, int ipi) uint64_t vector; pipi = __MEMIO_ADDR(ia64_lapic_address | - ((cpu->pc_lid & LID_SAPIC_MASK) >> 12)); + ((cpu->pc_md.lid & LID_SAPIC_MASK) >> 12)); vector = (uint64_t)(ipi_vector[ipi] & 0xff); KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); *pipi = vector; Modified: stable/8/sys/ia64/ia64/pmap.c ============================================================================== --- stable/8/sys/ia64/ia64/pmap.c Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/ia64/pmap.c Sat Dec 12 05:14:40 2009 (r200431) @@ -217,8 +217,6 @@ int pmap_vhpt_nbuckets; SYSCTL_INT(_machdep_vhpt, OID_AUTO, nbuckets, CTLFLAG_RD, &pmap_vhpt_nbuckets, 0, ""); -uint64_t pmap_vhpt_base[MAXCPU]; - int pmap_vhpt_log2size = 0; TUNABLE_INT("machdep.vhpt.log2size", &pmap_vhpt_log2size); SYSCTL_INT(_machdep_vhpt, OID_AUTO, log2size, CTLFLAG_RD, @@ -277,6 +275,40 @@ pmap_steal_memory(vm_size_t size) return va; } +static void +pmap_initialize_vhpt(vm_offset_t vhpt) +{ + struct ia64_lpte *pte; + u_int i; + + pte = (struct ia64_lpte *)vhpt; + for (i = 0; i < pmap_vhpt_nbuckets; i++) { + pte[i].pte = 0; + pte[i].itir = 0; + pte[i].tag = 1UL << 63; /* Invalid tag */ + pte[i].chain = (uintptr_t)(pmap_vhpt_bucket + i); + } +} + +#ifdef SMP +MALLOC_DECLARE(M_SMP); + +vm_offset_t +pmap_alloc_vhpt(void) +{ + vm_offset_t vhpt; + vm_size_t size; + + size = 1UL << pmap_vhpt_log2size; + vhpt = (uintptr_t)contigmalloc(size, M_SMP, 0, 0UL, ~0UL, size, 0UL); + if (vhpt != 0) { + vhpt = IA64_PHYS_TO_RR7(ia64_tpa(vhpt)); + pmap_initialize_vhpt(vhpt); + } + return (vhpt); +} +#endif + /* * Bootstrap the system enough to run with virtual memory. */ @@ -284,8 +316,7 @@ void pmap_bootstrap() { struct ia64_pal_result res; - struct ia64_lpte *pte; - vm_offset_t base, limit; + vm_offset_t base; size_t size; int i, j, count, ridbits; @@ -365,94 +396,52 @@ pmap_bootstrap() ; count = i+2; - /* - * Figure out a useful size for the VHPT, based on the size of - * physical memory and try to locate a region which is large - * enough to contain the VHPT (which must be a power of two in - * size and aligned to a natural boundary). - * We silently bump up the VHPT size to the minimum size if the - * user has set the tunable too small. Likewise, the VHPT size - * is silently capped to the maximum allowed. - */ TUNABLE_INT_FETCH("machdep.vhpt.log2size", &pmap_vhpt_log2size); - if (pmap_vhpt_log2size == 0) { - pmap_vhpt_log2size = 15; - size = 1UL << pmap_vhpt_log2size; - while (size < Maxmem * 32) { - pmap_vhpt_log2size++; - size <<= 1; - } - } else if (pmap_vhpt_log2size < 15) + if (pmap_vhpt_log2size == 0) + pmap_vhpt_log2size = 20; + else if (pmap_vhpt_log2size < 15) pmap_vhpt_log2size = 15; - if (pmap_vhpt_log2size > 61) + else if (pmap_vhpt_log2size > 61) pmap_vhpt_log2size = 61; - pmap_vhpt_base[0] = 0; - base = limit = 0; + base = 0; size = 1UL << pmap_vhpt_log2size; - while (pmap_vhpt_base[0] == 0) { - if (bootverbose) - printf("Trying VHPT size 0x%lx\n", size); - for (i = 0; i < count; i += 2) { - base = (phys_avail[i] + size - 1) & ~(size - 1); - limit = base + MAXCPU * size; - if (limit <= phys_avail[i+1]) - /* - * VHPT can fit in this region - */ - break; - } - if (!phys_avail[i]) { - /* Can't fit, try next smaller size. */ - pmap_vhpt_log2size--; - size >>= 1; - } else - pmap_vhpt_base[0] = IA64_PHYS_TO_RR7(base); + for (i = 0; i < count; i += 2) { + base = (phys_avail[i] + size - 1) & ~(size - 1); + if (base + size <= phys_avail[i+1]) + break; } - if (pmap_vhpt_log2size < 15) - panic("Can't find space for VHPT"); - - if (bootverbose) - printf("Putting VHPT at 0x%lx\n", base); + if (!phys_avail[i]) + panic("Unable to allocate VHPT"); if (base != phys_avail[i]) { /* Split this region. */ - if (bootverbose) - printf("Splitting [%p-%p]\n", (void *)phys_avail[i], - (void *)phys_avail[i+1]); for (j = count; j > i; j -= 2) { phys_avail[j] = phys_avail[j-2]; phys_avail[j+1] = phys_avail[j-2+1]; } phys_avail[i+1] = base; - phys_avail[i+2] = limit; + phys_avail[i+2] = base + size; } else - phys_avail[i] = limit; + phys_avail[i] = base + size; - pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte); + base = IA64_PHYS_TO_RR7(base); + PCPU_SET(md.vhpt, base); + if (bootverbose) + printf("VHPT: address=%#lx, size=%#lx\n", base, size); + pmap_vhpt_nbuckets = size / sizeof(struct ia64_lpte); pmap_vhpt_bucket = (void *)pmap_steal_memory(pmap_vhpt_nbuckets * sizeof(struct ia64_bucket)); - pte = (struct ia64_lpte *)pmap_vhpt_base[0]; for (i = 0; i < pmap_vhpt_nbuckets; i++) { - pte[i].pte = 0; - pte[i].itir = 0; - pte[i].tag = 1UL << 63; /* Invalid tag */ - pte[i].chain = (uintptr_t)(pmap_vhpt_bucket + i); - /* Stolen memory is zeroed! */ + /* Stolen memory is zeroed. */ mtx_init(&pmap_vhpt_bucket[i].mutex, "VHPT bucket lock", NULL, MTX_NOWITNESS | MTX_SPIN); } - for (i = 1; i < MAXCPU; i++) { - pmap_vhpt_base[i] = pmap_vhpt_base[i - 1] + size; - bcopy((void *)pmap_vhpt_base[i - 1], (void *)pmap_vhpt_base[i], - size); - } - - map_vhpt(pmap_vhpt_base[0]); - ia64_set_pta(pmap_vhpt_base[0] + (1 << 8) + - (pmap_vhpt_log2size << 2) + 1); + pmap_initialize_vhpt(base); + map_vhpt(base); + ia64_set_pta(base + (1 << 8) + (pmap_vhpt_log2size << 2) + 1); ia64_srlz_i(); virtual_avail = VM_MIN_KERNEL_ADDRESS; @@ -466,7 +455,7 @@ pmap_bootstrap() kernel_pmap->pm_rid[i] = 0; kernel_pmap->pm_active = 1; TAILQ_INIT(&kernel_pmap->pm_pvlist); - PCPU_SET(current_pmap, kernel_pmap); + PCPU_SET(md.current_pmap, kernel_pmap); /* * Region 5 is mapped via the vhpt. @@ -551,15 +540,16 @@ static void pmap_invalidate_page(pmap_t pmap, vm_offset_t va) { struct ia64_lpte *pte; - int i, vhpt_ofs; + struct pcpu *pc; + u_int vhpt_ofs; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("invalidating TLB for non-current pmap")); - vhpt_ofs = ia64_thash(va) - pmap_vhpt_base[PCPU_GET(cpuid)]; + vhpt_ofs = ia64_thash(va) - PCPU_GET(md.vhpt); critical_enter(); - for (i = 0; i < MAXCPU; i++) { - pte = (struct ia64_lpte *)(pmap_vhpt_base[i] + vhpt_ofs); + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { + pte = (struct ia64_lpte *)(pc->pc_md.vhpt + vhpt_ofs); if (pte->tag == ia64_ttag(va)) pte->tag = 1UL << 63; } @@ -591,7 +581,7 @@ static void pmap_invalidate_all(pmap_t pmap) { - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("invalidating TLB for non-current pmap")); #ifdef SMP @@ -1172,7 +1162,7 @@ pmap_remove_pte(pmap_t pmap, struct ia64 int error; vm_page_t m; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("removing pte for non-current pmap")); /* @@ -1340,7 +1330,7 @@ pmap_remove_page(pmap_t pmap, vm_offset_ { struct ia64_lpte *pte; - KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(current_pmap)), + KASSERT((pmap == kernel_pmap || pmap == PCPU_GET(md.current_pmap)), ("removing page for non-current pmap")); pte = pmap_find_vhpt(va); @@ -2251,7 +2241,7 @@ pmap_switch(pmap_t pm) int i; critical_enter(); - prevpm = PCPU_GET(current_pmap); + prevpm = PCPU_GET(md.current_pmap); if (prevpm == pm) goto out; if (prevpm != NULL) @@ -2268,7 +2258,7 @@ pmap_switch(pmap_t pm) } atomic_set_32(&pm->pm_active, PCPU_GET(cpumask)); } - PCPU_SET(current_pmap, pm); + PCPU_SET(md.current_pmap, pm); ia64_srlz_d(); out: Modified: stable/8/sys/ia64/include/kdb.h ============================================================================== --- stable/8/sys/ia64/include/kdb.h Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/include/kdb.h Sat Dec 12 05:14:40 2009 (r200431) @@ -33,7 +33,7 @@ #include #include -#define KDB_STOPPEDPCB(pc) (&(pc)->pc_pcb) +#define KDB_STOPPEDPCB(pc) (&(pc)->pc_md.pcb) static __inline void kdb_cpu_clear_singlestep(void) Modified: stable/8/sys/ia64/include/param.h ============================================================================== --- stable/8/sys/ia64/include/param.h Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/include/param.h Sat Dec 12 05:14:40 2009 (r200431) @@ -70,7 +70,7 @@ #endif #if defined(SMP) || defined(KLD_MODULE) -#define MAXCPU 4 +#define MAXCPU 32 #else #define MAXCPU 1 #endif Modified: stable/8/sys/ia64/include/pcpu.h ============================================================================== --- stable/8/sys/ia64/include/pcpu.h Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/include/pcpu.h Sat Dec 12 05:14:40 2009 (r200431) @@ -30,16 +30,39 @@ #ifndef _MACHINE_PCPU_H_ #define _MACHINE_PCPU_H_ +#include #include +struct pcpu_stats { + u_long pcs_nasts; /* IPI_AST counter. */ + u_long pcs_nclks; /* Clock interrupt counter. */ + u_long pcs_nextints; /* ExtINT counter. */ + u_long pcs_nhighfps; /* IPI_HIGH_FP counter. */ + u_long pcs_nhwints; /* Hardware int. counter. */ + u_long pcs_npreempts; /* IPI_PREEMPT counter. */ + u_long pcs_nrdvs; /* IPI_RENDEZVOUS counter. */ + u_long pcs_nstops; /* IPI_STOP counter. */ + u_long pcs_nstrays; /* Stray interrupt counter. */ +}; + +struct pcpu_md { + struct pcb pcb; /* Used by IPI_STOP */ + struct pmap *current_pmap; /* active pmap */ + vm_offset_t vhpt; /* Address of VHPT */ + uint64_t lid; /* local CPU ID */ + uint64_t clock; /* Clock counter. */ + uint64_t clockadj; /* Clock adjust. */ + uint32_t awake:1; /* CPU is awake? */ + struct pcpu_stats stats; /* Interrupt stats. */ +#ifdef _KERNEL + struct sysctl_ctx_list sysctl_ctx; + struct sysctl_oid *sysctl_tree; +#endif +}; + #define PCPU_MD_FIELDS \ - struct pcb pc_pcb; /* Used by IPI_STOP */ \ - struct pmap *pc_current_pmap; /* active pmap */ \ - uint64_t pc_lid; /* local CPU ID */ \ - uint64_t pc_clock; /* Clock counter. */ \ - uint64_t pc_clockadj; /* Clock adjust. */ \ - uint32_t pc_awake:1; /* CPU is awake? */ \ - uint32_t pc_acpi_id /* ACPI CPU id. */ + uint32_t pc_acpi_id; /* ACPI CPU id. */ \ + struct pcpu_md pc_md /* MD fields. */ #ifdef _KERNEL Modified: stable/8/sys/ia64/include/pmap.h ============================================================================== --- stable/8/sys/ia64/include/pmap.h Sat Dec 12 04:50:04 2009 (r200430) +++ stable/8/sys/ia64/include/pmap.h Sat Dec 12 05:14:40 2009 (r200431) @@ -125,6 +125,7 @@ extern int pmap_vhpt_log2size; #define pmap_unmapbios(va, sz) pmap_unmapdev(va, sz) vm_offset_t pmap_steal_memory(vm_size_t); +vm_offset_t pmap_alloc_vhpt(void); void pmap_bootstrap(void); void pmap_kenter(vm_offset_t va, vm_offset_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 05:39:17 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A20911065670; Sat, 12 Dec 2009 05:39:17 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id 4E5D48FC18; Sat, 12 Dec 2009 05:39:17 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.3/8.14.3) with ESMTP id nBC5O8bh020235; Sat, 12 Dec 2009 00:24:08 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.3/8.14.3/Submit) id nBC5O8xP020232; Sat, 12 Dec 2009 00:24:08 -0500 (EST) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19235.10488.325168.267306@hergotha.csail.mit.edu> Date: Sat, 12 Dec 2009 00:24:08 -0500 From: Garrett Wollman To: Hajimu UMEMOTO In-Reply-To: References: <200912102225.nBAMPrZx076758@svn.freebsd.org> X-Mailer: VM 7.17 under 21.4 (patch 21) "Educational Television" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hergotha.csail.mit.edu [127.0.0.1]); Sat, 12 Dec 2009 00:24:08 -0500 (EST) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 05:39:17 -0000 < said: > It's great, thank!! > I believe that our xterm entry was modified not to clear screen when > applications such as less(1) are terminated. Are there any chance to > back to the behavior? I don't understand why people put up with the unspeakably obnoxious "alternate screen" behavior. Please don't tell me someone actually thinks it's *useful*. -GAWollman From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 05:39:18 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDCD31065679; Sat, 12 Dec 2009 05:39:18 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id 969C98FC08; Sat, 12 Dec 2009 05:39:18 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.3/8.14.3) with ESMTP id nBC5Ps4P020253; Sat, 12 Dec 2009 00:25:54 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.3/8.14.3/Submit) id nBC5PsRq020250; Sat, 12 Dec 2009 00:25:54 -0500 (EST) (envelope-from wollman) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19235.10594.497521.83037@hergotha.csail.mit.edu> Date: Sat, 12 Dec 2009 00:25:54 -0500 From: Garrett Wollman To: Robert Watson In-Reply-To: References: <200912082048.nB8Km6aP099420@svn.freebsd.org> <200912081645.37356.jhb@freebsd.org> <20091208221028.GA57735@stack.nl> <200912081742.58162.jhb@freebsd.org> <4B1FAC12.6080907@cs.duke.edu> X-Mailer: VM 7.17 under 21.4 (patch 21) "Educational Television" XEmacs Lucid X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hergotha.csail.mit.edu [127.0.0.1]); Sat, 12 Dec 2009 00:25:54 -0500 (EST) X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hergotha.csail.mit.edu Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r200274 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 05:39:19 -0000 < said: > It's beginning to sound like our POSIX semaphores should be behaving more like > umtx, which requires only a shared page, and less like file descriptors. Of > course, that would make the global namespace more tricky... Ultimately, the problem is that "POSIX semaphores" are actually three different kinds of object, which just happen to ostensibly use the same programming interface. -GAWollman From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 05:46:29 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB7DC1065692 for ; Sat, 12 Dec 2009 05:46:29 +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 5B93E8FC1A for ; Sat, 12 Dec 2009 05:46:29 +0000 (UTC) Received: (qmail 24066 invoked by uid 399); 12 Dec 2009 05:46:28 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 12 Dec 2009 05:46:28 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B232E39.4000305@FreeBSD.org> Date: Fri, 11 Dec 2009 21:46:33 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Garrett Wollman References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB 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, Hajimu UMEMOTO Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 05:46:29 -0000 Garrett Wollman wrote: > < said: > >> It's great, thank!! >> I believe that our xterm entry was modified not to clear screen when >> applications such as less(1) are terminated. Are there any chance to >> back to the behavior? > > > > I don't understand why people put up with the unspeakably obnoxious > "alternate screen" behavior. Please don't tell me someone actually > thinks it's *useful*. I actually liked having the remnants of whatever I was looking at in $PAGER left behind on the screen, and would appreciate it if someone could tell me how to restore that locally. I know that there was a thread about it recently, and I thought I'd saved the e-mail that discussed this issue but I didn't. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 09:24:27 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7C2106566B for ; Sat, 12 Dec 2009 09:24:27 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id A422E8FC08 for ; Sat, 12 Dec 2009 09:24:26 +0000 (UTC) Received: (qmail invoked by alias); 12 Dec 2009 09:24:25 -0000 Received: from p54A3AED0.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.174.208] by mail.gmx.net (mp020) with SMTP; 12 Dec 2009 10:24:25 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX18eW6BSfIwew/XDizgstQBXIxwr4EahwCs2ErKSPY RAHJZsiUapJ6Wt Message-ID: <4B236147.7030603@gmx.de> Date: Sat, 12 Dec 2009 10:24:23 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: Doug Barton References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> In-Reply-To: <4B232E39.4000305@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.54 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hajimu UMEMOTO , Garrett Wollman Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 09:24:27 -0000 Doug Barton wrote: > Garrett Wollman wrote: >> < said: >> >>> It's great, thank!! >>> I believe that our xterm entry was modified not to clear screen when >>> applications such as less(1) are terminated. Are there any chance to >>> back to the behavior? >> >> >> I don't understand why people put up with the unspeakably obnoxious >> "alternate screen" behavior. Please don't tell me someone actually >> thinks it's *useful*. > > I actually liked having the remnants of whatever I was looking at in > $PAGER left behind on the screen, and would appreciate it if someone > could tell me how to restore that locally. %echo $LESS -X % Christoph From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 09:35:59 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 976321065670 for ; Sat, 12 Dec 2009 09:35:59 +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 25A458FC16 for ; Sat, 12 Dec 2009 09:35:58 +0000 (UTC) Received: (qmail 24384 invoked by uid 399); 12 Dec 2009 09:35:58 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 12 Dec 2009 09:35:58 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B236403.2080408@FreeBSD.org> Date: Sat, 12 Dec 2009 01:36:03 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Christoph Mallon References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> In-Reply-To: <4B236147.7030603@gmx.de> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB 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, Hajimu UMEMOTO , Garrett Wollman Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 09:35:59 -0000 Christoph Mallon wrote: > Doug Barton wrote: >> Garrett Wollman wrote: >>> <>> said: >>> >>>> It's great, thank!! >>>> I believe that our xterm entry was modified not to clear screen when >>>> applications such as less(1) are terminated. Are there any chance to >>>> back to the behavior? >>> >>> >>> I don't understand why people put up with the unspeakably obnoxious >>> "alternate screen" behavior. Please don't tell me someone actually >>> thinks it's *useful*. >> >> I actually liked having the remnants of whatever I was looking at in >> $PAGER left behind on the screen, and would appreciate it if someone >> could tell me how to restore that locally. > > %echo $LESS > -X Yeah, I should have been more clear. I am aware of that solution for less, but I also dislike this behavior for vi, etc. Basically, I want to know what to twiddle to get the old behavior back. Doug (but thanks anyway ...) :) -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 09:41:43 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE2C1065679; Sat, 12 Dec 2009 09:41:43 +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 9F9FF8FC0C; Sat, 12 Dec 2009 09:41:41 +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 LAA20185; Sat, 12 Dec 2009 11:41:39 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1NJOTq-000PPO-RM; Sat, 12 Dec 2009 11:41:38 +0200 Message-ID: <4B236520.7040204@freebsd.org> Date: Sat, 12 Dec 2009 11:40:48 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: Doug Barton , Ed Schouten References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> In-Reply-To: <4B236403.2080408@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Christoph Mallon , src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 09:41:43 -0000 on 12/12/2009 11:36 Doug Barton said the following: > Christoph Mallon wrote: >> Doug Barton wrote: >>> Garrett Wollman wrote: >>>> <>>> said: >>>> >>>>> It's great, thank!! >>>>> I believe that our xterm entry was modified not to clear screen when >>>>> applications such as less(1) are terminated. Are there any chance to >>>>> back to the behavior? >>>> >>>> >>>> I don't understand why people put up with the unspeakably obnoxious >>>> "alternate screen" behavior. Please don't tell me someone actually >>>> thinks it's *useful*. >>> I actually liked having the remnants of whatever I was looking at in >>> $PAGER left behind on the screen, and would appreciate it if someone >>> could tell me how to restore that locally. >> %echo $LESS >> -X > > Yeah, I should have been more clear. I am aware of that solution for > less, but I also dislike this behavior for vi, etc. Basically, I want > to know what to twiddle to get the old behavior back. Perhaps, Ed? :-) Seriously, I think that this change is a mild POLA violation, which neither was discussed nor welcome as it seems. Perhaps, not even planned. So I believe that termcap should be changed back to traditional behavior for FreeBSD. At least for now. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 09:51:19 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEF77106566B; Sat, 12 Dec 2009 09:51:19 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 4E7528FC0A; Sat, 12 Dec 2009 09:51:19 +0000 (UTC) Received: by palm.hoeg.nl (Postfix, from userid 1000) id B845A1CC5D; Sat, 12 Dec 2009 10:51:18 +0100 (CET) Date: Sat, 12 Dec 2009 10:51:18 +0100 From: Ed Schouten To: Andriy Gapon Message-ID: <20091212095118.GN64905@hoeg.nl> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B236520.7040204@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KPIC4NnrgppLHFLe" Content-Disposition: inline In-Reply-To: <4B236520.7040204@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Christoph Mallon , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 09:51:19 -0000 --KPIC4NnrgppLHFLe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Andriy Gapon wrote: > Seriously, I think that this change is a mild POLA violation, which > neither was discussed nor welcome as it seems. Perhaps, not even > planned. So I believe that termcap should be changed back to > traditional behavior for FreeBSD. At least for now. Sure. It wasn't planned to do so. I can't fix it right now (sitting at a conference, as we speak), but I'll try to get a patch into SVN tomorrow. Cheers, --=20 Ed Schouten WWW: http://80386.nl/ --KPIC4NnrgppLHFLe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAksjZ5YACgkQ52SDGA2eCwWbyACfYsSBuW8C941aE7tFUsszlWw4 QH8An2qLXQ4hZTXCQxxP8vSk2oqlRF6S =G1rU -----END PGP SIGNATURE----- --KPIC4NnrgppLHFLe-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 09:53:11 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3EF7106568D for ; Sat, 12 Dec 2009 09:53:11 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 04C728FC1E for ; Sat, 12 Dec 2009 09:53:10 +0000 (UTC) Received: (qmail invoked by alias); 12 Dec 2009 09:53:09 -0000 Received: from p54A3AED0.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.174.208] by mail.gmx.net (mp060) with SMTP; 12 Dec 2009 10:53:09 +0100 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/heTwKaF/hEVeRmfzBTFIHuW4/3+pBSuZ/OJ+xl1 igmzJ+ssfsST+G Message-ID: <4B236804.1030001@gmx.de> Date: Sat, 12 Dec 2009 10:53:08 +0100 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: Doug Barton References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> In-Reply-To: <4B236403.2080408@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.51 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Hajimu UMEMOTO , Garrett Wollman Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 09:53:11 -0000 Doug Barton wrote: > Christoph Mallon wrote: >> Doug Barton wrote: >>> Garrett Wollman wrote: >>>> <>>> said: >>>> >>>>> It's great, thank!! >>>>> I believe that our xterm entry was modified not to clear screen when >>>>> applications such as less(1) are terminated. Are there any chance to >>>>> back to the behavior? >>>> >>>> >>>> I don't understand why people put up with the unspeakably obnoxious >>>> "alternate screen" behavior. Please don't tell me someone actually >>>> thinks it's *useful*. >>> I actually liked having the remnants of whatever I was looking at in >>> $PAGER left behind on the screen, and would appreciate it if someone >>> could tell me how to restore that locally. >> %echo $LESS >> -X > > Yeah, I should have been more clear. I am aware of that solution for > less, but I also dislike this behavior for vi, etc. Basically, I want > to know what to twiddle to get the old behavior back. No idea for (n)vi, but for vim you can do this: echo "set t_ti=" >> ~/.vimrc echo "set t_te=" >> ~/.vimrc Christoph From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 10:37:32 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 036DF106566C; Sat, 12 Dec 2009 10:37:32 +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 E204F8FC16; Sat, 12 Dec 2009 10:37: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 nBCAbV71048848; Sat, 12 Dec 2009 10:37:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCAbVeh048839; Sat, 12 Dec 2009 10:37:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912121037.nBCAbVeh048839@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Dec 2009 10:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200432 - in stable/8: . contrib/top lib/libusb sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim tools... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 10:37:32 -0000 Author: mav Date: Sat Dec 12 10:37:31 2009 New Revision: 200432 URL: http://svn.freebsd.org/changeset/base/200432 Log: MFC r200171, r200182, r200275, r200295, r200359: Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this option deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead. As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.(ata|atapi)_dma tunable work again. Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware. Submitted by: nwitehorn (powerpc part) Modified: stable/8/sbin/atacontrol/atacontrol.c stable/8/sys/arm/mv/mv_sata.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/conf/NOTES stable/8/sys/conf/options stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/ata-disk.c stable/8/sys/dev/ata/ata-dma.c stable/8/sys/dev/ata/ata-lowlevel.c stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/ata-queue.c stable/8/sys/dev/ata/ata-sata.c stable/8/sys/dev/ata/ata_if.m stable/8/sys/dev/ata/atapi-cd.c stable/8/sys/dev/ata/atapi-fd.c stable/8/sys/dev/ata/atapi-tape.c stable/8/sys/dev/ata/chipsets/ata-acard.c stable/8/sys/dev/ata/chipsets/ata-acerlabs.c stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-amd.c stable/8/sys/dev/ata/chipsets/ata-ati.c stable/8/sys/dev/ata/chipsets/ata-cenatek.c stable/8/sys/dev/ata/chipsets/ata-cypress.c stable/8/sys/dev/ata/chipsets/ata-cyrix.c stable/8/sys/dev/ata/chipsets/ata-highpoint.c stable/8/sys/dev/ata/chipsets/ata-intel.c stable/8/sys/dev/ata/chipsets/ata-ite.c stable/8/sys/dev/ata/chipsets/ata-jmicron.c stable/8/sys/dev/ata/chipsets/ata-marvell.c stable/8/sys/dev/ata/chipsets/ata-micron.c stable/8/sys/dev/ata/chipsets/ata-national.c stable/8/sys/dev/ata/chipsets/ata-netcell.c stable/8/sys/dev/ata/chipsets/ata-nvidia.c stable/8/sys/dev/ata/chipsets/ata-promise.c stable/8/sys/dev/ata/chipsets/ata-serverworks.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c stable/8/sys/dev/ata/chipsets/ata-sis.c stable/8/sys/dev/ata/chipsets/ata-via.c stable/8/sys/powerpc/powermac/ata_dbdma.c stable/8/sys/powerpc/powermac/ata_kauai.c stable/8/sys/powerpc/powermac/ata_macio.c stable/8/sys/powerpc/psim/ata_iobus.c Directory Properties: stable/8/ (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sbin/atacontrol/atacontrol.c ============================================================================== --- stable/8/sbin/atacontrol/atacontrol.c Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sbin/atacontrol/atacontrol.c Sat Dec 12 10:37:31 2009 (r200432) @@ -42,7 +42,7 @@ static const char * mode2str(int mode) { - switch (mode) { + switch (mode & 0xff) { case ATA_PIO: return "BIOSPIO"; case ATA_PIO0: return "PIO0"; case ATA_PIO1: return "PIO1"; @@ -59,13 +59,23 @@ mode2str(int mode) case ATA_UDMA4: return "UDMA66"; case ATA_UDMA5: return "UDMA100"; case ATA_UDMA6: return "UDMA133"; - case ATA_SA150: return "SATA150"; - case ATA_SA300: return "SATA300"; case ATA_DMA: return "BIOSDMA"; default: return "???"; } } +static const char * +satarev2str(int mode) +{ + switch ((mode & 0xff00) >> 8) { + case 0: return ""; + case 1: return "SATA 1.5Gb/s"; + case 2: return "SATA 3Gb/s"; + case 3: return "SATA 6Gb/s"; + default: return "???"; + } +} + static int str2mode(char *str) { @@ -79,7 +89,9 @@ str2mode(char *str) if (!strcasecmp(str, "WDMA1")) return ATA_WDMA1; if (!strcasecmp(str, "WDMA2")) return ATA_WDMA2; if (!strcasecmp(str, "UDMA0")) return ATA_UDMA0; + if (!strcasecmp(str, "UDMA16")) return ATA_UDMA0; if (!strcasecmp(str, "UDMA1")) return ATA_UDMA1; + if (!strcasecmp(str, "UDMA25")) return ATA_UDMA1; if (!strcasecmp(str, "UDMA2")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA33")) return ATA_UDMA2; if (!strcasecmp(str, "UDMA3")) return ATA_UDMA3; @@ -90,8 +102,6 @@ str2mode(char *str) if (!strcasecmp(str, "UDMA100")) return ATA_UDMA5; if (!strcasecmp(str, "UDMA6")) return ATA_UDMA6; if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6; - if (!strcasecmp(str, "SATA150")) return ATA_SA150; - if (!strcasecmp(str, "SATA300")) return ATA_SA300; if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA; return -1; } @@ -382,7 +392,8 @@ main(int argc, char **argv) if (argc == 3 || argc == 4) { if (ioctl(fd, IOCATAGMODE, &mode) < 0) err(1, "ioctl(IOCATAGMODE)"); - printf("current mode = %s\n", mode2str(mode)); + printf("current mode = %s %s\n", + mode2str(mode), satarev2str(mode)); } exit(EX_OK); } Modified: stable/8/sys/arm/mv/mv_sata.c ============================================================================== --- stable/8/sys/arm/mv/mv_sata.c Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sys/arm/mv/mv_sata.c Sat Dec 12 10:37:31 2009 (r200432) @@ -136,7 +136,8 @@ static int sata_channel_detach(device_t static int sata_channel_begin_transaction(struct ata_request *request); static int sata_channel_end_transaction(struct ata_request *request); static int sata_channel_status(device_t dev); -static void sata_channel_setmode(device_t parent, device_t dev); +static int sata_channel_setmode(device_t dev, int target, int mode); +static int sata_channel_getrev(device_t dev, int target); static void sata_channel_reset(device_t dev); static void sata_channel_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); @@ -423,7 +424,7 @@ sata_channel_attach(device_t dev) ch->dev = dev; ch->unit = device_get_unit(dev); - ch->flags |= ATA_USE_16BIT | ATA_NO_SLAVE; + ch->flags |= ATA_USE_16BIT | ATA_NO_SLAVE | ATA_SATA; /* Set legacy ATA resources. */ for (i = ATA_DATA; i <= ATA_COMMAND; i++) { @@ -748,19 +749,22 @@ sata_channel_reset(device_t dev) SATA_OUTL(sc, SATA_EDMA_IEMR(ch->unit), 0xFFFFFFFF); } -static void -sata_channel_setmode(device_t parent, device_t dev) +static int +sata_channel_setmode(device_t parent, int target, int mode) { - struct ata_device *atadev; - - atadev = device_get_softc(dev); /* Disable EDMA before using legacy registers */ sata_edma_ctrl(parent, 0); + return (ata_sata_setmode(parent, target, mode)); +} - ata_sata_setmode(dev, ATA_PIO_MAX); - if (atadev->mode >= ATA_DMA) - ata_sata_setmode(dev, atadev->mode); +static int +sata_channel_getrev(device_t parent, int target) +{ + + /* Disable EDMA before using legacy registers */ + sata_edma_ctrl(parent, 0); + return (ata_sata_getrev(parent, target)); } static void @@ -849,6 +853,7 @@ static device_method_t sata_channel_meth /* ATA channel interface */ DEVMETHOD(ata_reset, sata_channel_reset), DEVMETHOD(ata_setmode, sata_channel_setmode), + DEVMETHOD(ata_getrev, sata_channel_getrev), { 0, 0 } }; Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sys/cam/ata/ata_xpt.c Sat Dec 12 10:37:31 2009 (r200432) @@ -366,7 +366,7 @@ negotiate: cts.xport_specific.sata.valid = CTS_SATA_VALID_MODE; } xpt_action((union ccb *)&cts); - /* Fetch user modes from SIM. */ + /* Fetch current modes from SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; @@ -395,10 +395,25 @@ negotiate: } case PROBE_SET_MULTI: { - u_int sectors; - - sectors = max(1, min(ident_buf->sectors_intr & 0xff, 16)); + u_int sectors, bytecount; + bytecount = 8192; /* SATA maximum */ + /* Fetch user bytecount from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.ata.bytecount; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.sata.bytecount; + } + /* Honor device capabilities. */ + sectors = max(1, min(ident_buf->sectors_intr & 0xff, + bytecount / ata_logical_sector_size(ident_buf))); /* Report bytecount to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); @@ -414,6 +429,20 @@ negotiate: cts.xport_specific.sata.valid = CTS_SATA_VALID_BYTECOUNT; } xpt_action((union ccb *)&cts); + /* Fetch current bytecount from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.ata.bytecount; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.sata.bytecount; + } + sectors = bytecount / ata_logical_sector_size(ident_buf); cam_fill_ataio(ataio, 1, @@ -427,6 +456,45 @@ negotiate: break; } case PROBE_INQUIRY: + { + u_int bytecount; + + bytecount = 8192; /* SATA maximum */ + /* Fetch user bytecount from SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (path->device->transport == XPORT_ATA) { + if (cts.xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.ata.bytecount; + } else { + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) + bytecount = cts.xport_specific.sata.bytecount; + } + /* Honor device capabilities. */ + bytecount &= ~1; + bytecount = max(2, min(65534, bytecount)); + if (ident_buf->satacapabilities != 0x0000 && + ident_buf->satacapabilities != 0xffff) { + bytecount = min(8192, bytecount); + } + /* Report bytecount to SIM. */ + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; + cts.type = CTS_TYPE_CURRENT_SETTINGS; + if (path->device->transport == XPORT_ATA) { + cts.xport_specific.ata.bytecount = bytecount; + cts.xport_specific.ata.valid = CTS_ATA_VALID_BYTECOUNT; + } else { + cts.xport_specific.sata.bytecount = bytecount; + cts.xport_specific.sata.valid = CTS_SATA_VALID_BYTECOUNT; + } + xpt_action((union ccb *)&cts); + /* FALLTHROUGH */ + } case PROBE_FULL_INQUIRY: { u_int inquiry_len; Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sys/cam/scsi/scsi_cd.c Sat Dec 12 10:37:31 2009 (r200432) @@ -673,6 +673,7 @@ cdregister(struct cam_periph *periph, vo softc->quirks = CD_Q_NONE; /* Check if the SIM does not want 6 byte commands */ + bzero(&cpi, sizeof(cpi)); xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -726,6 +727,12 @@ cdregister(struct cam_periph *periph, vo softc->disk->d_name = "cd"; softc->disk->d_unit = periph->unit_number; softc->disk->d_drv1 = periph; + if (cpi.maxio == 0) + softc->disk->d_maxsize = DFLTPHYS; /* traditional default */ + else if (cpi.maxio > MAXPHYS) + softc->disk->d_maxsize = MAXPHYS; /* for safety */ + else + softc->disk->d_maxsize = cpi.maxio; softc->disk->d_flags = 0; disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); @@ -2768,7 +2775,6 @@ cdcheckmedia(struct cam_periph *periph) softc = (struct cd_softc *)periph->softc; cdprevent(periph, PR_PREVENT); - softc->disk->d_maxsize = DFLTPHYS; softc->disk->d_sectorsize = 2048; softc->disk->d_mediasize = 0; @@ -2870,7 +2876,6 @@ cdcheckmedia(struct cam_periph *periph) } softc->flags |= CD_FLAG_VALID_TOC; - softc->disk->d_maxsize = DFLTPHYS; softc->disk->d_sectorsize = softc->params.blksize; softc->disk->d_mediasize = (off_t)softc->params.blksize * softc->params.disksize; Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sys/conf/NOTES Sat Dec 12 10:37:31 2009 (r200432) @@ -1718,9 +1718,15 @@ hint.ata.1.irq="15" # else the device numbers are dynamically allocated. # ATA_REQUEST_TIMEOUT: the number of seconds to wait for an ATA request # before timing out. +# ATA_CAM: Turn ata(4) subsystem controller drivers into cam(4) +# interface modules. This deprecates all ata(4) +# peripheral device drivers (atadisk, ataraid, atapicd, +# atapifd. atapist, atapicam) and all user-level APIs. +# cam(4) drivers and APIs will be connected instead. options ATA_STATIC_ID #options ATA_REQUEST_TIMEOUT=10 +#options ATA_CAM # # Standard floppy disk controllers and floppy tapes, supports Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sys/conf/options Sat Dec 12 10:37:31 2009 (r200432) @@ -351,6 +351,7 @@ ISCSI_INITIATOR_DEBUG opt_iscsi_initiato ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h ATA_REQUEST_TIMEOUT opt_ata.h +ATA_CAM opt_ata.h # Net stuff. ACCEPT_FILTER_DATA Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Sat Dec 12 05:14:40 2009 (r200431) +++ stable/8/sys/dev/ata/ata-all.c Sat Dec 12 10:37:31 2009 (r200432) @@ -50,6 +50,16 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef ATA_CAM +#include +#include +#include +#include +#include +#include +#endif + +#ifndef ATA_CAM /* device structure */ static d_ioctl_t ata_ioctl; static struct cdevsw ata_cdevsw = { @@ -58,14 +68,21 @@ static struct cdevsw ata_cdevsw = { .d_ioctl = ata_ioctl, .d_name = "ata", }; +#endif /* prototypes */ +#ifndef ATA_CAM static void ata_boot_attach(void); static device_t ata_add_child(device_t, struct ata_device *, int); +#else +static void ataaction(struct cam_sim *sim, union ccb *ccb); +static void atapoll(struct cam_sim *sim); +#endif static void ata_conn_event(void *, int); static void bswap(int8_t *, int); static void btrim(int8_t *, int); static void bpack(int8_t *, int8_t *, int); +static void ata_interrupt_locked(void *data); /* global vars */ MALLOC_DEFINE(M_ATA, "ata_generic", "ATA driver generic layer"); @@ -115,6 +132,10 @@ ata_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); int error, rid; +#ifdef ATA_CAM + struct cam_devq *devq; + int i; +#endif /* check that we have a virgin channel to attach */ if (ch->r_irq) @@ -129,11 +150,23 @@ ata_attach(device_t dev) mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF); TAILQ_INIT(&ch->ata_queue); TASK_INIT(&ch->conntask, 0, ata_conn_event, dev); +#ifdef ATA_CAM + for (i = 0; i < 16; i++) { + ch->user[i].mode = 0; + if (ch->flags & ATA_SATA) + ch->user[i].bytecount = 8192; + else + ch->user[i].bytecount = MAXPHYS; + ch->curr[i] = ch->user[i]; + } +#endif /* reset the controller HW, the channel and device(s) */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit) pause("ataatch", 1); +#ifndef ATA_CAM ATA_RESET(dev); +#endif ATA_LOCKING(dev, ATA_LF_UNLOCK); /* allocate DMA resources if DMA HW present*/ @@ -154,18 +187,61 @@ ata_attach(device_t dev) return error; } +#ifndef ATA_CAM /* probe and attach devices on this channel unless we are in early boot */ if (!ata_delayed_attach) ata_identify(dev); - return 0; + return (0); +#else + mtx_lock(&ch->state_mtx); + /* Create the device queue for our SIM. */ + devq = cam_simq_alloc(1); + if (devq == NULL) { + device_printf(dev, "Unable to allocate simq\n"); + error = ENOMEM; + goto err1; + } + /* Construct SIM entry */ + ch->sim = cam_sim_alloc(ataaction, atapoll, "ata", ch, + device_get_unit(dev), &ch->state_mtx, 1, 0, devq); + if (ch->sim == NULL) { + device_printf(dev, "unable to allocate sim\n"); + error = ENOMEM; + goto err2; + } + if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) { + device_printf(dev, "unable to register xpt bus\n"); + error = ENXIO; + goto err2; + } + if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim), + CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + device_printf(dev, "unable to create path\n"); + error = ENXIO; + goto err3; + } + mtx_unlock(&ch->state_mtx); + return (0); + +err3: + xpt_bus_deregister(cam_sim_path(ch->sim)); +err2: + cam_sim_free(ch->sim, /*free_devq*/TRUE); +err1: + bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); + mtx_unlock(&ch->state_mtx); + return (error); +#endif } int ata_detach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); +#ifndef ATA_CAM device_t *children; int nchildren, i; +#endif /* check that we have a valid channel to detach */ if (!ch->r_irq) @@ -176,6 +252,7 @@ ata_detach(device_t dev) ch->state |= ATA_STALL_QUEUE; mtx_unlock(&ch->state_mtx); +#ifndef ATA_CAM /* detach & delete all children */ if (!device_get_children(dev, &children, &nchildren)) { for (i = 0; i < nchildren; i++) @@ -183,8 +260,18 @@ ata_detach(device_t dev) device_delete_child(dev, children[i]); free(children, M_TEMP); } +#endif taskqueue_drain(taskqueue_thread, &ch->conntask); +#ifdef ATA_CAM + mtx_lock(&ch->state_mtx); + xpt_async(AC_LOST_DEVICE, ch->path, NULL); + xpt_free_path(ch->path); + xpt_bus_deregister(cam_sim_path(ch->sim)); + cam_sim_free(ch->sim, /*free_devq*/TRUE); + mtx_unlock(&ch->state_mtx); +#endif + /* release resources */ bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); @@ -203,8 +290,11 @@ static void ata_conn_event(void *context, int dummy) { device_t dev = (device_t)context; + struct ata_channel *ch = device_get_softc(dev); + mtx_lock(&ch->state_mtx); ata_reinit(dev); + mtx_unlock(&ch->state_mtx); } int @@ -212,6 +302,7 @@ ata_reinit(device_t dev) { struct ata_channel *ch = device_get_softc(dev); struct ata_request *request; +#ifndef ATA_CAM device_t *children; int nchildren, i; @@ -298,7 +389,23 @@ ata_reinit(device_t dev) /* kick off requests on the queue */ ata_start(dev); - return 0; +#else + if ((request = ch->running)) { + ch->running = NULL; + if (ch->state == ATA_ACTIVE) + ch->state = ATA_IDLE; + callout_stop(&request->callout); + if (ch->dma.unload) + ch->dma.unload(request); + request->result = ERESTART; + ata_cam_end_transaction(dev, request); + } + /* reset the controller HW, the channel and device(s) */ + ATA_RESET(dev); + /* Tell the XPT about the event */ + xpt_async(AC_BUS_RESET, ch->path, NULL); +#endif + return(0); } int @@ -310,6 +417,7 @@ ata_suspend(device_t dev) if (!dev || !(ch = device_get_softc(dev))) return ENXIO; +#ifndef ATA_CAM /* wait for the channel to be IDLE or detached before suspending */ while (ch->r_irq) { mtx_lock(&ch->state_mtx); @@ -322,7 +430,8 @@ ata_suspend(device_t dev) tsleep(ch, PRIBIO, "atasusp", hz/10); } ATA_LOCKING(dev, ATA_LF_UNLOCK); - return 0; +#endif + return(0); } int @@ -337,18 +446,36 @@ ata_resume(device_t dev) /* reinit the devices, we dont know what mode/state they are in */ error = ata_reinit(dev); +#ifndef ATA_CAM /* kick off requests on the queue */ ata_start(dev); +#endif return error; } void ata_interrupt(void *data) { +#ifdef ATA_CAM + struct ata_channel *ch = (struct ata_channel *)data; + + mtx_lock(&ch->state_mtx); +#endif + ata_interrupt_locked(data); +#ifdef ATA_CAM + mtx_unlock(&ch->state_mtx); +#endif +} + +static void +ata_interrupt_locked(void *data) +{ struct ata_channel *ch = (struct ata_channel *)data; struct ata_request *request; +#ifndef ATA_CAM mtx_lock(&ch->state_mtx); +#endif do { /* ignore interrupt if its not for us */ if (ch->hw.status && !ch->hw.status(ch->dev)) @@ -374,18 +501,71 @@ ata_interrupt(void *data) ch->running = NULL; if (ch->state == ATA_ACTIVE) ch->state = ATA_IDLE; +#ifdef ATA_CAM + ata_cam_end_transaction(ch->dev, request); +#else mtx_unlock(&ch->state_mtx); ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); ata_finish(request); +#endif return; } } while (0); +#ifndef ATA_CAM mtx_unlock(&ch->state_mtx); +#endif +} + +void +ata_print_cable(device_t dev, u_int8_t *who) +{ + device_printf(dev, + "DMA limited to UDMA33, %s found non-ATA66 cable\n", who); +} + +int +ata_check_80pin(device_t dev, int mode) +{ + struct ata_device *atadev = device_get_softc(dev); + + if (!ata_dma_check_80pin) { + if (bootverbose) + device_printf(dev, "Skipping 80pin cable check\n"); + return mode; + } + + if (mode > ATA_UDMA2 && !(atadev->param.hwres & ATA_CABLE_ID)) { + ata_print_cable(dev, "device"); + mode = ATA_UDMA2; + } + return mode; +} + +void +ata_setmode(device_t dev) +{ + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); + struct ata_device *atadev = device_get_softc(dev); + int error, mode, pmode; + + mode = atadev->mode; + do { + pmode = mode = ata_limit_mode(dev, mode, ATA_DMA_MAX); + mode = ATA_SETMODE(device_get_parent(dev), atadev->unit, mode); + if ((ch->flags & (ATA_CHECKS_CABLE | ATA_SATA)) == 0) + mode = ata_check_80pin(dev, mode); + } while (pmode != mode); /* Interate till successfull negotiation. */ + error = ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode); + if (bootverbose) + device_printf(dev, "%ssetting %s\n", + (error) ? "FAILURE " : "", ata_mode2str(mode)); + atadev->mode = mode; } /* * device related interfaces */ +#ifndef ATA_CAM static int ata_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag, struct thread *td) @@ -467,6 +647,7 @@ ata_ioctl(struct cdev *dev, u_long cmd, } return error; } +#endif int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) @@ -549,11 +730,12 @@ ata_device_ioctl(device_t dev, u_long cm case IOCATASMODE: atadev->mode = *mode; - ATA_SETMODE(device_get_parent(dev), dev); + ata_setmode(dev); return 0; case IOCATAGMODE: - *mode = atadev->mode; + *mode = atadev->mode | + (ATA_GETREV(device_get_parent(dev), atadev->unit) << 8); return 0; case IOCATASSPINDOWN: atadev->spindown = *mode; @@ -566,6 +748,7 @@ ata_device_ioctl(device_t dev, u_long cm } } +#ifndef ATA_CAM static void ata_boot_attach(void) { @@ -590,11 +773,12 @@ ata_boot_attach(void) mtx_unlock(&Giant); /* newbus suckage dealt with, release Giant */ } - +#endif /* * misc support functions */ +#ifndef ATA_CAM static device_t ata_add_child(device_t parent, struct ata_device *atadev, int unit) { @@ -609,6 +793,7 @@ ata_add_child(device_t parent, struct at } return child; } +#endif int ata_getparam(struct ata_device *atadev, int init) @@ -705,6 +890,7 @@ ata_getparam(struct ata_device *atadev, return error; } +#ifndef ATA_CAM int ata_identify(device_t dev) { @@ -778,6 +964,7 @@ ata_identify(device_t dev) mtx_unlock(&Giant); return 0; } +#endif void ata_default_registers(device_t dev) @@ -920,7 +1107,7 @@ ata_unit2str(struct ata_device *atadev) return str; } -char * +const char * ata_mode2str(int mode) { switch (mode) { @@ -950,6 +1137,18 @@ ata_mode2str(int mode) } } +const char * +ata_satarev2str(int rev) +{ + switch (rev) { + case 0: return ""; + case 1: return "SATA 1.5Gb/s"; + case 2: return "SATA 3Gb/s"; + case 3: return "SATA 6Gb/s"; + default: return "???"; + } +} + int ata_atapi(device_t dev) { @@ -1081,6 +1280,358 @@ bpack(int8_t *src, int8_t *dst, int len) dst[j] = 0x00; } +#ifdef ATA_CAM +void +ata_cam_begin_transaction(device_t dev, union ccb *ccb) +{ + struct ata_channel *ch = device_get_softc(dev); + struct ata_request *request; + + if (!(request = ata_alloc_request())) { + device_printf(dev, "FAILURE - out of memory in start\n"); + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + return; + } + bzero(request, sizeof(*request)); + + /* setup request */ + request->dev = NULL; + request->parent = dev; + request->unit = ccb->ccb_h.target_id; + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + request->data = ccb->ataio.data_ptr; + request->bytecount = ccb->ataio.dxfer_len; + request->u.ata.command = ccb->ataio.cmd.command; + request->u.ata.feature = ((uint16_t)ccb->ataio.cmd.features_exp << 8) | + (uint16_t)ccb->ataio.cmd.features; + request->u.ata.count = ((uint16_t)ccb->ataio.cmd.sector_count_exp << 8) | + (uint16_t)ccb->ataio.cmd.sector_count; + if (ccb->ataio.cmd.flags & CAM_ATAIO_48BIT) { + request->flags |= ATA_R_48BIT; + request->u.ata.lba = + ((uint64_t)ccb->ataio.cmd.lba_high_exp << 40) | + ((uint64_t)ccb->ataio.cmd.lba_mid_exp << 32) | + ((uint64_t)ccb->ataio.cmd.lba_low_exp << 24); + } else { + request->u.ata.lba = + ((uint64_t)(ccb->ataio.cmd.device & 0x0f) << 24); + } + request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) | + ((uint64_t)ccb->ataio.cmd.lba_mid << 8) | + (uint64_t)ccb->ataio.cmd.lba_low; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && + ccb->ataio.cmd.flags & CAM_ATAIO_DMA) + request->flags |= ATA_R_DMA; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) + request->flags |= ATA_R_READ; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) + request->flags |= ATA_R_WRITE; + } else { + request->data = ccb->csio.data_ptr; + request->bytecount = ccb->csio.dxfer_len; + bcopy((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes, + request->u.atapi.ccb, ccb->csio.cdb_len); + request->flags |= ATA_R_ATAPI; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && + ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA) + request->flags |= ATA_R_DMA; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) + request->flags |= ATA_R_READ; + if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) + request->flags |= ATA_R_WRITE; + } + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); +// request->callback = ad_done; + request->retries = 0; + request->timeout = (ccb->ccb_h.timeout + 999) / 1000; + callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); + request->ccb = ccb; + + ch->running = request; + ch->state = ATA_ACTIVE; + if (ch->hw.begin_transaction(request) == ATA_OP_FINISHED) { + ch->running = NULL; + ch->state = ATA_IDLE; + ata_cam_end_transaction(dev, request); + return; + } +} + +void +ata_cam_end_transaction(device_t dev, struct ata_request *request) +{ + struct ata_channel *ch = device_get_softc(dev); + union ccb *ccb = request->ccb; + int fatalerr = 0; + + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + if (request->flags & ATA_R_TIMEOUT) { + xpt_freeze_simq(ch->sim, 1); + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + ccb->ccb_h.status |= CAM_CMD_TIMEOUT | CAM_RELEASE_SIMQ; + fatalerr = 1; + } else if (request->status & ATA_S_ERROR) { + if (ccb->ccb_h.func_code == XPT_ATA_IO) { + ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR; + } else { + ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR; + ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; + } + } else if (request->result == ERESTART) + ccb->ccb_h.status |= CAM_REQUEUE_REQ; + else if (request->result != 0) + ccb->ccb_h.status |= CAM_REQ_CMP_ERR; + else + ccb->ccb_h.status |= CAM_REQ_CMP; + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP && + !(ccb->ccb_h.status & CAM_DEV_QFRZN)) { + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status |= CAM_DEV_QFRZN; + } + if (ccb->ccb_h.func_code == XPT_ATA_IO && + ((request->status & ATA_S_ERROR) || + (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT))) { + struct ata_res *res = &ccb->ataio.res; + res->status = request->status; + res->error = request->error; + res->lba_low = request->u.ata.lba; + res->lba_mid = request->u.ata.lba >> 8; + res->lba_high = request->u.ata.lba >> 16; + res->device = request->u.ata.lba >> 24; + res->lba_low_exp = request->u.ata.lba >> 24; + res->lba_mid_exp = request->u.ata.lba >> 32; + res->lba_high_exp = request->u.ata.lba >> 40; + res->sector_count = request->u.ata.count; + res->sector_count_exp = request->u.ata.count >> 8; + } + ata_free_request(request); + xpt_done(ccb); + /* Do error recovery if needed. */ + if (fatalerr) + ata_reinit(dev); +} + +static void +ataaction(struct cam_sim *sim, union ccb *ccb) +{ + device_t dev; + struct ata_channel *ch; + + CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ataaction func_code=%x\n", + ccb->ccb_h.func_code)); + + ch = (struct ata_channel *)cam_sim_softc(sim); + dev = ch->dev; + switch (ccb->ccb_h.func_code) { + /* Common cases first */ + case XPT_ATA_IO: /* Execute the requested I/O operation */ + case XPT_SCSI_IO: + if ((ch->devices & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER) + << ccb->ccb_h.target_id)) == 0) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + break; + } + if (ch->running) + device_printf(dev, "already running!\n"); + if (ccb->ccb_h.func_code == XPT_ATA_IO && + (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && + (ccb->ataio.cmd.control & ATA_A_RESET)) { + struct ata_res *res = &ccb->ataio.res; + + bzero(res, sizeof(*res)); + if (ch->devices & (ATA_ATA_MASTER << ccb->ccb_h.target_id)) { + res->lba_high = 0; + res->lba_mid = 0; + } else { + res->lba_high = 0xeb; + res->lba_mid = 0x14; + } + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } + ata_cam_begin_transaction(dev, ccb); + break; + case XPT_EN_LUN: /* Enable LUN as a target */ + case XPT_TARGET_IO: /* Execute target I/O request */ + case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ + case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ + case XPT_ABORT: /* Abort the specified CCB */ + /* XXX Implement */ + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + break; + case XPT_SET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + struct ata_cam_device *d; + + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) + d->revision = cts->xport_specific.sata.revision; + if (cts->xport_specific.ata.valid & CTS_SATA_VALID_MODE) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + d->mode = ATA_SETMODE(ch->dev, + ccb->ccb_h.target_id, + cts->xport_specific.sata.mode); + } else + d->mode = cts->xport_specific.sata.mode; + } + if (cts->xport_specific.ata.valid & CTS_SATA_VALID_BYTECOUNT) + d->bytecount = min(8192, cts->xport_specific.sata.bytecount); + } else { + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + d->mode = ATA_SETMODE(ch->dev, + ccb->ccb_h.target_id, + cts->xport_specific.ata.mode); + } else + d->mode = cts->xport_specific.ata.mode; + } + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + d->bytecount = cts->xport_specific.ata.bytecount; + if (ch->flags & ATA_SATA) + d->bytecount = min(8192, d->bytecount); + } + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + struct ata_cam_device *d; + + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) + d = &ch->curr[ccb->ccb_h.target_id]; + else + d = &ch->user[ccb->ccb_h.target_id]; + cts->protocol = PROTO_ATA; + cts->protocol_version = PROTO_VERSION_UNSPECIFIED; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + cts->transport = XPORT_SATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.sata.mode = d->mode; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; + cts->xport_specific.sata.bytecount = d->bytecount; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_BYTECOUNT; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + cts->xport_specific.sata.revision = + ATA_GETREV(dev, ccb->ccb_h.target_id); + } else + cts->xport_specific.sata.revision = d->revision; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + } else { + cts->transport = XPORT_ATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.ata.mode = d->mode; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; + cts->xport_specific.ata.bytecount = d->bytecount; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + } + ccb->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 11:02:54 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AFA31065676; Sat, 12 Dec 2009 11:02:54 +0000 (UTC) (envelope-from stone.email@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id A96AF8FC16; Sat, 12 Dec 2009 11:02:53 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so489917eye.9 for ; Sat, 12 Dec 2009 03:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:to:cc:subject :references:date:mime-version:content-transfer-encoding:from :message-id:in-reply-to:user-agent; bh=ZdQWQxxitfZJul6kh6M6GxPWr6L97TgxS5AOAmbDT2E=; b=g1dZQwM6E6MBvm8Zs1//J5l1nBut9xt2xOORkQIFOmQ0pUYfpuTDACwEkVBizDKX+w CNoURhBQFidO4Cpq5XqRTLjv8WEX7AyPaWXDKThxT/+e9MVdoL69TjdzzWwflzEoOzN1 iRX38OO3S8tE9L6PNsWB7n4JF/gS4BxyY2GeM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; b=jnUt82cLAW2C3zWvJhhppASlmsnetF+6tHrgamKPjlUHpoWRD3vDo+6jBKK2F7+PSq scNBqZBAlTmQ54vVzkH/u7kQ1DW7B6b4bpJSGkQeg8PypmoMEOD3rd9O0atPpfpBq8iI /XchOzB7lFMGFp6aUXsa8mto22hzRgq0dySoc= Received: by 10.213.24.25 with SMTP id t25mr868218ebb.98.1260614358656; Sat, 12 Dec 2009 02:39:18 -0800 (PST) Received: from klevas (hst-17-80.splius.lt [77.79.17.80]) by mx.google.com with ESMTPS id 14sm1718725ewy.11.2009.12.12.02.39.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 02:39:17 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Garrett Wollman" , "Hajimu UMEMOTO" References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> Date: Sat, 12 Dec 2009 12:39:13 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andrius Message-ID: In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> User-Agent: Opera Mail/10.10 (FreeBSD) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 11:02:54 -0000 On Sat, 12 Dec 2009 07:24:08 +0200, Garrett Wollman wrote: > < > said: > >> It's great, thank!! >> I believe that our xterm entry was modified not to clear screen when >> applications such as less(1) are terminated. Are there any chance to >> back to the behavior? > > > > I don't understand why people put up with the unspeakably obnoxious > "alternate screen" behavior. Please don't tell me someone actually > thinks it's *useful*. > > -GAWollman I don't just *think* it's useful, I *use* it. There is a thread on the forums about this, it may or may not help you if you want screen cleared. Not sure how changes in current affected it. http://forums.freebsd.org/showthread.php?t=8726 -- Andrius From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 11:52:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9411E106566B; Sat, 12 Dec 2009 11:52:58 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 134AD8FC0C; Sat, 12 Dec 2009 11:52:58 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 1E11DC5915; Sat, 12 Dec 2009 06:52:57 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 12 Dec 2009 06:52:57 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=nB/Xdrb74IME5XV8ZeLD6JgIOcg=; b=cqJSffEwFynVTii2sn3z0py4CXOYM+M+K2t8NxQlCj9AerecIrjLQd9eA1ABChbsYZf6HqesjUUc6YqBhG5aaYCyJb9vH7wlG34oLRC4CiUWuak8NvjFADCUg4RqZeVi5mory4Rf/1UiC1O4SnLW7274bHeNC9N8wQphpcBcT9w= X-Sasl-enc: 2Hc8hmCfuMpbhh9NUFtuhjLDwIdX4adR9iH1gFv+LPj5 1260618776 Received: from empiric.lon.incunabulum.net (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3372A4ACAB0; Sat, 12 Dec 2009 06:52:56 -0500 (EST) Message-ID: <4B238416.5070904@FreeBSD.org> Date: Sat, 12 Dec 2009 11:52:54 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.23 (X11/20091203) MIME-Version: 1.0 To: Alexander Motin References: <200912121037.nBCAbVeh048839@svn.freebsd.org> In-Reply-To: <200912121037.nBCAbVeh048839@svn.freebsd.org> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200432 - in stable/8: . contrib/top lib/libusb sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim tools... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 11:52:58 -0000 Alexander Motin wrote: > Log: > MFC r200171, r200182, r200275, r200295, r200359: > Introduce ATA_CAM kernel option, turning ata(4) controller drivers into > cam(4) interface modules. When enabled, this option deprecates all ata(4) > peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers > (ada, cd, ...) and interfaces to be natively used instead. > Does this not mean there are now two AHCI drivers? i.e. ata(4) with ATA_CAM, and ahci(4). If so, which one is preferred? ahci(4) seems subjectively faster (I have not measured it), although it has a minor issue on my motherboard with ATI SB700 that it does not turn off the HDD activity led. I can see though that this could be difficult to roll out/deploy for default installations from universal media (-RELEASE disc1, memstick), different drivers yield different device names. In one embedded product build I've had to deal with, I use atapicam just to make sure the kernel expects to mount / from the same device, vs when it's booted from an attached USB CDROM drive. I'm using GEOM labels on my home systems to deal with this now, which was a little tricky to set up, but deals with the problem very nicely, as well as making it possible for me to swap disks between physical controllers. tunefs will return no error when the -L option is used when booted into single-user mode -- but if the fs is then mounted, the superblock change seems to be lost. In all other cases, rewriting the superblock is denied. Anyway thanks for all your hard work on this so far... cheers! BMS From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 12:24:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52AAD106566B; Sat, 12 Dec 2009 12:24:27 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED098FC17; Sat, 12 Dec 2009 12:24:25 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 19so757889fgg.13 for ; Sat, 12 Dec 2009 04:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=cofd5VTDAnPHN9pih7qEuwQ5Okeu//y6FlWlT4t8dE4=; b=d6lU77lDKhmmjlI12zhootkp9yhT/e/NyKpjqTLwrqoOvMu1dy2tbYPrUvMCZnLt8q QwZP9zcd63gL3wKMe/gPK+zO0yT+0p39J/m0ycrxJDqvVNInqkAjJQTPGG3RQSlSfJEN isxo1y24ungAUBxGN9cu29qDzH0I1xMBlJT6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=LrkvMBOBwmnMlgmEYygd246Y4PQ9DJGdgkjmruwfb2v5utW34Jf4r9bxponLhd6aGO abLTYNJYQRGqr+xRb7jcZ/fp3LnTPECmDETvi+WCetUII1C5j9jDIm0btCGBaMQkETtv f8p7qgyz/DBgBdvbPLjhSAk8v9DcgOyRgKBwY= Received: by 10.86.206.16 with SMTP id d16mr3223808fgg.5.1260620665174; Sat, 12 Dec 2009 04:24:25 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 16sm965307fxm.8.2009.12.12.04.24.24 (version=SSLv3 cipher=RC4-MD5); Sat, 12 Dec 2009 04:24:24 -0800 (PST) Sender: Alexander Motin Message-ID: <4B238B76.70807@FreeBSD.org> Date: Sat, 12 Dec 2009 14:24:22 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20090901) MIME-Version: 1.0 To: Bruce Simpson References: <200912121037.nBCAbVeh048839@svn.freebsd.org> <4B238416.5070904@FreeBSD.org> In-Reply-To: <4B238416.5070904@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200432 - in stable/8: . contrib/top lib/libusb sbin/atacontrol sys/arm/mv sys/cam/ata sys/cam/scsi sys/conf sys/dev/ata sys/dev/ata/chipsets sys/powerpc/powermac sys/powerpc/psim tools... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 12:24:27 -0000 Bruce Simpson wrote: > Alexander Motin wrote: >> Log: >> MFC r200171, r200182, r200275, r200295, r200359: >> Introduce ATA_CAM kernel option, turning ata(4) controller drivers into >> cam(4) interface modules. When enabled, this option deprecates all >> ata(4) >> peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) >> drivers >> (ada, cd, ...) and interfaces to be natively used instead. >> > Does this not mean there are now two AHCI drivers? i.e. ata(4) with > ATA_CAM, and ahci(4). Yes, you are right: ataahci of ata(4) and ahci(4). Same is for atasiliconimage of ata(4) and siis(4). > If so, which one is preferred? ahci(4) definitely. If you load both, ahci(4) will win attachment. ataahci give you almost no benefits of AHCI. It is only needed for some time to support AHCI hardware in legacy mode, where it is the only alternative. It will be dropped after ATA to CAM migration complete. > ahci(4) seems subjectively faster (I have not measured it), As it should be. On some heavily parallel loads I have got almost double speedup, while speedup of 20-30% is quite usual. > although > it has a minor issue on my motherboard with ATI SB700 that it does not > turn off the HDD activity led. I haven't seen that on my board. Describe it more in private please. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 12:31:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F7521065670; Sat, 12 Dec 2009 12:31: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 5DEAA8FC14; Sat, 12 Dec 2009 12: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 nBCCVBi3052594; Sat, 12 Dec 2009 12:31:11 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCCVBEw052592; Sat, 12 Dec 2009 12:31:11 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912121231.nBCCVBEw052592@svn.freebsd.org> From: Antoine Brodin Date: Sat, 12 Dec 2009 12:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200433 - stable/8/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 12:31:11 -0000 Author: antoine Date: Sat Dec 12 12:31:11 2009 New Revision: 200433 URL: http://svn.freebsd.org/changeset/base/200433 Log: MFC r199186 to stable/8: Fix off by one in ieee80211_send_action_register Found by: phk's FlexeLint in September Reviewed by: rpaulo@ Modified: stable/8/sys/net80211/ieee80211_action.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_action.c ============================================================================== --- stable/8/sys/net80211/ieee80211_action.c Sat Dec 12 10:37:31 2009 (r200432) +++ stable/8/sys/net80211/ieee80211_action.c Sat Dec 12 12:31:11 2009 (r200433) @@ -105,7 +105,7 @@ ieee80211_send_action_register(int cat, meshlm_send_action[act] = f; return 0; case IEEE80211_ACTION_CAT_MESHPATH: - if (act > N(hwmp_send_action)) + if (act >= N(hwmp_send_action)) break; hwmp_send_action[act] = f; return 0; From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 12:34:21 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32E041065670; Sat, 12 Dec 2009 12:34:21 +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 2165C8FC16; Sat, 12 Dec 2009 12:34: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 nBCCYLOc052717; Sat, 12 Dec 2009 12:34:21 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCCYLxf052715; Sat, 12 Dec 2009 12:34:21 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912121234.nBCCYLxf052715@svn.freebsd.org> From: Antoine Brodin Date: Sat, 12 Dec 2009 12:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200434 - stable/8/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 12:34:21 -0000 Author: antoine Date: Sat Dec 12 12:34:20 2009 New Revision: 200434 URL: http://svn.freebsd.org/changeset/base/200434 Log: MFC r199187 to stable/8: Remove trailing ";" in struct ieee80211_beacon_offsets declaration Found by: phk's FlexeLint in September Reviewed by: rpaulo@ Modified: stable/8/sys/net80211/ieee80211_proto.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net80211/ieee80211_proto.h ============================================================================== --- stable/8/sys/net80211/ieee80211_proto.h Sat Dec 12 12:31:11 2009 (r200433) +++ stable/8/sys/net80211/ieee80211_proto.h Sat Dec 12 12:34:20 2009 (r200434) @@ -315,7 +315,7 @@ struct ieee80211_beacon_offsets { uint8_t *bo_ath; /* start of ATH parameters */ uint8_t *bo_appie; /* start of AppIE element */ uint16_t bo_appie_len; /* AppIE length in bytes */ - uint16_t bo_csa_trailer_len;; + uint16_t bo_csa_trailer_len; uint8_t *bo_csa; /* start of CSA element */ uint8_t *bo_meshconf; /* start of MESHCONF element */ uint8_t *bo_spare[3]; From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 12:35:01 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE21A1065692; Sat, 12 Dec 2009 12:35:01 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out0.tiscali.nl (smtp-out0.tiscali.nl [195.241.79.175]) by mx1.freebsd.org (Postfix) with ESMTP id 6573D8FC21; Sat, 12 Dec 2009 12:35:01 +0000 (UTC) Received: from [212.123.145.58] (helo=sjakie.klop.ws) by smtp-out0.tiscali.nl with esmtp (Exim) (envelope-from ) id 1NJRBc-0007Iu-AX; Sat, 12 Dec 2009 13:35:00 +0100 Received: from 82-170-177-25.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id 13BE6151EF; Sat, 12 Dec 2009 13:34:42 +0100 (CET) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "Doug Barton" , "Christoph Mallon" References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> Date: Sat, 12 Dec 2009 13:34:41 +0100 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: <4B236403.2080408@FreeBSD.org> User-Agent: Opera Mail/10.10 (FreeBSD) Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO , Garrett Wollman Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 12:35:01 -0000 On Sat, 12 Dec 2009 10:36:03 +0100, Doug Barton wrote= : > Christoph Mallon wrote: >> Doug Barton wrote: >>> Garrett Wollman wrote: >>>> <>>> said: >>>> >>>>> It's great, thank!! >>>>> I believe that our xterm entry was modified not to clear screen whe= n >>>>> applications such as less(1) are terminated. Are there any chance = to >>>>> back to the behavior? >>>> >>>> >>>> I don't understand why people put up with the unspeakably obnoxious >>>> "alternate screen" behavior. Please don't tell me someone actually >>>> thinks it's *useful*. >>> >>> I actually liked having the remnants of whatever I was looking at in >>> $PAGER left behind on the screen, and would appreciate it if someone >>> could tell me how to restore that locally. >> >> %echo $LESS >> -X > > Yeah, I should have been more clear. I am aware of that solution for > less, but I also dislike this behavior for vi, etc. Basically, I want > to know what to twiddle to get the old behavior back. > > > Doug (but thanks anyway ...) :) > Maybe this? http://lists.freebsd.org/pipermail/svn-src-head/2009-July/009102.html Ronald. From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 12:36:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AF57106566C; Sat, 12 Dec 2009 12:36:42 +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 ED4178FC1C; Sat, 12 Dec 2009 12:36: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 nBCCafde052796; Sat, 12 Dec 2009 12:36:41 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCCafcu052794; Sat, 12 Dec 2009 12:36:41 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912121236.nBCCafcu052794@svn.freebsd.org> From: Antoine Brodin Date: Sat, 12 Dec 2009 12:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200435 - stable/8/sys/boot/uboot/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 12:36:42 -0000 Author: antoine Date: Sat Dec 12 12:36:41 2009 New Revision: 200435 URL: http://svn.freebsd.org/changeset/base/200435 Log: MFC r199193 to stable/8: - Remove trailing ";" after if statement - Remove #if 0 section that was never needed/used Reviewed by: raj@ Modified: stable/8/sys/boot/uboot/lib/glue.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/uboot/lib/glue.c ============================================================================== --- stable/8/sys/boot/uboot/lib/glue.c Sat Dec 12 12:34:20 2009 (r200434) +++ stable/8/sys/boot/uboot/lib/glue.c Sat Dec 12 12:36:41 2009 (r200435) @@ -467,7 +467,7 @@ ub_stor_type(int type) if (type & DT_STOR_USB) return ("USB"); - if (type & DT_STOR_MMC); + if (type & DT_STOR_MMC) return ("MMC"); return ("Unknown"); @@ -581,11 +581,6 @@ ub_env_enum(const char *last) if (!env) /* no more env. variables to enumerate */ return (NULL); -#if 0 - if (last && strncmp(env, last, strlen(last)) == 0); - /* error, trying to enumerate non existing env. variable */ - return NULL; -#endif /* next enumerated env var */ memset(env_name, 0, 256); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 14:44:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E249D1065670; Sat, 12 Dec 2009 14:44:04 +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 CFD2B8FC12; Sat, 12 Dec 2009 14:44:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBCEi46d055610; Sat, 12 Dec 2009 14:44:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCEi4cF055608; Sat, 12 Dec 2009 14:44:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912121444.nBCEi4cF055608@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Dec 2009 14:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200438 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 14:44:05 -0000 Author: kib Date: Sat Dec 12 14:44:04 2009 New Revision: 200438 URL: http://svn.freebsd.org/changeset/base/200438 Log: MFC r200162: Change VOP_FSYNC for zfs vnode from VOP_PANIC to zfs_freebsd_fsync(). Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 12 13:24:06 2009 (r200437) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Dec 12 14:44:04 2009 (r200438) @@ -4983,7 +4983,7 @@ struct vop_vector zfs_vnodeops = { struct vop_vector zfs_fifoops = { .vop_default = &fifo_specops, - .vop_fsync = VOP_PANIC, + .vop_fsync = zfs_freebsd_fsync, .vop_access = zfs_freebsd_access, .vop_getattr = zfs_freebsd_getattr, .vop_inactive = zfs_freebsd_inactive, From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 15:49:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8655D106568F; Sat, 12 Dec 2009 15:49:28 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6258FC18; Sat, 12 Dec 2009 15: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 nBCFnSjP056883; Sat, 12 Dec 2009 15:49:28 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCFnS99056881; Sat, 12 Dec 2009 15:49:28 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <200912121549.nBCFnS99056881@svn.freebsd.org> From: Luigi Rizzo Date: Sat, 12 Dec 2009 15: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: r200439 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 15:49:28 -0000 Author: luigi Date: Sat Dec 12 15:49:28 2009 New Revision: 200439 URL: http://svn.freebsd.org/changeset/base/200439 Log: Make the code buildable in userland so it is easier to test it: this requires a small reordering of headers and a few #defines to map functions not available in userland. Remove a useless #ifndef block at the beginning of the file. Introduce (temporarily) rn_init2(), see the comment in the code for the proper long term change. No ABI or functional change. MFC after: 7 days Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Sat Dec 12 14:44:04 2009 (r200438) +++ head/sys/net/radix.c Sat Dec 12 15:49:28 2009 (r200439) @@ -33,7 +33,6 @@ /* * Routines to build and maintain radix trees for routing lookups. */ -#ifndef _RADIX_H_ #include #ifdef _KERNEL #include @@ -42,19 +41,21 @@ #include #include #include -#else -#include -#endif #include #include -#endif - #include "opt_mpath.h" - #ifdef RADIX_MPATH #include #endif - +#else /* !_KERNEL */ +#include +#include +#include +#define log(x, arg...) fprintf(stderr, ## arg) +#define panic(x) fprintf(stderr, "PANIC: %s", x), exit(1) +#define min(a, b) ((a) < (b) ? (a) : (b) ) +#include +#endif /* !_KERNEL */ static int rn_walktree_from(struct radix_node_head *h, void *a, void *m, walktree_f_t *f, void *w); @@ -1188,3 +1189,19 @@ rn_init() if (rn_inithead((void **)(void *)&mask_rnhead, 0) == 0) panic("rn_init 2"); } + +#ifndef _KERNEL +/* + * A simple function to make the code usable from userland. + * A proper fix (maybe later) would be to change rn_init() so that it + * takes maxkeylen as an argument, and move the scan of + * domains into net/route.c::route_init(). + */ +void rn_init2(int maxk); +void +rn_init2(int maxk) +{ + max_keylen = maxk; + rn_init(); +} +#endif /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 17:04:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28B661065672; Sat, 12 Dec 2009 17:04:37 +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 171D78FC14; Sat, 12 Dec 2009 17:04: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 nBCH4a1t058376; Sat, 12 Dec 2009 17:04:36 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCH4aSJ058373; Sat, 12 Dec 2009 17:04:36 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <200912121704.nBCH4aSJ058373@svn.freebsd.org> From: Antoine Brodin Date: Sat, 12 Dec 2009 17:04: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: r200440 - in head: etc/mtree share/examples X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 17:04:37 -0000 Author: antoine Date: Sat Dec 12 17:04:36 2009 New Revision: 200440 URL: http://svn.freebsd.org/changeset/base/200440 Log: Install firmware(9) examples. MFC after: 1 month Modified: head/etc/mtree/BSD.usr.dist head/share/examples/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Sat Dec 12 15:49:28 2009 (r200439) +++ head/etc/mtree/BSD.usr.dist Sat Dec 12 17:04:36 2009 (r200440) @@ -230,6 +230,12 @@ .. dyn_sysctl .. + firmware + fwconsumer + .. + fwimage + .. + .. syscall module .. Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Sat Dec 12 15:49:28 2009 (r200439) +++ head/share/examples/Makefile Sat Dec 12 17:04:36 2009 (r200440) @@ -88,6 +88,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ kld/dyn_sysctl/Makefile \ kld/dyn_sysctl/README \ kld/dyn_sysctl/dyn_sysctl.c \ + kld/firmware/Makefile \ + kld/firmware/README \ + kld/firmware/fwconsumer/Makefile \ + kld/firmware/fwconsumer/fw_consumer.c \ + kld/firmware/fwimage/Makefile \ + kld/firmware/fwimage/firmware.img \ kld/syscall/Makefile \ kld/syscall/module/Makefile \ kld/syscall/module/syscall.c \ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 17:48:49 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0354106566B; Sat, 12 Dec 2009 17:48:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 5F70A8FC2B; Sat, 12 Dec 2009 17:48:48 +0000 (UTC) Received: from c220-239-235-116.carlnfd3.nsw.optusnet.com.au (c220-239-235-116.carlnfd3.nsw.optusnet.com.au [220.239.235.116]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id nBCHmjPi017321 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 13 Dec 2009 04:48:46 +1100 Date: Sun, 13 Dec 2009 04:48:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Xin LI In-Reply-To: <200912112335.nBBNZdRT023731@svn.freebsd.org> Message-ID: <20091213031047.X32430@delplex.bde.org> References: <200912112335.nBBNZdRT023731@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: r200420 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 17:48:50 -0000 On Fri, 11 Dec 2009, Xin LI wrote: > Log: > Remove unneeded header includes from usr.bin/ except contributed code. Surely many of these are used? > Tested with: make universe Removing includes cannot be tested in this way, since it doesn't provide clean includes, and FreeBSD includes are extremely polluted, so upon removal of some apparently-unused includes, things will compile accidentally due to the pollution. > Modified: > head/usr.bin/ar/util.c > head/usr.bin/c89/c89.c > head/usr.bin/calendar/calendar.c > head/usr.bin/calendar/day.c > head/usr.bin/calendar/ostern.c > head/usr.bin/calendar/paskha.c > head/usr.bin/cksum/Makefile > head/usr.bin/cksum/crc.c > head/usr.bin/cksum/crc32.c > head/usr.bin/cksum/sum1.c > head/usr.bin/cksum/sum2.c > ... For example, most source files in cksum use *intN_t, and these types are only guaranteed (by both C99 and POSIX) to be declared in (and by Standard namespace pollution, also in , and for a couple of these types, also in places like , so most source files in cksum obviously need to include like they used to. For these types, the pollution in FreeBSD is mainly in , where many of these types are declared under an XXX comment about this being a bug, together with much larger pollution involving itself being included a lot, so this and other pollution in it affect many other headers. Removing the used includes of makes it even harder to clean up :-(. > Modified: head/usr.bin/cksum/crc.c > ============================================================================== > --- head/usr.bin/cksum/crc.c Fri Dec 11 23:30:22 2009 (r200419) > +++ head/usr.bin/cksum/crc.c Fri Dec 11 23:35:38 2009 (r200420) > @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); > > #include My unusedinc utilty also reports that most of the includes of "seem to be unused", but this is wrong too. Here is a still documented prerequisite for many (probably most) of the functions in (and thus for any include of ), but this is another bug... > > -#include My unusedinc utilty used to report that this "seems to be unused". It is no smarter than "make universe" here. This utility can also be run on kernels, where it reports tens of thousands of "seems to be unused", each of which needs to be examined individually but this takes too long so I stopped doing it about 10 years ago. /usr/src/tools/tools/kerninclude/ kerninclude.sh uses a more robust algorithm for determining unusedinc'ness, but it doesn't work in userland. (To test the unusedness of , it replaces by an empty file. This removes nested pollution of symbols defined in but not direct pollution of the form #ifndef _UINT32_T_DECLARED typedef __uint32_t uint32_t; #define _UINT32_T_DECLARED #endif , if any. Note that in some cases a direct declaration of *intN_t is required by POSIX, so it is not always pollution, unlike for all the direct declarations of this form in .) > #include includes next to an XXX comment about this being a bug. (POSIX allows this low quality but IIRC doesn't require it, and it certainly doesn't require to inherit bugs from . (It is allowed to declare any foo_t, but it is not permitted to define most of the other pollution that FreeBSD's defines (mainly endianness and select stuff IIRC).)) Related bugs: - in POSIX.1-1988 through POSIX.1-1996, was required before most POSIX headers including , and many (probably most) section 2 man pages in FreeBSD still document this requirement. - However, has had the polluting include of in it since rev.1.1 (just without the XXX in rev.1.1), so this requirement never applied to any of the functions in . I fixed a lot of section to man pages to require iff it was actually required by FreeBSD headers, and intentionally didn't change the ones for functions in since the changes would have to be undone when FreeBSD catches up with POSIX.1-2000, but some imports from OtherBSD didn't follow this policy so we may have more man pages documenting the old-POSIX requirements than we started with. > > #include "extern.h" This uses *intN_t, so it depends on or pollution. cksum also has a few bogus uses of u_char, u_int and u_long. The uses of u_char and u_long seem to be just bugs (I think the u_char's need to be uint8_t, and the u_int for lcrc needs to be at least uint17_t (elsewhere we are more careful and use uintN_t for all CRCs). IIRC, POSIX requires unsigned char uint8_t and u_int to be at least uint32_t, so these bugs are harmless on POSIX systems). The uses of u_long are only to print uint32_t's so they are only portabilty bugs. cksum still spells strrchar as rindex. Apart from these bugs, cksum seems to be a POSIX.1-2008 application: it compilese cleanly with -D_POSIX_C_SOURCE=200809 -Du_char=int8_t -Du_int=uint32_t -Du_long="unsigned long" -Drindex=strrchr. > Modified: head/usr.bin/cksum/crc32.c > ============================================================================== > --- head/usr.bin/cksum/crc32.c Fri Dec 11 23:30:22 2009 (r200419) > +++ head/usr.bin/cksum/crc32.c Fri Dec 11 23:35:38 2009 (r200420) > @@ -17,7 +17,6 @@ __FBSDID("$FreeBSD$"); > #include > > #include > -#include > #include > > #include "extern.h" Similarly for all other files in cksum. I didn't check any other directories (without more automation it can take hours per #include to untangle/understand the pollution so as to verify removals, except for cases that you already understand). Bruce From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 18:04:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F14CA1065672; Sat, 12 Dec 2009 18:04:50 +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 E051E8FC14; Sat, 12 Dec 2009 18:04: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 nBCI4o8I059658; Sat, 12 Dec 2009 18:04:50 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCI4oqf059656; Sat, 12 Dec 2009 18:04:50 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912121804.nBCI4oqf059656@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 12 Dec 2009 18:04: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: r200441 - head/usr.bin/comm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 18:04:51 -0000 Author: jh Date: Sat Dec 12 18:04:50 2009 New Revision: 200441 URL: http://svn.freebsd.org/changeset/base/200441 Log: The input line length limit mentioned on the manual page was removed by r179374. Approved by: trasz (mentor) Modified: head/usr.bin/comm/comm.1 Modified: head/usr.bin/comm/comm.1 ============================================================================== --- head/usr.bin/comm/comm.1 Sat Dec 12 17:04:36 2009 (r200440) +++ head/usr.bin/comm/comm.1 Sat Dec 12 18:04:50 2009 (r200441) @@ -35,7 +35,7 @@ .\" From: @(#)comm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 26, 2005 +.Dd December 12, 2009 .Os .Dt COMM 1 .Sh NAME @@ -118,7 +118,3 @@ A .Nm command appeared in .At v4 . -.Sh BUGS -Input lines are limited to -.Dv LINE_MAX -(2048) characters in length. From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 18:08:05 2009 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED3F81065697; Sat, 12 Dec 2009 18:08:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AD1088FC16; Sat, 12 Dec 2009 18:08:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id nBCI11PG052534; Sat, 12 Dec 2009 11:01:01 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 12 Dec 2009 11:01:24 -0700 (MST) Message-Id: <20091212.110124.295937982870879104.imp@bsdimp.com> To: wollman@bimajority.org From: "M. Warner Losh" In-Reply-To: <19235.10488.325168.267306@hergotha.csail.mit.edu> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, ume@FreeBSD.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 18:08:06 -0000 In message: <19235.10488.325168.267306@hergotha.csail.mit.edu> Garrett Wollman writes: : < said: : : > It's great, thank!! : > I believe that our xterm entry was modified not to clear screen when : > applications such as less(1) are terminated. Are there any chance to : > back to the behavior? : : : : I don't understand why people put up with the unspeakably obnoxious : "alternate screen" behavior. Please don't tell me someone actually : thinks it's *useful*. It is totally evil and unuseful. Or to wax bdeish: "It pessimizes my xterm experience" Warner From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 18:18:46 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF0D31065693; Sat, 12 Dec 2009 18:18:46 +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 ABD308FC2A; Sat, 12 Dec 2009 18:18: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 nBCIIk29059956; Sat, 12 Dec 2009 18:18:46 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCIIkUg059941; Sat, 12 Dec 2009 18:18:46 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912121818.nBCIIkUg059941@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 12 Dec 2009 18:18: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: r200442 - in head: tools/regression/usr.bin tools/regression/usr.bin/comm usr.bin/comm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 18:18:46 -0000 Author: jh Date: Sat Dec 12 18:18:46 2009 New Revision: 200442 URL: http://svn.freebsd.org/changeset/base/200442 Log: Don't read the newline character to line buffer because lines are passed to wcscoll(3). Newline characters could cause incorrect results when comparing lines. Also, if an input line didn't contain a newline character, it was omitted from the output. According to my interpretation, SUSv3 requires that the newline is always printed. Add regression tests for the cases. [1] PR: bin/140976 Submitted by: D'Arcy Cain (original version) [1] Approved by: trasz (mentor) Added: head/tools/regression/usr.bin/comm/ head/tools/regression/usr.bin/comm/Makefile (contents, props changed) head/tools/regression/usr.bin/comm/regress.00.out (contents, props changed) head/tools/regression/usr.bin/comm/regress.00a.in (contents, props changed) head/tools/regression/usr.bin/comm/regress.00b.in (contents, props changed) head/tools/regression/usr.bin/comm/regress.01.out (contents, props changed) head/tools/regression/usr.bin/comm/regress.01a.in (contents, props changed) head/tools/regression/usr.bin/comm/regress.01b.in (contents, props changed) head/tools/regression/usr.bin/comm/regress.02.out (contents, props changed) head/tools/regression/usr.bin/comm/regress.02a.in (contents, props changed) head/tools/regression/usr.bin/comm/regress.02b.in (contents, props changed) head/tools/regression/usr.bin/comm/regress.sh (contents, props changed) head/tools/regression/usr.bin/comm/regress.t (contents, props changed) Modified: head/tools/regression/usr.bin/Makefile head/usr.bin/comm/comm.c Modified: head/tools/regression/usr.bin/Makefile ============================================================================== --- head/tools/regression/usr.bin/Makefile Sat Dec 12 18:04:50 2009 (r200441) +++ head/tools/regression/usr.bin/Makefile Sat Dec 12 18:18:46 2009 (r200442) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= calendar file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm +SUBDIR= calendar comm file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm .include Added: head/tools/regression/usr.bin/comm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/Makefile Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +all: + @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} Added: head/tools/regression/usr.bin/comm/regress.00.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.00.out Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,2 @@ +a b +e f g Added: head/tools/regression/usr.bin/comm/regress.00a.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.00a.in Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,5 @@ +a b +c d +e f +e f g +h i Added: head/tools/regression/usr.bin/comm/regress.00b.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.00b.in Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,2 @@ +a b +e f g Added: head/tools/regression/usr.bin/comm/regress.01.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.01.out Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,2 @@ +a b +e f g Added: head/tools/regression/usr.bin/comm/regress.01a.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.01a.in Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,5 @@ +a b +c d +e f +e f g +h i Added: head/tools/regression/usr.bin/comm/regress.01b.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.01b.in Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,2 @@ +a b +e f g Added: head/tools/regression/usr.bin/comm/regress.02.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.02.out Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,5 @@ +a +b + c + d + e Added: head/tools/regression/usr.bin/comm/regress.02a.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.02a.in Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,3 @@ +a +b +c \ No newline at end of file Added: head/tools/regression/usr.bin/comm/regress.02b.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.02b.in Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,3 @@ +c +d +e \ No newline at end of file Added: head/tools/regression/usr.bin/comm/regress.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.sh Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +LC_ALL=C; export LC_ALL + +echo 1..3 + +REGRESSION_START($1) + +REGRESSION_TEST(`00', `comm -12 regress.00a.in regress.00b.in') +REGRESSION_TEST(`01', `comm -12 regress.01a.in regress.01b.in') +REGRESSION_TEST(`02', `comm regress.02a.in regress.02b.in') + +REGRESSION_END() Added: head/tools/regression/usr.bin/comm/regress.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/comm/regress.t Sat Dec 12 18:18:46 2009 (r200442) @@ -0,0 +1,6 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +m4 ../regress.m4 regress.sh | sh Modified: head/usr.bin/comm/comm.c ============================================================================== --- head/usr.bin/comm/comm.c Sat Dec 12 18:04:50 2009 (r200441) +++ head/usr.bin/comm/comm.c Sat Dec 12 18:18:46 2009 (r200442) @@ -163,7 +163,7 @@ main(int argc, char *argv[]) if (!comp) { read1 = read2 = 1; if (col3 != NULL) - (void)printf("%ls%ls", col3, line1); + (void)printf("%ls%ls\n", col3, line1); continue; } @@ -172,12 +172,12 @@ main(int argc, char *argv[]) read1 = 1; read2 = 0; if (col1 != NULL) - (void)printf("%ls%ls", col1, line1); + (void)printf("%ls%ls\n", col1, line1); } else { read1 = 0; read2 = 1; if (col2 != NULL) - (void)printf("%ls%ls", col2, line2); + (void)printf("%ls%ls\n", col2, line2); } } exit(0); @@ -190,19 +190,16 @@ getline(wchar_t *buf, size_t *buflen, FI wint_t ch; bufpos = 0; - do { - if ((ch = getwc(fp)) != WEOF) { - if (bufpos + 2 >= *buflen) { - *buflen = *buflen * 2; - buf = reallocf(buf, *buflen * sizeof(*buf)); - if (buf == NULL) - return (NULL); - } - buf[bufpos++] = ch; + while ((ch = getwc(fp)) != WEOF && ch != '\n') { + if (bufpos + 1 >= *buflen) { + *buflen = *buflen * 2; + buf = reallocf(buf, *buflen * sizeof(*buf)); + if (buf == NULL) + return (NULL); } - } while (ch != WEOF && ch != '\n'); - if (bufpos + 1 != *buflen) - buf[bufpos] = '\0'; + buf[bufpos++] = ch; + } + buf[bufpos] = '\0'; return (bufpos != 0 || ch == '\n' ? buf : NULL); } @@ -212,7 +209,7 @@ show(FILE *fp, const char *fn, const wch { do { - (void)printf("%ls%ls", offset, buf); + (void)printf("%ls%ls\n", offset, buf); } while ((buf = getline(buf, buflen, fp)) != NULL); if (ferror(fp)) err(1, "%s", fn); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 19:35:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE3F1065679 for ; Sat, 12 Dec 2009 19:35:40 +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 770A98FC19 for ; Sat, 12 Dec 2009 19:35:39 +0000 (UTC) Received: (qmail 7273 invoked by uid 399); 12 Dec 2009 19:35:38 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 12 Dec 2009 19:35:38 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B23F090.10207@FreeBSD.org> Date: Sat, 12 Dec 2009 11:35:44 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Ronald Klop References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Hajimu UMEMOTO , svn-src-all@freebsd.org, Garrett Wollman , svn-src-head@freebsd.org, Christoph Mallon Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 19:35:40 -0000 Ronald Klop wrote: > Maybe this? > http://lists.freebsd.org/pipermail/svn-src-head/2009-July/009102.html YES! I knew it was something simple and clever like that but I couldn't find it. Thanks Ronald (and des for posting the original). To be clear, I am NOT asking for a backout ... IIRC in the thread that discussed this issue there were quite a few people who thought that FreeBSD not clearing the screen was a POLA violation since that's what linux does, and it's what most people are used to. What I would suggest is that whichever way we ultimately go with it that we put a clearly worded example in both the termcap file and termcap.5 that shows how to do the OTHER way. And yes, I will volunteer to write both of them once there is a consensus. FWIW, what I actually did that is working so far is: cat ~/.termcap xterm|xterm-color:ti@:te@:tc=xterm-new hth, Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 19:46:16 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AA74106568D for ; Sat, 12 Dec 2009 19:46:16 +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 ACE9C8FC12 for ; Sat, 12 Dec 2009 19:46:15 +0000 (UTC) Received: (qmail 20936 invoked by uid 399); 12 Dec 2009 19:46:15 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 12 Dec 2009 19:46:15 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B23F30D.3020107@FreeBSD.org> Date: Sat, 12 Dec 2009 11:46:21 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Xin LI References: <200912112335.nBBNZdRT023731@svn.freebsd.org> In-Reply-To: <200912112335.nBBNZdRT023731@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200420 - in head/usr.bin: ar c89 calendar cksum cmp colcrt colrm compress cpuset expand fetch file2c find finger fmt fold gcore getopt hexdump jot killall ktrace lastcomm limits lock l... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 19:46:16 -0000 Xin LI wrote: > Author: delphij > Date: Fri Dec 11 23:35:38 2009 > New Revision: 200420 > URL: http://svn.freebsd.org/changeset/base/200420 > > Log: > Remove unneeded header includes from usr.bin/ except contributed code. > > Tested with: make universe I don't want to "pile on" here but I am also curious about how the end results were tested. My understanding is that the traditional way to test these kinds of things is to checksum the binaries before and after the change to see if they are identical, and I was wondering if that was done here and if not why it is not necessary. That said, I'm certain that you must have put quite a lot of work into this and it must be difficult for you to hear so many questions after the fact. Rest assured that the effort you put into this IS appreciated. :) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 19:56:05 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34493106566C; Sat, 12 Dec 2009 19:56:05 +0000 (UTC) (envelope-from simon@nitro.dk) Received: from mx.nitro.dk (unknown [77.75.165.90]) by mx1.freebsd.org (Postfix) with ESMTP id E66208FC13; Sat, 12 Dec 2009 19:56:04 +0000 (UTC) Received: from arthur.nitro.dk (arthur.bofh [192.168.2.3]) by mx.nitro.dk (Postfix) with ESMTP id 159B82D48CD; Sat, 12 Dec 2009 19:53:29 +0000 (UTC) Received: by arthur.nitro.dk (Postfix, from userid 1000) id 69D105C19; Sat, 12 Dec 2009 20:56:03 +0100 (CET) Date: Sat, 12 Dec 2009 20:56:03 +0100 From: "Simon L. Nielsen" To: Doug Barton Message-ID: <20091212195602.GE1417@arthur.nitro.dk> References: <200912102225.nBAMPrZx076758@svn.freebsd.org> <19235.10488.325168.267306@hergotha.csail.mit.edu> <4B232E39.4000305@FreeBSD.org> <4B236147.7030603@gmx.de> <4B236403.2080408@FreeBSD.org> <4B23F090.10207@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B23F090.10207@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200369 - in head: etc share/termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 19:56:05 -0000 [CC cleaned up] On 2009.12.12 11:35:44 -0800, Doug Barton wrote: > Ronald Klop wrote: > > Maybe this? > > http://lists.freebsd.org/pipermail/svn-src-head/2009-July/009102.html > > YES! I knew it was something simple and clever like that but I > couldn't find it. Thanks Ronald (and des for posting the original). > > To be clear, I am NOT asking for a backout ... IIRC in the thread that > discussed this issue there were quite a few people who thought that > FreeBSD not clearing the screen was a POLA violation since that's what > linux does, and it's what most people are used to. And most likely there are equally many FreeBSD users who are annoyed whenever they have to touch a linux box that's it's behaving like that... so, personally I would really like to see the old behavior restored. [The mail is mainly in case anybody is trying to weigh the opinion for / against this 'feature'.] -- Simon L. Nielsen From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 20:06:25 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4BAB1065672; Sat, 12 Dec 2009 20:06:25 +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 CF9178FC33; Sat, 12 Dec 2009 20:06: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 nBCK6PJP062093; Sat, 12 Dec 2009 20:06:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCK6PHv062071; Sat, 12 Dec 2009 20:06:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912122006.nBCK6PHv062071@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Dec 2009 20:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200443 - in stable/8/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 mips/include mips/mips powerpc/aim powerpc/booke sparc64/include sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 20:06:26 -0000 Author: kib Date: Sat Dec 12 20:06:25 2009 New Revision: 200443 URL: http://svn.freebsd.org/changeset/base/200443 Log: MFC r199135: Extract the code that records syscall results in the frame into MD function cpu_set_syscall_retval(). Modified: stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/amd64/vm_machdep.c stable/8/sys/arm/arm/trap.c stable/8/sys/arm/arm/vm_machdep.c stable/8/sys/i386/i386/trap.c stable/8/sys/i386/i386/vm_machdep.c stable/8/sys/ia64/ia64/trap.c stable/8/sys/ia64/ia64/vm_machdep.c stable/8/sys/mips/include/pcb.h stable/8/sys/mips/mips/trap.c stable/8/sys/mips/mips/vm_machdep.c stable/8/sys/powerpc/aim/trap.c stable/8/sys/powerpc/aim/vm_machdep.c stable/8/sys/powerpc/booke/trap.c stable/8/sys/powerpc/booke/vm_machdep.c stable/8/sys/sparc64/include/pcb.h stable/8/sys/sparc64/sparc64/trap.c stable/8/sys/sparc64/sparc64/vm_machdep.c stable/8/sys/sun4v/sun4v/trap.c stable/8/sys/sun4v/sun4v/vm_machdep.c stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/amd64/amd64/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -1004,39 +1004,7 @@ syscall(struct trapframe *frame) #endif } - switch (error) { - case 0: - frame->tf_rax = td->td_retval[0]; - frame->tf_rdx = td->td_retval[1]; - frame->tf_rflags &= ~PSL_C; - break; - - case ERESTART: - /* - * Reconstruct pc, we know that 'syscall' is 2 bytes. - * We have to do a full context restore so that %r10 - * (which was holding the value of %rcx) is restored for - * the next iteration. - */ - frame->tf_rip -= frame->tf_err; - frame->tf_r10 = frame->tf_rcx; - td->td_pcb->pcb_flags |= PCB_FULLCTX; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->tf_rax = error; - frame->tf_rflags |= PSL_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Traced syscall. Modified: stable/8/sys/amd64/amd64/vm_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/amd64/amd64/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -317,6 +317,45 @@ cpu_thread_free(struct thread *td) cpu_thread_clean(td); } +void +cpu_set_syscall_retval(struct thread *td, int error) +{ + + switch (error) { + case 0: + td->td_frame->tf_rax = td->td_retval[0]; + td->td_frame->tf_rdx = td->td_retval[1]; + td->td_frame->tf_rflags &= ~PSL_C; + break; + + case ERESTART: + /* + * Reconstruct pc, we know that 'syscall' is 2 bytes. + * We have to do a full context restore so that %r10 + * (which was holding the value of %rcx) is restored + * for the next iteration. + */ + td->td_frame->tf_rip -= td->td_frame->tf_err; + td->td_frame->tf_r10 = td->td_frame->tf_rcx; + td->td_pcb->pcb_flags |= PCB_FULLCTX; + break; + + case EJUSTRETURN: + break; + + default: + if (td->td_proc->p_sysent->sv_errsize) { + if (error >= td->td_proc->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = td->td_proc->p_sysent->sv_errtbl[error]; + } + td->td_frame->tf_rax = error; + td->td_frame->tf_rflags |= PSL_C; + break; + } +} + /* * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back Modified: stable/8/sys/arm/arm/trap.c ============================================================================== --- stable/8/sys/arm/arm/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/arm/arm/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -932,43 +932,8 @@ syscall(struct thread *td, trapframe_t * KASSERT(td->td_ar == NULL, ("returning from syscall with td_ar set!")); } - switch (error) { - case 0: -#ifdef __ARMEB__ - if ((insn & 0x000fffff) == SYS___syscall && - code != SYS_freebsd6_lseek && code != SYS_lseek) { - /* - * 64-bit return, 32-bit syscall. Fixup byte order - */ - frame->tf_r0 = 0; - frame->tf_r1 = td->td_retval[0]; - } else { - frame->tf_r0 = td->td_retval[0]; - frame->tf_r1 = td->td_retval[1]; - } -#else - frame->tf_r0 = td->td_retval[0]; - frame->tf_r1 = td->td_retval[1]; -#endif - - frame->tf_spsr &= ~PSR_C_bit; /* carry bit */ - break; - - case ERESTART: - /* - * Reconstruct the pc to point at the swi. - */ - frame->tf_pc -= INSN_SIZE; - break; - case EJUSTRETURN: - /* nothing to do */ - break; - default: bad: - frame->tf_r0 = error; - frame->tf_spsr |= PSR_C_bit; /* carry bit */ - break; - } + cpu_set_syscall_retval(td, error); WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???"); Modified: stable/8/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/8/sys/arm/arm/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/arm/arm/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -261,6 +263,57 @@ done: #endif } +void +cpu_set_syscall_retval(struct thread *td, int error) +{ + trapframe_t *frame; + int fixup; +#ifdef __ARMEB__ + uint32_t insn; +#endif + + frame = td->td_frame; + fixup = 0; + +#ifdef __ARMEB__ + insn = *(u_int32_t *)(frame->tf_pc - INSN_SIZE); + if ((insn & 0x000fffff) == SYS___syscall) { + register_t *ap = &frame->tf_r0; + register_t code = ap[_QUAD_LOWWORD]; + if (td->td_proc->p_sysent->sv_mask) + code &= td->td_proc->p_sysent->sv_mask; + fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) + ? 1 : 0; + } +#endif + + switch (error) { + case 0: + if (fixup) { + frame->tf_r0 = 0; + frame->tf_r1 = td->td_retval[0]; + } else { + frame->tf_r0 = td->td_retval[0]; + frame->tf_r1 = td->td_retval[1]; + } + frame->tf_spsr &= ~PSR_C_bit; /* carry bit */ + break; + case ERESTART: + /* + * Reconstruct the pc to point at the swi. + */ + frame->tf_pc -= INSN_SIZE; + break; + case EJUSTRETURN: + /* nothing to do */ + break; + default: + frame->tf_r0 = error; + frame->tf_spsr |= PSR_C_bit; /* carry bit */ + break; + } +} + /* * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/i386/i386/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -1093,35 +1093,7 @@ syscall(struct trapframe *frame) #endif } - switch (error) { - case 0: - frame->tf_eax = td->td_retval[0]; - frame->tf_edx = td->td_retval[1]; - frame->tf_eflags &= ~PSL_C; - break; - - case ERESTART: - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, - * int 0x80 is 2 bytes. We saved this in tf_err. - */ - frame->tf_eip -= frame->tf_err; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->tf_eax = error; - frame->tf_eflags |= PSL_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Traced syscall. Modified: stable/8/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/8/sys/i386/i386/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/i386/i386/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -381,6 +381,41 @@ cpu_thread_free(struct thread *td) cpu_thread_clean(td); } +void +cpu_set_syscall_retval(struct thread *td, int error) +{ + + switch (error) { + case 0: + td->td_frame->tf_eax = td->td_retval[0]; + td->td_frame->tf_edx = td->td_retval[1]; + td->td_frame->tf_eflags &= ~PSL_C; + break; + + case ERESTART: + /* + * Reconstruct pc, assuming lcall $X,y is 7 bytes, int + * 0x80 is 2 bytes. We saved this in tf_err. + */ + td->td_frame->tf_eip -= td->td_frame->tf_err; + break; + + case EJUSTRETURN: + break; + + default: + if (td->td_proc->p_sysent->sv_errsize) { + if (error >= td->td_proc->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = td->td_proc->p_sysent->sv_errtbl[error]; + } + td->td_frame->tf_eax = error; + td->td_frame->tf_eflags |= PSL_C; + break; + } +} + /* * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back Modified: stable/8/sys/ia64/ia64/trap.c ============================================================================== --- stable/8/sys/ia64/ia64/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/ia64/ia64/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -976,26 +976,7 @@ syscall(struct trapframe *tf) error = (*callp->sy_call)(td, args); AUDIT_SYSCALL_EXIT(error, td); - if (error != EJUSTRETURN) { - /* - * Save the "raw" error code in r10. We use this to handle - * syscall restarts (see do_ast()). - */ - tf->tf_scratch.gr10 = error; - if (error == 0) { - tf->tf_scratch.gr8 = td->td_retval[0]; - tf->tf_scratch.gr9 = td->td_retval[1]; - } else if (error != ERESTART) { - if (error < p->p_sysent->sv_errsize) - error = p->p_sysent->sv_errtbl[error]; - /* - * Translated error codes are returned in r8. User - * processes use the translated error code. - */ - tf->tf_scratch.gr8 = error; - } - } - + cpu_set_syscall_retval(td, error); td->td_syscalls++; /* Modified: stable/8/sys/ia64/ia64/vm_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/ia64/ia64/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -140,6 +141,36 @@ cpu_thread_swapout(struct thread *td) } void +cpu_set_syscall_retval(struct thread *td, int error) +{ + struct proc *p; + struct trapframe *tf; + + if (error == EJUSTRETURN) + return; + + tf = td->td_frame; + + /* + * Save the "raw" error code in r10. We use this to handle + * syscall restarts (see do_ast()). + */ + tf->tf_scratch.gr10 = error; + if (error == 0) { + tf->tf_scratch.gr8 = td->td_retval[0]; + tf->tf_scratch.gr9 = td->td_retval[1]; + } else if (error != ERESTART) { + p = td->td_proc; + if (error < p->p_sysent->sv_errsize) + error = p->p_sysent->sv_errtbl[error]; + /* + * Translated error codes are returned in r8. User + */ + tf->tf_scratch.gr8 = error; + } +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct pcb *pcb; Modified: stable/8/sys/mips/include/pcb.h ============================================================================== --- stable/8/sys/mips/include/pcb.h Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/mips/include/pcb.h Sat Dec 12 20:06:25 2009 (r200443) @@ -52,6 +52,7 @@ struct pcb struct trapframe pcb_regs; /* saved CPU and registers */ label_t pcb_context; /* kernel context for resume */ int pcb_onfault; /* for copyin/copyout faults */ + register_t pcb_tpc; }; /* these match the regnum's in regnum.h Modified: stable/8/sys/mips/mips/trap.c ============================================================================== --- stable/8/sys/mips/mips/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/mips/mips/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -644,7 +644,6 @@ dofault: struct trapframe *locr0 = td->td_frame; struct sysent *callp; unsigned int code; - unsigned int tpc; int nargs, nsaved; register_t args[8]; @@ -660,7 +659,7 @@ dofault: thread_user_enter(td); #endif /* compute next PC after syscall instruction */ - tpc = trapframe->pc; /* Remember if restart */ + td->td_pcb->pcb_tpc = trapframe->pc; /* Remember if restart */ if (DELAYBRANCH(trapframe->cause)) { /* Check BD bit */ locr0->pc = MipsEmulateBranch(locr0, trapframe->pc, 0, 0); @@ -761,44 +760,7 @@ dofault: locr0 = td->td_frame; #endif trapdebug_enter(locr0, -code); - switch (i) { - case 0: - if (quad_syscall && code != SYS_lseek) { - /* - * System call invoked through the - * SYS___syscall interface but the - * return value is really just 32 - * bits. - */ - locr0->v0 = td->td_retval[0]; - if (_QUAD_LOWWORD) - locr0->v1 = td->td_retval[0]; - locr0->a3 = 0; - } else { - locr0->v0 = td->td_retval[0]; - locr0->v1 = td->td_retval[1]; - locr0->a3 = 0; - } - break; - - case ERESTART: - locr0->pc = tpc; - break; - - case EJUSTRETURN: - break; /* nothing to do */ - - default: - if (quad_syscall && code != SYS_lseek) { - locr0->v0 = i; - if (_QUAD_LOWWORD) - locr0->v1 = i; - locr0->a3 = 1; - } else { - locr0->v0 = i; - locr0->a3 = 1; - } - } + cpu_set_syscall_retval(td, i); /* * The sync'ing of I & D caches for SYS_ptrace() is Modified: stable/8/sys/mips/mips/vm_machdep.c ============================================================================== --- stable/8/sys/mips/mips/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/mips/mips/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -256,6 +257,62 @@ cpu_thread_alloc(struct thread *td) } } +void +cpu_set_syscall_retval(struct thread *td, int error) +{ + struct trapframe *locr0 = td->td_frame; + unsigned int code; + int quad_syscall; + + code = locr0->v0; + quad_syscall = 0; + if (code == SYS_syscall) + code = locr0->a0; + else if (code == SYS___syscall) { + code = _QUAD_LOWWORD ? locr0->a1 : locr0->a0; + quad_syscall = 1; + } + + switch (error) { + case 0: + if (quad_syscall && code != SYS_lseek) { + /* + * System call invoked through the + * SYS___syscall interface but the + * return value is really just 32 + * bits. + */ + locr0->v0 = td->td_retval[0]; + if (_QUAD_LOWWORD) + locr0->v1 = td->td_retval[0]; + locr0->a3 = 0; + } else { + locr0->v0 = td->td_retval[0]; + locr0->v1 = td->td_retval[1]; + locr0->a3 = 0; + } + break; + + case ERESTART: + locr0->pc = td->td_pcb->pcb_tpc; + break; + + case EJUSTRETURN: + break; /* nothing to do */ + + default: + if (quad_syscall && code != SYS_lseek) { + locr0->v0 = error; + if (_QUAD_LOWWORD) + locr0->v1 = error; + locr0->a3 = 1; + } else { + locr0->v0 = error; + locr0->a3 = 1; + } + } +} + /* * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back Modified: stable/8/sys/powerpc/aim/trap.c ============================================================================== --- stable/8/sys/powerpc/aim/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/powerpc/aim/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -417,43 +417,8 @@ syscall(struct trapframe *frame) CTR3(KTR_SYSC, "syscall: p=%s %s ret=%x", td->td_name, syscallnames[code], td->td_retval[0]); } - switch (error) { - case 0: - if (frame->fixreg[0] == SYS___syscall && - code != SYS_freebsd6_lseek && code != SYS_lseek) { - /* - * 64-bit return, 32-bit syscall. Fixup byte order - */ - frame->fixreg[FIRSTARG] = 0; - frame->fixreg[FIRSTARG + 1] = td->td_retval[0]; - } else { - frame->fixreg[FIRSTARG] = td->td_retval[0]; - frame->fixreg[FIRSTARG + 1] = td->td_retval[1]; - } - /* XXX: Magic number */ - frame->cr &= ~0x10000000; - break; - case ERESTART: - /* - * Set user's pc back to redo the system call. - */ - frame->srr0 -= 4; - break; - case EJUSTRETURN: - /* nothing to do */ - break; - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->fixreg[FIRSTARG] = error; - /* XXX: Magic number: Carry Flag Equivalent? */ - frame->cr |= 0x10000000; - break; - } + + cpu_set_syscall_retval(td, error); /* * Check for misbehavior. Modified: stable/8/sys/powerpc/aim/vm_machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/powerpc/aim/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -81,7 +81,9 @@ #include #include #include +#include #include +#include #include #include @@ -422,6 +424,59 @@ cpu_thread_swapout(struct thread *td) } void +cpu_set_syscall_retval(struct thread *td, int error) +{ + struct proc *p; + struct trapframe *tf; + int fixup; + + if (error == EJUSTRETURN) + return; + + p = td->td_proc; + tf = td->td_frame; + + if (tf->fixreg[0] == SYS___syscall) { + int code = tf->fixreg[FIRSTARG + 1]; + if (p->p_sysent->sv_mask) + code &= p->p_sysent->sv_mask; + fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ? + 1 : 0; + } else + fixup = 0; + + switch (error) { + case 0: + if (fixup) { + /* + * 64-bit return, 32-bit syscall. Fixup byte order + */ + tf->fixreg[FIRSTARG] = 0; + tf->fixreg[FIRSTARG + 1] = td->td_retval[0]; + } else { + tf->fixreg[FIRSTARG] = td->td_retval[0]; + tf->fixreg[FIRSTARG + 1] = td->td_retval[1]; + } + tf->cr &= ~0x10000000; /* XXX: Magic number */ + break; + case ERESTART: + /* + * Set user's pc back to redo the system call. + */ + tf->srr0 -= 4; + break; + default: + if (p->p_sysent->sv_errsize) { + error = (error < p->p_sysent->sv_errsize) ? + p->p_sysent->sv_errtbl[error] : -1; + } + tf->fixreg[FIRSTARG] = error; + tf->cr |= 0x10000000; /* XXX: Magic number */ + break; + } +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct pcb *pcb2; Modified: stable/8/sys/powerpc/booke/trap.c ============================================================================== --- stable/8/sys/powerpc/booke/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/powerpc/booke/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -417,42 +417,7 @@ syscall(struct trapframe *frame) syscallnames[code], td->td_retval[0]); } - switch (error) { - case 0: - if (frame->fixreg[0] == SYS___syscall && SYS_lseek) { - /* - * 64-bit return, 32-bit syscall. Fixup byte order - */ - frame->fixreg[FIRSTARG] = 0; - frame->fixreg[FIRSTARG + 1] = td->td_retval[0]; - } else { - frame->fixreg[FIRSTARG] = td->td_retval[0]; - frame->fixreg[FIRSTARG + 1] = td->td_retval[1]; - } - /* XXX: Magic number */ - frame->cr &= ~0x10000000; - break; - case ERESTART: - /* - * Set user's pc back to redo the system call. - */ - frame->srr0 -= 4; - break; - case EJUSTRETURN: - /* nothing to do */ - break; - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->fixreg[FIRSTARG] = error; - /* XXX: Magic number: Carry Flag Equivalent? */ - frame->cr |= 0x10000000; - break; - } + cpu_set_syscall_retval(td, error); /* * Check for misbehavior. Modified: stable/8/sys/powerpc/booke/vm_machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/powerpc/booke/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -113,7 +113,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include @@ -423,6 +425,59 @@ cpu_thread_swapout(struct thread *td) } void +cpu_set_syscall_retval(struct thread *td, int error) +{ + struct proc *p; + struct trapframe *tf; + int fixup; + + p = td->td_proc; + tf = td->td_frame; + + if (tf->fixreg[0] == SYS___syscall) { + int code = tf->fixreg[FIRSTARG + 1]; + if (p->p_sysent->sv_mask) + code &= p->p_sysent->sv_mask; + fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ? + 1 : 0; + } else + fixup = 0; + + switch (error) { + case 0: + if (fixup) { + /* + * 64-bit return, 32-bit syscall. Fixup byte order + */ + tf->fixreg[FIRSTARG] = 0; + tf->fixreg[FIRSTARG + 1] = td->td_retval[0]; + } else { + tf->fixreg[FIRSTARG] = td->td_retval[0]; + tf->fixreg[FIRSTARG + 1] = td->td_retval[1]; + } + tf->cr &= ~0x10000000; /* XXX: Magic number */ + break; + case ERESTART: + /* + * Set user's pc back to redo the system call. + */ + tf->srr0 -= 4; + break; + case EJUSTRETURN: + /* nothing to do */ + break; + default: + if (p->p_sysent->sv_errsize) { + error = (error < p->p_sysent->sv_errsize) ? + p->p_sysent->sv_errtbl[error] : -1; + } + tf->fixreg[FIRSTARG] = error; + tf->cr |= 0x10000000; /* XXX: Magic number */ + break; + } +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct pcb *pcb2; Modified: stable/8/sys/sparc64/include/pcb.h ============================================================================== --- stable/8/sys/sparc64/include/pcb.h Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/sparc64/include/pcb.h Sat Dec 12 20:06:25 2009 (r200443) @@ -49,7 +49,8 @@ struct pcb { uint64_t pcb_nsaved; uint64_t pcb_pc; uint64_t pcb_sp; - uint64_t pcb_pad[4]; + uint64_t pcb_tpc; + uint64_t pcb_pad[3]; } __aligned(64); #ifdef _KERNEL Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/sparc64/sparc64/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -538,7 +538,6 @@ syscall(struct trapframe *tf) register_t *argp; struct proc *p; u_long code; - u_long tpc; int reg; int regcnt; int narg; @@ -562,7 +561,7 @@ syscall(struct trapframe *tf) * For syscalls, we don't want to retry the faulting instruction * (usually), instead we need to advance one instruction. */ - tpc = tf->tf_tpc; + td->td_pcb->pcb_tpc = tf->tf_tpc; TF_DONE(tf); reg = 0; @@ -626,39 +625,7 @@ syscall(struct trapframe *tf) td->td_retval[1]); } - /* - * MP SAFE (we may or may not have the MP lock at this point) - */ - switch (error) { - case 0: - tf->tf_out[0] = td->td_retval[0]; - tf->tf_out[1] = td->td_retval[1]; - tf->tf_tstate &= ~TSTATE_XCC_C; - break; - - case ERESTART: - /* - * Undo the tpc advancement we have done above, we want to - * reexecute the system call. - */ - tf->tf_tpc = tpc; - tf->tf_tnpc -= 4; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - tf->tf_out[0] = error; - tf->tf_tstate |= TSTATE_XCC_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Check for misbehavior. Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/sparc64/sparc64/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -166,6 +167,42 @@ cpu_thread_swapout(struct thread *td) } void +cpu_set_syscall_retval(struct thread *td, int error) +{ + + switch (error) { + case 0: + td->td_frame->tf_out[0] = td->td_retval[0]; + td->td_frame->tf_out[1] = td->td_retval[1]; + td->td_frame->tf_tstate &= ~TSTATE_XCC_C; + break; + + case ERESTART: + /* + * Undo the tpc advancement we have done on syscall + * enter, we want to reexecute the system call. + */ + td->td_frame->tf_tpc = td->td_pcb->pcb_tpc; + td->td_frame->tf_tnpc -= 4; + break; + + case EJUSTRETURN: + break; + + default: + if (td->td_proc->p_sysent->sv_errsize) { + if (error >= td->td_proc->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = td->td_proc->p_sysent->sv_errtbl[error]; + } + td->td_frame->tf_out[0] = error; + td->td_frame->tf_tstate |= TSTATE_XCC_C; + break; + } +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct trapframe *tf; Modified: stable/8/sys/sun4v/sun4v/trap.c ============================================================================== --- stable/8/sys/sun4v/sun4v/trap.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/sun4v/sun4v/trap.c Sat Dec 12 20:06:25 2009 (r200443) @@ -81,6 +81,7 @@ #include #include #include +#include #include #include #include @@ -582,7 +583,6 @@ syscall(struct trapframe *tf) register_t *argp; struct proc *p; u_long code; - u_long tpc; int reg; int regcnt; int narg; @@ -606,7 +606,7 @@ syscall(struct trapframe *tf) * For syscalls, we don't want to retry the faulting instruction * (usually), instead we need to advance one instruction. */ - tpc = tf->tf_tpc; + td->td_pcb->pcb_tpc = tf->tf_tpc; TF_DONE(tf); reg = 0; @@ -673,40 +673,8 @@ syscall(struct trapframe *tf) error, syscallnames[code], td->td_retval[0], td->td_retval[1]); } - - /* - * MP SAFE (we may or may not have the MP lock at this point) - */ - switch (error) { - case 0: - tf->tf_out[0] = td->td_retval[0]; - tf->tf_out[1] = td->td_retval[1]; - tf->tf_tstate &= ~TSTATE_XCC_C; - break; - case ERESTART: - /* - * Undo the tpc advancement we have done above, we want to - * reexecute the system call. - */ - tf->tf_tpc = tpc; - tf->tf_tnpc -= 4; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - tf->tf_out[0] = error; - tf->tf_tstate |= TSTATE_XCC_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Handle reschedule and other end-of-syscall issues Modified: stable/8/sys/sun4v/sun4v/vm_machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/vm_machdep.c Sat Dec 12 18:18:46 2009 (r200442) +++ stable/8/sys/sun4v/sun4v/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include @@ -142,6 +143,42 @@ cpu_thread_swapout(struct thread *td) } void +cpu_set_syscall_retval(struct thread *td, int error) +{ + + switch (error) { + case 0: + td->td_frame->tf_out[0] = td->td_retval[0]; + td->td_frame->tf_out[1] = td->td_retval[1]; + td->td_frame->tf_tstate &= ~TSTATE_XCC_C; + break; + + case ERESTART: + /* + * Undo the tpc advancement we have done on syscall + * enter, we want to reexecute the system call. + */ + td->td_frame->tf_tpc = td->td_pcb->pcb_tpc; + td->td_frame->tf_tnpc -= 4; + break; + + case EJUSTRETURN: + break; + + default: + if (td->td_proc->p_sysent->sv_errsize) { + if (error >= td->td_proc->p_sysent->sv_errsize) + error = -1; /* XXX */ + else + error = td->td_proc->p_sysent->sv_errtbl[error]; + } + td->td_frame->tf_out[0] = error; + td->td_frame->tf_tstate |= TSTATE_XCC_C; + break; + } +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct trapframe *tf; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 20:11:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 987D11065672; Sat, 12 Dec 2009 20:11:31 +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 6DCFD8FC1F; Sat, 12 Dec 2009 20:11: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 nBCKBV8F062245; Sat, 12 Dec 2009 20:11:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCKBV5K062242; Sat, 12 Dec 2009 20:11:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912122011.nBCKBV5K062242@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Dec 2009 20:11: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: r200444 - in head/sys/amd64: amd64 ia32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 20:11:31 -0000 Author: kib Date: Sat Dec 12 20:11:31 2009 New Revision: 200444 URL: http://svn.freebsd.org/changeset/base/200444 Log: For ia32 syscall(), call cpu_set_syscall_retval(). Update comment inside cpu_set_syscall_retval() accordingly. MFC after: 1 week Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_syscall.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Sat Dec 12 20:06:25 2009 (r200443) +++ head/sys/amd64/amd64/vm_machdep.c Sat Dec 12 20:11:31 2009 (r200444) @@ -330,10 +330,14 @@ cpu_set_syscall_retval(struct thread *td case ERESTART: /* - * Reconstruct pc, we know that 'syscall' is 2 bytes. + * Reconstruct pc, we know that 'syscall' is 2 bytes, + * lcall $X,y is 7 bytes, int 0x80 is 2 bytes. + * We saved this in tf_err. * We have to do a full context restore so that %r10 * (which was holding the value of %rcx) is restored * for the next iteration. + * r10 restore is only required for freebsd/amd64 processes, + * but shall be innocent for any ia32 ABI. */ td->td_frame->tf_rip -= td->td_frame->tf_err; td->td_frame->tf_r10 = td->td_frame->tf_rcx; Modified: head/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- head/sys/amd64/ia32/ia32_syscall.c Sat Dec 12 20:06:25 2009 (r200443) +++ head/sys/amd64/ia32/ia32_syscall.c Sat Dec 12 20:11:31 2009 (r200444) @@ -183,35 +183,7 @@ ia32_syscall(struct trapframe *frame) AUDIT_SYSCALL_EXIT(error, td); } - switch (error) { - case 0: - frame->tf_rax = td->td_retval[0]; - frame->tf_rdx = td->td_retval[1]; - frame->tf_rflags &= ~PSL_C; - break; - - case ERESTART: - /* - * Reconstruct pc, assuming lcall $X,y is 7 bytes, - * int 0x80 is 2 bytes. We saved this in tf_err. - */ - frame->tf_rip -= frame->tf_err; - break; - - case EJUSTRETURN: - break; - - default: - if (p->p_sysent->sv_errsize) { - if (error >= p->p_sysent->sv_errsize) - error = -1; /* XXX */ - else - error = p->p_sysent->sv_errtbl[error]; - } - frame->tf_rax = error; - frame->tf_rflags |= PSL_C; - break; - } + cpu_set_syscall_retval(td, error); /* * Traced syscall. From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 20:24:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A791065692; Sat, 12 Dec 2009 20:24:13 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02C2E8FC0A; Sat, 12 Dec 2009 20:24: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 nBCKOCRE062538; Sat, 12 Dec 2009 20:24:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCKOCsh062536; Sat, 12 Dec 2009 20:24:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912122024.nBCKOCsh062536@svn.freebsd.org> From: Marius Strobl Date: Sat, 12 Dec 2009 20:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200445 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 20:24:13 -0000 Author: marius Date: Sat Dec 12 20:24:12 2009 New Revision: 200445 URL: http://svn.freebsd.org/changeset/base/200445 Log: MFC: r200215 Add missed in r199135 (MFC'ed in r200443). Modified: stable/8/sys/sparc64/sparc64/trap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Sat Dec 12 20:11:31 2009 (r200444) +++ stable/8/sys/sparc64/sparc64/trap.c Sat Dec 12 20:24:12 2009 (r200445) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 20:26:11 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B382106568F; Sat, 12 Dec 2009 20:26:11 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793EB8FC16; Sat, 12 Dec 2009 20:26: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 nBCKQBOO062617; Sat, 12 Dec 2009 20:26:11 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCKQBcm062615; Sat, 12 Dec 2009 20:26:11 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <200912122026.nBCKQBcm062615@svn.freebsd.org> From: Shteryana Shopova Date: Sat, 12 Dec 2009 20:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200446 - stable/8/usr.sbin/bsnmpd/modules/snmp_pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 20:26:11 -0000 Author: syrinx Date: Sat Dec 12 20:26:11 2009 New Revision: 200446 URL: http://svn.freebsd.org/changeset/base/200446 Log: MFC r200122 Make sure enough memory is allocated for a struct pft_entry when refreshing the list of pf tables. Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 12 20:24:12 2009 (r200445) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 12 20:26:11 2009 (r200446) @@ -1104,7 +1104,7 @@ pft_refresh(void) } for (i = 0; i < numtbls; i++) { - e = malloc(sizeof(struct pfr_tstats)); + e = malloc(sizeof(struct pft_entry)); if (e == NULL) goto err1; e->index = i + 1; From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 21:31:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 160CB1065670; Sat, 12 Dec 2009 21:31:08 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 038F48FC0C; Sat, 12 Dec 2009 21: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 nBCLV7ep064312; Sat, 12 Dec 2009 21:31:07 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCLV71f064304; Sat, 12 Dec 2009 21:31:07 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200912122131.nBCLV71f064304@svn.freebsd.org> From: Attilio Rao Date: Sat, 12 Dec 2009 21: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: r200447 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 21:31:08 -0000 Author: attilio Date: Sat Dec 12 21:31:07 2009 New Revision: 200447 URL: http://svn.freebsd.org/changeset/base/200447 Log: In current code, threads performing an interruptible sleep (on both sxlock, via the sx_{s, x}lock_sig() interface, or plain lockmgr), will leave the waiters flag on forcing the owner to do a wakeup even when if the waiter queue is empty. That operation may lead to a deadlock in the case of doing a fake wakeup on the "preferred" (based on the wakeup algorithm) queue while the other queue has real waiters on it, because nobody is going to wakeup the 2nd queue waiters and they will sleep indefinitively. A similar bug, is present, for lockmgr in the case the waiters are sleeping with LK_SLEEPFAIL on. In this case, even if the waiters queue is not empty, the waiters won't progress after being awake but they will just fail, still not taking care of the 2nd queue waiters (as instead the lock owned doing the wakeup would expect). In order to fix this bug in a cheap way (without adding too much locking and complicating too much the semantic) add a sleepqueue interface which does report the actual number of waiters on a specified queue of a waitchannel (sleepq_sleepcnt()) and use it in order to determine if the exclusive waiters (or shared waiters) are actually present on the lockmgr (or sx) before to give them precedence in the wakeup algorithm. This fix alone, however doesn't solve the LK_SLEEPFAIL bug. In order to cope with it, add the tracking of how many exclusive LK_SLEEPFAIL waiters a lockmgr has and if all the waiters on the exclusive waiters queue are LK_SLEEPFAIL just wake both queues. The sleepq_sleepcnt() introduction and ABI breakage require __FreeBSD_version bumping. Reported by: avg, kib, pho Reviewed by: kib Tested by: pho Modified: head/share/man/man9/sleepqueue.9 head/sys/kern/kern_lock.c head/sys/kern/kern_sx.c head/sys/kern/subr_sleepqueue.c head/sys/sys/_lockmgr.h head/sys/sys/param.h head/sys/sys/sleepqueue.h Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Sat Dec 12 20:26:11 2009 (r200446) +++ head/share/man/man9/sleepqueue.9 Sat Dec 12 21:31:07 2009 (r200447) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd December 11, 2009 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -41,6 +41,7 @@ .Nm sleepq_remove , .Nm sleepq_signal , .Nm sleepq_set_timeout , +.Nm sleepq_sleepcnt , .Nm sleepq_timedwait , .Nm sleepq_timedwait_sig , .Nm sleepq_wait , @@ -77,6 +78,8 @@ .Fn sleepq_signal "void *wchan" "int flags" "int pri" "int queue" .Ft void .Fn sleepq_set_timeout "void *wchan" "int timo" +.Ft u_int +.Fn sleepq_sleepcnt "void *wchan" "int queue" .Ft int .Fn sleepq_timedwait "void *wchan" .Ft int @@ -348,6 +351,14 @@ One possible use is waking up a specific channel. .Pp The +.Fn sleepq_sleepcnt +function offer a simple way to retrieve the number of threads sleeping for +the specified +.Fa queue , +given a +.Fa wchan . +.Pp +The .Fn sleepq_abort , .Fn sleepq_broadcast , and Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sat Dec 12 20:26:11 2009 (r200446) +++ head/sys/kern/kern_lock.c Sat Dec 12 21:31:07 2009 (r200447) @@ -197,6 +197,8 @@ sleeplk(struct lock *lk, u_int flags, st if (flags & LK_INTERLOCK) class->lc_unlock(ilk); + if (queue == SQ_EXCLUSIVE_QUEUE && (flags & LK_SLEEPFAIL) != 0) + lk->lk_exslpfail++; GIANT_SAVE(); sleepq_add(&lk->lock_object, NULL, wmesg, SLEEPQ_LK | (catch ? SLEEPQ_INTERRUPTIBLE : 0), queue); @@ -225,6 +227,7 @@ static __inline int wakeupshlk(struct lock *lk, const char *file, int line) { uintptr_t v, x; + u_int realexslp; int queue, wakeup_swapper; TD_LOCKS_DEC(curthread); @@ -270,13 +273,34 @@ wakeupshlk(struct lock *lk, const char * /* * If the lock has exclusive waiters, give them preference in * order to avoid deadlock with shared runners up. + * If interruptible sleeps left the exclusive queue empty + * avoid a starvation for the threads sleeping on the shared + * queue by giving them precedence and cleaning up the + * exclusive waiters bit anyway. */ - if (x & LK_EXCLUSIVE_WAITERS) { - queue = SQ_EXCLUSIVE_QUEUE; - v |= (x & LK_SHARED_WAITERS); + realexslp = sleepq_sleepcnt(&lk->lock_object, + SQ_EXCLUSIVE_QUEUE); + if ((x & LK_EXCLUSIVE_WAITERS) != 0 && realexslp != 0) { + if (lk->lk_exslpfail < realexslp) { + lk->lk_exslpfail = 0; + queue = SQ_EXCLUSIVE_QUEUE; + v |= (x & LK_SHARED_WAITERS); + } else { + lk->lk_exslpfail = 0; + LOCK_LOG2(lk, + "%s: %p has only LK_SLEEPFAIL sleepers", + __func__, lk); + LOCK_LOG2(lk, + "%s: %p waking up threads on the exclusive queue", + __func__, lk); + wakeup_swapper = + sleepq_broadcast(&lk->lock_object, + SLEEPQ_LK, 0, SQ_EXCLUSIVE_QUEUE); + queue = SQ_SHARED_QUEUE; + } + } else { - MPASS((x & ~LK_EXCLUSIVE_SPINNERS) == - LK_SHARED_WAITERS); + MPASS(lk->lk_exslpfail == 0); queue = SQ_SHARED_QUEUE; } @@ -288,7 +312,7 @@ wakeupshlk(struct lock *lk, const char * LOCK_LOG3(lk, "%s: %p waking up threads on the %s queue", __func__, lk, queue == SQ_SHARED_QUEUE ? "shared" : "exclusive"); - wakeup_swapper = sleepq_broadcast(&lk->lock_object, SLEEPQ_LK, + wakeup_swapper |= sleepq_broadcast(&lk->lock_object, SLEEPQ_LK, 0, queue); sleepq_release(&lk->lock_object); break; @@ -353,6 +377,7 @@ lockinit(struct lock *lk, int pri, const lk->lk_lock = LK_UNLOCKED; lk->lk_recurse = 0; + lk->lk_exslpfail = 0; lk->lk_timo = timo; lk->lk_pri = pri; lock_init(&lk->lock_object, &lock_class_lockmgr, wmesg, NULL, iflags); @@ -365,6 +390,7 @@ lockdestroy(struct lock *lk) KASSERT(lk->lk_lock == LK_UNLOCKED, ("lockmgr still held")); KASSERT(lk->lk_recurse == 0, ("lockmgr still recursed")); + KASSERT(lk->lk_exslpfail == 0, ("lockmgr still exclusive waiters")); lock_destroy(&lk->lock_object); } @@ -376,7 +402,7 @@ __lockmgr_args(struct lock *lk, u_int fl struct lock_class *class; const char *iwmesg; uintptr_t tid, v, x; - u_int op; + u_int op, realexslp; int error, ipri, itimo, queue, wakeup_swapper; #ifdef LOCK_PROFILING uint64_t waittime = 0; @@ -906,14 +932,34 @@ __lockmgr_args(struct lock *lk, u_int fl * If the lock has exclusive waiters, give them * preference in order to avoid deadlock with * shared runners up. + * If interruptible sleeps left the exclusive queue + * empty avoid a starvation for the threads sleeping + * on the shared queue by giving them precedence + * and cleaning up the exclusive waiters bit anyway. */ MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); - if (x & LK_EXCLUSIVE_WAITERS) { - queue = SQ_EXCLUSIVE_QUEUE; - v |= (x & LK_SHARED_WAITERS); + realexslp = sleepq_sleepcnt(&lk->lock_object, + SQ_EXCLUSIVE_QUEUE); + if ((x & LK_EXCLUSIVE_WAITERS) != 0 && realexslp != 0) { + if (lk->lk_exslpfail < realexslp) { + lk->lk_exslpfail = 0; + queue = SQ_EXCLUSIVE_QUEUE; + v |= (x & LK_SHARED_WAITERS); + } else { + lk->lk_exslpfail = 0; + LOCK_LOG2(lk, + "%s: %p has only LK_SLEEPFAIL sleepers", + __func__, lk); + LOCK_LOG2(lk, + "%s: %p waking up threads on the exclusive queue", + __func__, lk); + wakeup_swapper = + sleepq_broadcast(&lk->lock_object, + SLEEPQ_LK, 0, SQ_EXCLUSIVE_QUEUE); + queue = SQ_SHARED_QUEUE; + } } else { - MPASS((x & LK_ALL_WAITERS) == - LK_SHARED_WAITERS); + MPASS(lk->lk_exslpfail == 0); queue = SQ_SHARED_QUEUE; } @@ -922,7 +968,7 @@ __lockmgr_args(struct lock *lk, u_int fl __func__, lk, queue == SQ_SHARED_QUEUE ? "shared" : "exclusive"); atomic_store_rel_ptr(&lk->lk_lock, v); - wakeup_swapper = sleepq_broadcast(&lk->lock_object, + wakeup_swapper |= sleepq_broadcast(&lk->lock_object, SLEEPQ_LK, 0, queue); sleepq_release(&lk->lock_object); break; @@ -979,14 +1025,47 @@ __lockmgr_args(struct lock *lk, u_int fl v = x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); if ((x & ~v) == LK_UNLOCKED) { v = (x & ~LK_EXCLUSIVE_SPINNERS); + + /* + * If interruptible sleeps left the exclusive + * queue empty avoid a starvation for the + * threads sleeping on the shared queue by + * giving them precedence and cleaning up the + * exclusive waiters bit anyway. + */ if (v & LK_EXCLUSIVE_WAITERS) { queue = SQ_EXCLUSIVE_QUEUE; v &= ~LK_EXCLUSIVE_WAITERS; } else { MPASS(v & LK_SHARED_WAITERS); + MPASS(lk->lk_exslpfail == 0); queue = SQ_SHARED_QUEUE; v &= ~LK_SHARED_WAITERS; } + if (queue == SQ_EXCLUSIVE_QUEUE) { + realexslp = + sleepq_sleepcnt(&lk->lock_object, + SQ_EXCLUSIVE_QUEUE); + if (lk->lk_exslpfail >= realexslp) { + lk->lk_exslpfail = 0; + queue = SQ_SHARED_QUEUE; + v &= ~LK_SHARED_WAITERS; + if (realexslp != 0) { + LOCK_LOG2(lk, + "%s: %p has only LK_SLEEPFAIL sleepers", + __func__, lk); + LOCK_LOG2(lk, + "%s: %p waking up threads on the exclusive queue", + __func__, lk); + wakeup_swapper = + sleepq_broadcast( + &lk->lock_object, + SLEEPQ_LK, 0, + SQ_EXCLUSIVE_QUEUE); + } + } else + lk->lk_exslpfail = 0; + } if (!atomic_cmpset_ptr(&lk->lk_lock, x, v)) { sleepq_release(&lk->lock_object); continue; Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Dec 12 20:26:11 2009 (r200446) +++ head/sys/kern/kern_sx.c Sat Dec 12 21:31:07 2009 (r200447) @@ -705,8 +705,12 @@ _sx_xunlock_hard(struct sx *sx, uintptr_ * ideal. It gives precedence to shared waiters if they are * present. For this condition, we have to preserve the * state of the exclusive waiters flag. + * If interruptible sleeps left the shared queue empty avoid a + * starvation for the threads sleeping on the exclusive queue by giving + * them precedence and cleaning up the shared waiters bit anyway. */ - if (sx->sx_lock & SX_LOCK_SHARED_WAITERS) { + if ((sx->sx_lock & SX_LOCK_SHARED_WAITERS) != 0 && + sleepq_sleepcnt(&sx->lock_object, SQ_SHARED_QUEUE) != 0) { queue = SQ_SHARED_QUEUE; x |= (sx->sx_lock & SX_LOCK_EXCLUSIVE_WAITERS); } else Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sat Dec 12 20:26:11 2009 (r200446) +++ head/sys/kern/subr_sleepqueue.c Sat Dec 12 21:31:07 2009 (r200447) @@ -118,6 +118,7 @@ __FBSDID("$FreeBSD$"); */ struct sleepqueue { TAILQ_HEAD(, thread) sq_blocked[NR_SLEEPQS]; /* (c) Blocked threads. */ + u_int sq_blockedcnt[NR_SLEEPQS]; /* (c) N. of blocked threads. */ LIST_ENTRY(sleepqueue) sq_hash; /* (c) Chain and free list. */ LIST_HEAD(, sleepqueue) sq_free; /* (c) Free queues. */ void *sq_wchan; /* (c) Wait channel. */ @@ -306,9 +307,12 @@ sleepq_add(void *wchan, struct lock_obje int i; sq = td->td_sleepqueue; - for (i = 0; i < NR_SLEEPQS; i++) + for (i = 0; i < NR_SLEEPQS; i++) { KASSERT(TAILQ_EMPTY(&sq->sq_blocked[i]), - ("thread's sleep queue %d is not empty", i)); + ("thread's sleep queue %d is not empty", i)); + KASSERT(sq->sq_blockedcnt[i] == 0, + ("thread's sleep queue %d count mismatches", i)); + } KASSERT(LIST_EMPTY(&sq->sq_free), ("thread's sleep queue has a non-empty free list")); KASSERT(sq->sq_wchan == NULL, ("stale sq_wchan pointer")); @@ -334,6 +338,7 @@ sleepq_add(void *wchan, struct lock_obje } thread_lock(td); TAILQ_INSERT_TAIL(&sq->sq_blocked[queue], td, td_slpq); + sq->sq_blockedcnt[queue]++; td->td_sleepqueue = NULL; td->td_sqqueue = queue; td->td_wchan = wchan; @@ -367,6 +372,22 @@ sleepq_set_timeout(void *wchan, int timo } /* + * Return the number of actual sleepers for the specified queue. + */ +u_int +sleepq_sleepcnt(void *wchan, int queue) +{ + struct sleepqueue *sq; + + KASSERT(wchan != NULL, ("%s: invalid NULL wait channel", __func__)); + MPASS((queue >= 0) && (queue < NR_SLEEPQS)); + sq = sleepq_lookup(wchan); + if (sq == NULL) + return (0); + return (sq->sq_blockedcnt[queue]); +} + +/* * Marks the pending sleep of the current thread as interruptible and * makes an initial check for pending signals before putting a thread * to sleep. Enters and exits with the thread lock held. Thread lock @@ -665,6 +686,7 @@ sleepq_resume_thread(struct sleepqueue * mtx_assert(&sc->sc_lock, MA_OWNED); /* Remove the thread from the queue. */ + sq->sq_blockedcnt[td->td_sqqueue]--; TAILQ_REMOVE(&sq->sq_blocked[td->td_sqqueue], td, td_slpq); /* @@ -720,8 +742,10 @@ sleepq_dtor(void *mem, int size, void *a int i; sq = mem; - for (i = 0; i < NR_SLEEPQS; i++) + for (i = 0; i < NR_SLEEPQS; i++) { MPASS(TAILQ_EMPTY(&sq->sq_blocked[i])); + MPASS(sq->sq_blockedcnt[i] == 0); + } } #endif @@ -736,8 +760,10 @@ sleepq_init(void *mem, int size, int fla bzero(mem, size); sq = mem; - for (i = 0; i < NR_SLEEPQS; i++) + for (i = 0; i < NR_SLEEPQS; i++) { TAILQ_INIT(&sq->sq_blocked[i]); + sq->sq_blockedcnt[i] = 0; + } LIST_INIT(&sq->sq_free); return (0); } @@ -1170,6 +1196,7 @@ found: td->td_tid, td->td_proc->p_pid, td->td_name); } + db_printf("(expected: %u)\n", sq->sq_blockedcnt[i]); } } Modified: head/sys/sys/_lockmgr.h ============================================================================== --- head/sys/sys/_lockmgr.h Sat Dec 12 20:26:11 2009 (r200446) +++ head/sys/sys/_lockmgr.h Sat Dec 12 21:31:07 2009 (r200447) @@ -38,6 +38,7 @@ struct lock { struct lock_object lock_object; volatile uintptr_t lk_lock; + u_int lk_exslpfail; int lk_timo; int lk_pri; #ifdef DEBUG_LOCKS Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Dec 12 20:26:11 2009 (r200446) +++ head/sys/sys/param.h Sat Dec 12 21:31:07 2009 (r200447) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900004 /* Master, propagated to newvers */ +#define __FreeBSD_version 900005 /* Master, propagated to newvers */ #ifndef LOCORE #include Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Sat Dec 12 20:26:11 2009 (r200446) +++ head/sys/sys/sleepqueue.h Sat Dec 12 21:31:07 2009 (r200447) @@ -109,6 +109,7 @@ void sleepq_release(void *wchan); void sleepq_remove(struct thread *td, void *wchan); int sleepq_signal(void *wchan, int flags, int pri, int queue); void sleepq_set_timeout(void *wchan, int timo); +u_int sleepq_sleepcnt(void *wchan, int queue); int sleepq_timedwait(void *wchan, int pri); int sleepq_timedwait_sig(void *wchan, int pri); void sleepq_wait(void *wchan, int pri); From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 21:51:51 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B33F106566B; Sat, 12 Dec 2009 21:51:51 +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 D4F6E8FC0C; Sat, 12 Dec 2009 21:51: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 nBCLpoXH064713; Sat, 12 Dec 2009 21:51:50 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCLpoP7064711; Sat, 12 Dec 2009 21:51:50 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <200912122151.nBCLpoP7064711@svn.freebsd.org> From: Doug Barton Date: Sat, 12 Dec 2009 21:51: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: r200448 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 21:51:51 -0000 Author: dougb Date: Sat Dec 12 21:51:50 2009 New Revision: 200448 URL: http://svn.freebsd.org/changeset/base/200448 Log: Since the change to rc.subr in r198162 it's not necessary to specify command in the rc.d script if we have a corresponding ${name}_program entry, which we do for named. Rename named_precmd to named_prestart to make it more clear and match convention. Move the command_args definition related to -u up into _prestart(). It (and the associated $named_uid value) are only used there, and unlike required_* and pidfile don't need to be used until this stage. Fix a silly bug that would only have affected people who were using the new named_wait or named_auto_forward features, AND had set up an rndc.conf file instead of using the automatically generated rndc.key. For named_conf: Add "-c $named_conf" to command_args if it's not set to the default. If it is set to the default and we're using the base BIND it's not necessary. If we're using BIND from the ports the user is likely to have included it in _flags (due to long necessity for doing so) so don't duplicate that if it's set. Add $named_conf to required_files Modified: head/etc/rc.d/named Modified: head/etc/rc.d/named ============================================================================== --- head/etc/rc.d/named Sat Dec 12 21:31:07 2009 (r200447) +++ head/etc/rc.d/named Sat Dec 12 21:51:50 2009 (r200448) @@ -12,10 +12,9 @@ name="named" rcvar=named_enable -command="/usr/sbin/named" extra_commands="reload" -start_precmd="named_precmd" +start_precmd="named_prestart" start_postcmd="named_poststart" reload_cmd="named_reload" stop_cmd="named_stop" @@ -155,8 +154,17 @@ create_file () { chmod 644 $1 } -named_precmd() +named_prestart() { + command_args="-u ${named_uid:=root}" + + if [ ! "$named_conf" = '/etc/namedb/named.conf' ]; then + case "$named_flags" in + -c*|*' -c'*) ;; # No need to add it + *) command_args="-c $named_conf $command_args" ;; + esac + fi + local line nsip firstns # Is the user using a sandbox? @@ -170,11 +178,11 @@ named_precmd() # Create an rndc.key file for the user if none exists # - if [ -s "${named_chrootdir}/etc/namedb/rndc.conf" ]; then - return 0 - fi 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 + unset confgen_command + fi if [ -s "${named_chrootdir}/etc/namedb/rndc.key" ]; then case `stat -f%Su ${named_chrootdir}/etc/namedb/rndc.key` in root|$named_uid) ;; @@ -260,10 +268,11 @@ named_precmd() } load_rc_config $name + # Updating the following variables requires that rc.conf be loaded first # 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}" -command_args="-u ${named_uid:=root}" run_rc_command "$1" From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 21:59:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ECF81065670; Sat, 12 Dec 2009 21:59:31 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E43E8FC0A; Sat, 12 Dec 2009 21:59: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 nBCLxVx2064904; Sat, 12 Dec 2009 21:59:31 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCLxU3D064902; Sat, 12 Dec 2009 21:59:30 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200912122159.nBCLxU3D064902@svn.freebsd.org> From: Jamie Gritton Date: Sat, 12 Dec 2009 21:59: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: r200449 - head/usr.sbin/jls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 21:59:31 -0000 Author: jamie Date: Sat Dec 12 21:59:30 2009 New Revision: 200449 URL: http://svn.freebsd.org/changeset/base/200449 Log: Don't free jail parameter values after printing them - jail_param_get expects them to be there for the next jail in the list. PR: bin/141359 MFC after: 1 week Modified: head/usr.sbin/jls/jls.c Modified: head/usr.sbin/jls/jls.c ============================================================================== --- head/usr.sbin/jls/jls.c Sat Dec 12 21:51:50 2009 (r200448) +++ head/usr.sbin/jls/jls.c Sat Dec 12 21:59:30 2009 (r200449) @@ -425,11 +425,6 @@ print_jail(int pflags, int jflags) if (params[i].jp_flags & JP_USER) free(param_values[i]); } - for (i = 0; i < nparams; i++) - if (!(params[i].jp_flags & JP_RAWVALUE)) { - free(params[i].jp_value); - params[i].jp_value = NULL; - } return (jid); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 22:08:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D161065670; Sat, 12 Dec 2009 22:08:38 +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 277838FC13; Sat, 12 Dec 2009 22:08: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 nBCM8c4P065135; Sat, 12 Dec 2009 22:08:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCM8cI2065132; Sat, 12 Dec 2009 22:08:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912122208.nBCM8cI2065132@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 12 Dec 2009 22:08: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: r200450 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 22:08:38 -0000 Author: kib Date: Sat Dec 12 22:08:37 2009 New Revision: 200450 URL: http://svn.freebsd.org/changeset/base/200450 Log: Document PBDRY and SLEEPQ_STOP_ON_BDRY. Requested and reviewed by: attilio MFC after: 3 days Modified: head/share/man/man9/sleep.9 head/share/man/man9/sleepqueue.9 Modified: head/share/man/man9/sleep.9 ============================================================================== --- head/share/man/man9/sleep.9 Sat Dec 12 21:59:30 2009 (r200449) +++ head/share/man/man9/sleep.9 Sat Dec 12 22:08:37 2009 (r200450) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2008 +.Dd December 12, 2009 .Os .Dt SLEEP 9 .Sh NAME @@ -97,6 +97,7 @@ when it resumes. should never be used, as it is for compatibility only. A new priority of 0 means to use the thread's current priority when it is made runnable again. +.Pp If .Fa priority includes the @@ -113,6 +114,17 @@ possible, and is returned if the system call should be interrupted by the signal (return .Er EINTR ) . +If +.Dv PBDRY +flag is specified in addition to +.Dv PCATCH , +then the sleeping thread is not stopped while sleeping upon delivery of +.Dv SIGSTOP +or other stop action. +Instead, it is waken up, assuming that stop occurs on reaching a stop +point when returning to usermode. +The flag should be used when sleeping thread owns resources, for instance +vnode locks, that should be freed timely. .Pp The parameter .Fa wmesg Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Sat Dec 12 21:59:30 2009 (r200449) +++ head/share/man/man9/sleepqueue.9 Sat Dec 12 22:08:37 2009 (r200450) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 11, 2009 +.Dd December 12, 2009 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -198,12 +198,19 @@ A sleep queue used to implement .Xr pause 9 . .El .Pp -There is currently only one optional flag: +There are currently two optional flag: .Pp .Bl -tag -width ".Dv SLEEPQ_INTERRUPTIBLE" -compact .It Dv SLEEPQ_INTERRUPTIBLE The current thread is entering an interruptible sleep. .El +.Bl -tag -width ".Dv SLEEPQ_STOP_ON_BDRY" -compact +.It Dv SLEEPQ_STOP_ON_BDRY +When thread is entering an interruptible sleep, do not stop it upon +arrival of stop action, like +.Dv SIGSTOP . +Wake it up instead. +.El .Pp A timeout on the sleep may be specified by calling .Fn sleepq_set_timeout From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 22:29:31 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 028CD106568B; Sat, 12 Dec 2009 22:29:31 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E138C8FC21; Sat, 12 Dec 2009 22:29: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 nBCMTUKt065562; Sat, 12 Dec 2009 22:29:30 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCMTUKD065557; Sat, 12 Dec 2009 22:29:30 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912122229.nBCMTUKD065557@svn.freebsd.org> From: Ollivier Robert Date: Sat, 12 Dec 2009 22:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200451 - in vendor/ntp/dist: . adjtimed arlib clockstuff conf html html/build/hints html/drivers html/hints include include/isc kernel kernel/sys libntp libopts libparse librsaref ntpd... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 22:29:31 -0000 Author: roberto Date: Sat Dec 12 22:29:30 2009 New Revision: 200451 URL: http://svn.freebsd.org/changeset/base/200451 Log: Update ntp vendor code to 4.2.4p8. This is mainly to fix CVE-2009-3563, a remote DOS. MFC after: 3 days Security: CVE-2009-3563 Added: vendor/ntp/dist/html/build/hints/solaris.xtra.4095849 Deleted: vendor/ntp/dist/README.cvs vendor/ntp/dist/README.des vendor/ntp/dist/README.rsa vendor/ntp/dist/acconfig.h vendor/ntp/dist/conf/dewey.conf vendor/ntp/dist/html/Oncore-SHMEM.htm vendor/ntp/dist/html/accopt.htm vendor/ntp/dist/html/assoc.htm vendor/ntp/dist/html/audio.htm vendor/ntp/dist/html/authopt.htm vendor/ntp/dist/html/biblio.htm vendor/ntp/dist/html/build.htm vendor/ntp/dist/html/clockopt.htm vendor/ntp/dist/html/config.htm vendor/ntp/dist/html/confopt.htm vendor/ntp/dist/html/copyright.htm vendor/ntp/dist/html/debug.htm vendor/ntp/dist/html/driver1.htm vendor/ntp/dist/html/driver10.htm vendor/ntp/dist/html/driver11.htm vendor/ntp/dist/html/driver12.htm vendor/ntp/dist/html/driver16.htm vendor/ntp/dist/html/driver18.htm vendor/ntp/dist/html/driver19.htm vendor/ntp/dist/html/driver2.htm vendor/ntp/dist/html/driver20.htm vendor/ntp/dist/html/driver22.htm vendor/ntp/dist/html/driver23.htm vendor/ntp/dist/html/driver24.htm vendor/ntp/dist/html/driver26.htm vendor/ntp/dist/html/driver27.htm vendor/ntp/dist/html/driver28.htm vendor/ntp/dist/html/driver29.htm vendor/ntp/dist/html/driver3.htm vendor/ntp/dist/html/driver30.htm vendor/ntp/dist/html/driver32.htm vendor/ntp/dist/html/driver33.htm vendor/ntp/dist/html/driver34.htm vendor/ntp/dist/html/driver35.htm vendor/ntp/dist/html/driver36.htm vendor/ntp/dist/html/driver37.htm vendor/ntp/dist/html/driver38.htm vendor/ntp/dist/html/driver39.htm vendor/ntp/dist/html/driver4.htm vendor/ntp/dist/html/driver40.htm vendor/ntp/dist/html/driver42.htm vendor/ntp/dist/html/driver42.html vendor/ntp/dist/html/driver43.htm vendor/ntp/dist/html/driver44.htm vendor/ntp/dist/html/driver5.htm vendor/ntp/dist/html/driver6.htm vendor/ntp/dist/html/driver7.htm vendor/ntp/dist/html/driver8.htm vendor/ntp/dist/html/driver9.htm vendor/ntp/dist/html/exec.htm vendor/ntp/dist/html/extern.htm vendor/ntp/dist/html/gadget.htm vendor/ntp/dist/html/genkeys.htm vendor/ntp/dist/html/hints.htm vendor/ntp/dist/html/hints/sco.htm vendor/ntp/dist/html/hints/vxworks.htm vendor/ntp/dist/html/hints/winnt.htm vendor/ntp/dist/html/howto.htm vendor/ntp/dist/html/htmlprimer.htm vendor/ntp/dist/html/index.htm vendor/ntp/dist/html/kern.htm vendor/ntp/dist/html/kernpps.htm vendor/ntp/dist/html/ldisc.htm vendor/ntp/dist/html/leap.htm vendor/ntp/dist/html/measure.htm vendor/ntp/dist/html/miscopt.htm vendor/ntp/dist/html/monopt.htm vendor/ntp/dist/html/mx4200data.htm vendor/ntp/dist/html/notes.htm vendor/ntp/dist/html/ntpd.htm vendor/ntp/dist/html/ntpdate.htm vendor/ntp/dist/html/ntpdc.htm vendor/ntp/dist/html/ntpq.htm vendor/ntp/dist/html/ntptime.htm vendor/ntp/dist/html/ntptrace.htm vendor/ntp/dist/html/parsedata.htm vendor/ntp/dist/html/parsenew.htm vendor/ntp/dist/html/patches.htm vendor/ntp/dist/html/porting.htm vendor/ntp/dist/html/pps.htm vendor/ntp/dist/html/prefer.htm vendor/ntp/dist/html/qth.htm vendor/ntp/dist/html/quick.htm vendor/ntp/dist/html/rdebug.htm vendor/ntp/dist/html/refclock.htm vendor/ntp/dist/html/release.htm vendor/ntp/dist/html/tickadj.htm vendor/ntp/dist/include/md5.h vendor/ntp/dist/libntp/authencrypt.c vendor/ntp/dist/libntp/authparity.c vendor/ntp/dist/librsaref/Makefile.am vendor/ntp/dist/librsaref/Makefile.in vendor/ntp/dist/ntp_update vendor/ntp/dist/ntptrace/Makefile.am vendor/ntp/dist/ntptrace/Makefile.in vendor/ntp/dist/ntptrace/README vendor/ntp/dist/ntptrace/ntptrace.c vendor/ntp/dist/ntptrace/ntptrace.h vendor/ntp/dist/stamp-h.in vendor/ntp/dist/util/ntp-genkeys.c Modified: vendor/ntp/dist/COPYRIGHT vendor/ntp/dist/ChangeLog vendor/ntp/dist/CommitLog vendor/ntp/dist/Makefile.in vendor/ntp/dist/NEWS vendor/ntp/dist/README vendor/ntp/dist/README.bk vendor/ntp/dist/README.patches vendor/ntp/dist/WHERE-TO-START vendor/ntp/dist/aclocal.m4 vendor/ntp/dist/adjtimed/Makefile.in vendor/ntp/dist/arlib/Makefile.in vendor/ntp/dist/arlib/aclocal.m4 vendor/ntp/dist/arlib/configure vendor/ntp/dist/build vendor/ntp/dist/clockstuff/Makefile.in vendor/ntp/dist/config.h.in vendor/ntp/dist/configure vendor/ntp/dist/configure.ac vendor/ntp/dist/flock-build vendor/ntp/dist/html/copyright.html vendor/ntp/dist/html/drivers/driver40.html vendor/ntp/dist/include/Makefile.in vendor/ntp/dist/include/copyright.def vendor/ntp/dist/include/isc/Makefile.in vendor/ntp/dist/include/ntp_debug.h vendor/ntp/dist/include/version.def vendor/ntp/dist/kernel/Makefile.in vendor/ntp/dist/kernel/sys/Makefile.in vendor/ntp/dist/libntp/Makefile.in vendor/ntp/dist/libopts/Makefile.in vendor/ntp/dist/libparse/Makefile.am vendor/ntp/dist/libparse/Makefile.in vendor/ntp/dist/libparse/clk_rawdcf.c vendor/ntp/dist/ntpd/Makefile.in vendor/ntp/dist/ntpd/cmd_args.c vendor/ntp/dist/ntpd/ntp_crypto.c vendor/ntp/dist/ntpd/ntp_intres.c vendor/ntp/dist/ntpd/ntp_io.c vendor/ntp/dist/ntpd/ntp_request.c vendor/ntp/dist/ntpd/ntp_timer.c vendor/ntp/dist/ntpd/ntpd-opts.c vendor/ntp/dist/ntpd/ntpd-opts.h vendor/ntp/dist/ntpd/ntpd-opts.texi vendor/ntp/dist/ntpd/ntpd.1 vendor/ntp/dist/ntpd/ntpd.c vendor/ntp/dist/ntpd/ntpdsim-opts.c vendor/ntp/dist/ntpd/ntpdsim-opts.h vendor/ntp/dist/ntpd/ntpdsim-opts.texi vendor/ntp/dist/ntpd/ntpdsim.1 vendor/ntp/dist/ntpd/refclock_dumbclock.c vendor/ntp/dist/ntpd/refclock_hopfser.c vendor/ntp/dist/ntpd/refclock_jjy.c vendor/ntp/dist/ntpd/refclock_nmea.c vendor/ntp/dist/ntpd/refclock_palisade.c vendor/ntp/dist/ntpdate/Makefile.in vendor/ntp/dist/ntpdc/Makefile.in vendor/ntp/dist/ntpdc/ntpdc-opts.c vendor/ntp/dist/ntpdc/ntpdc-opts.h vendor/ntp/dist/ntpdc/ntpdc-opts.texi vendor/ntp/dist/ntpdc/ntpdc.1 vendor/ntp/dist/ntpq/Makefile.in vendor/ntp/dist/ntpq/ntpq-opts.c vendor/ntp/dist/ntpq/ntpq-opts.h vendor/ntp/dist/ntpq/ntpq-opts.texi vendor/ntp/dist/ntpq/ntpq.1 vendor/ntp/dist/ntpq/ntpq.c vendor/ntp/dist/packageinfo.sh vendor/ntp/dist/parseutil/Makefile.in vendor/ntp/dist/scripts/Makefile.in vendor/ntp/dist/sntp/Makefile.in vendor/ntp/dist/sntp/aclocal.m4 vendor/ntp/dist/sntp/config.h.in vendor/ntp/dist/sntp/configure vendor/ntp/dist/sntp/configure.ac vendor/ntp/dist/sntp/libopts/Makefile.in vendor/ntp/dist/sntp/sntp-opts.c vendor/ntp/dist/sntp/sntp-opts.def vendor/ntp/dist/sntp/sntp-opts.h vendor/ntp/dist/sntp/sntp-opts.texi vendor/ntp/dist/sntp/sntp.1 vendor/ntp/dist/sntp/version.def vendor/ntp/dist/util/Makefile.in vendor/ntp/dist/util/ntp-keygen-opts.c vendor/ntp/dist/util/ntp-keygen-opts.h vendor/ntp/dist/util/ntp-keygen-opts.texi vendor/ntp/dist/util/ntp-keygen.1 vendor/ntp/dist/version vendor/ntp/dist/version.m4 Modified: vendor/ntp/dist/COPYRIGHT ============================================================================== --- vendor/ntp/dist/COPYRIGHT Sat Dec 12 22:08:37 2009 (r200450) +++ vendor/ntp/dist/COPYRIGHT Sat Dec 12 22:29:30 2009 (r200451) @@ -13,7 +13,7 @@ This file is automatically generated fro applies as if the text was explicitly included in the file. *********************************************************************** * * -* Copyright (c) David L. Mills 1992-2008 * +* Copyright (c) David L. Mills 1992-2009 * * * * Permission to use, copy, modify, and distribute this software and * * its documentation for any purpose with or without fee is hereby * Modified: vendor/ntp/dist/ChangeLog ============================================================================== --- vendor/ntp/dist/ChangeLog Sat Dec 12 22:08:37 2009 (r200450) +++ vendor/ntp/dist/ChangeLog Sat Dec 12 22:29:30 2009 (r200451) @@ -1,6 +1,85 @@ -(4.2.4p5) 2008/08/17 Released by Harlan Stenn --- -(4.2.4p5) 2008/08/17 Released by Harlan Stenn +(4.2.4p8) 2009/12/08 Released by Harlan Stenn + +* [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. + +--- +(4.2.4p7) 2009/05/18 Released by Harlan Stenn + +* [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252. +* [Bug 1187] Update the copyright date. +* [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. + +--- +(4.2.4p7-RC7) 2009/05/12 Released by Harlan Stenn + +* ntp.isc.org -> ntp.org cleanup. +* [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime, + add configure --enable-ignore-dns-errors to be even more stubborn + +--- +(4.2.4p7-RC6) 2009/05/08 Released by Harlan Stenn + +* [Bug 784] Make --enable-linuxcaps the default when available +* [Bug 1179] error messages for -u/--user and -i lacking droproot +* Updated JJY reference clock driver from Takao Abe +* [Bug 1071] Log a message and exit before trying to use FD_SET with a + descriptor larger than FD_SETSIZE, which will corrupt memory +* On corruption of the iface list head in add_interface, log and exit + +--- +(4.2.4p7-RC5) 2009/05/02 Released by Harlan Stenn + +* [Bug 1172] 4.2.4p7-RC{3,4} fail to build on linux. +* flock-build script unportable 'set -m' use removed + +--- +(4.2.4p7-RC4) 2009/04/29 Released by Harlan Stenn + +* [Bug 1167] use gcc -Winit-self only if it is understood + +--- +(4.2.4p7-RC3) 2009/04/22 Released by Harlan Stenn + +* [Bug 787] Bug fixes for 64-bit time_t on Windows +* [Bug 813] Conditional naming of Event +* [Bug 1147] System errors should be logged to msyslog() +* [Bug 1155] Fix compile problem on Windows with VS2005 +* [Bug 1156] lock_thread_to_processor() should be declared in header +* [Bug 1157] quiet OpenSSL warnings, clean up configure.ac +* [Bug 1158] support for aix6.1 +* [Bug 1160] MacOS X is like BSD regarding F_SETOWN + +--- +(4.2.4p7-RC2) 2009/04/09 Released by Harlan Stenn + +* [Sec 1144] limited buffer overflow in ntpq. CVE-2009-0159 +* [Sec 1149] use SO_EXCLUSIVEADDRUSE on Windows + +--- +(4.2.4p7-RC1) 2009/03/30 Released by Harlan Stenn + +* [Bug 1131] UDP sockets should not use SIGPOLL on Solaris. +* build system email address cleanup +* [Bug 774] parsesolaris.c does not compile under the new Solaris +* [Bug 873] Windows serial refclock proper TTY line discipline emulation +* [Bug 1014] Enable building with VC9 (in Visual Studio 2008, + Visual C++ 2008, or SDK) +* [Bug 1117] Deferred interface binding under Windows works only correctly + if FORCE_DNSRETRY is defined +* [BUG 1124] Lock QueryPerformanceCounter() client threads to same CPU +* DPRINTF macro made safer, always evaluates to a statement and will not + misassociate an else which follows the macro. + +--- +(4.2.4p6) 2009/01/08 Released by Harlan Stenn + +* [Bug 1113] Fixed build errors with recent versions of openSSL. +* [Sec 1111] Fix incorrect check of EVP_VerifyFinal()'s return value. +* Update the copyright year. + +--- (4.2.4p5) 2008/08/17 Released by Harlan Stenn * [BUG 1051] Month off by one in leap second message written to clockstats Modified: vendor/ntp/dist/CommitLog ============================================================================== --- vendor/ntp/dist/CommitLog Sat Dec 12 22:08:37 2009 (r200450) +++ vendor/ntp/dist/CommitLog Sat Dec 12 22:29:30 2009 (r200451) @@ -1,1772 +1,3496 @@ -ChangeSet@1.1541, 2008-08-17 05:30:47-04:00, stenn@whimsy.udel.edu +26 -0 - NTP_4_2_4P5 - TAG: NTP_4_2_4P5 +ChangeSet@1.1612, 2009-12-08 08:30:54-05:00, stenn@whimsy.udel.edu +1 -0 + ChangeLog: + typo - ChangeLog@1.44, 2008-08-17 05:30:27-04:00, stenn@whimsy.udel.edu +3 -0 - NTP_4_2_4P5 + ChangeLog@1.95, 2009-12-08 08:30:44-05:00, stenn@whimsy.udel.edu +0 -1 + typo - ntpd/ntpd-opts.c@1.74, 2008-08-17 05:30:28-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 +ChangeSet@1.1611, 2009-12-08 08:23:12-05:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P8 + TAG: NTP_4_2_4P8 - ntpd/ntpd-opts.h@1.74, 2008-08-17 05:30:28-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ChangeLog@1.94, 2009-12-08 08:23:01-05:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P8 - ntpd/ntpd-opts.texi@1.73, 2008-08-17 05:30:29-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpd/ntpd-opts.c@1.86, 2009-12-08 08:23:02-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpd.1@1.72, 2008-08-17 05:30:30-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpd-opts.h@1.86, 2009-12-08 08:23:02-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.c@1.74, 2008-08-17 05:30:30-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpd-opts.texi@1.85, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.h@1.74, 2008-08-17 05:30:31-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpd/ntpd.1@1.84, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpdsim-opts.texi@1.72, 2008-08-17 05:30:32-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.c@1.86, 2009-12-08 08:23:03-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpd/ntpdsim.1@1.72, 2008-08-17 05:30:33-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.h@1.86, 2009-12-08 08:23:04-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.c@1.74, 2008-08-17 05:30:33-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpd/ntpdsim-opts.texi@1.84, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.h@1.74, 2008-08-17 05:30:34-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpd/ntpdsim.1@1.84, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpdc/ntpdc-opts.texi@1.72, 2008-08-17 05:30:34-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.c@1.86, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpdc/ntpdc.1@1.72, 2008-08-17 05:30:35-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.h@1.86, 2009-12-08 08:23:05-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - ntpq/ntpq-opts.c@1.76, 2008-08-17 05:30:35-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpdc/ntpdc-opts.texi@1.84, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - ntpq/ntpq-opts.h@1.76, 2008-08-17 05:30:36-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + ntpdc/ntpdc.1@1.84, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpq/ntpq-opts.texi@1.73, 2008-08-17 05:30:36-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + ntpq/ntpq-opts.c@1.88, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - ntpq/ntpq.1@1.72, 2008-08-17 05:30:37-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq-opts.h@1.88, 2009-12-08 08:23:06-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - packageinfo.sh@1.101, 2008-08-17 05:30:37-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq-opts.texi@1.85, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - sntp/sntp-opts.c@1.72, 2008-08-17 05:30:38-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + ntpq/ntpq.1@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - sntp/sntp-opts.h@1.72, 2008-08-17 05:30:39-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + packageinfo.sh@1.118, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P8 - sntp/sntp-opts.texi@1.69, 2008-08-17 05:30:39-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + sntp/sntp-opts.c@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - sntp/sntp.1@1.72, 2008-08-17 05:30:40-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + sntp/sntp-opts.h@1.84, 2009-12-08 08:23:07-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 - util/ntp-keygen-opts.c@1.73, 2008-08-17 05:30:40-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + sntp/sntp-opts.texi@1.81, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - util/ntp-keygen-opts.h@1.73, 2008-08-17 05:30:41-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5 + sntp/sntp.1@1.84, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - util/ntp-keygen-opts.texi@1.71, 2008-08-17 05:30:42-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5 + util/ntp-keygen-opts.c@1.85, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 - util/ntp-keygen.1@1.71, 2008-08-17 05:30:42-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5 + util/ntp-keygen-opts.h@1.85, 2009-12-08 08:23:08-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P8 -ChangeSet@1.1540, 2008-08-17 05:29:47-04:00, stenn@whimsy.udel.edu +1 -0 - typo + util/ntp-keygen-opts.texi@1.83, 2009-12-08 08:23:09-05:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P8 - scripts/addChangeLogTag@1.2, 2008-08-17 05:29:37-04:00, stenn@whimsy.udel.edu +1 -1 - typo + util/ntp-keygen.1@1.83, 2009-12-08 08:23:09-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P8 -ChangeSet@1.1539, 2008-08-17 03:28:53-04:00, stenn@whimsy.udel.edu +5 -0 - 4.2.4p5 prep +ChangeSet@1.1610, 2009-12-08 07:45:28-05:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P9_RC1 + TAG: NTP_4_2_4P9_RC1 - .point-changed-filelist@1.2, 2008-08-17 03:27:42-04:00, stenn@whimsy.udel.edu +1 -0 - 4.2.4p5 prep + ChangeLog@1.93, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P9_RC1 - NEWS@1.99, 2008-08-17 03:27:42-04:00, stenn@whimsy.udel.edu +17 -0 - 4.2.4p5 prep + ntpd/ntpd-opts.c@1.85, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - packageinfo.sh@1.100, 2008-08-17 03:27:43-04:00, stenn@whimsy.udel.edu +1 -1 - 4.2.4p5 prep + ntpd/ntpd-opts.h@1.85, 2009-12-08 07:45:19-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - scripts/addChangeLogTag@1.1, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +27 -0 - BitKeeper file /deacon/backroom/ntp-stable/scripts/addChangeLogTag + ntpd/ntpd-opts.texi@1.84, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +13 -6 + NTP_4_2_4P9_RC1 - scripts/addChangeLogTag@1.0, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +0 -0 + ntpd/ntpd.1@1.83, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - scripts/genChangeLogTag@1.1, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +6 -0 - BitKeeper file /deacon/backroom/ntp-stable/scripts/genChangeLogTag + ntpd/ntpdsim-opts.c@1.85, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - scripts/genChangeLogTag@1.0, 2008-08-17 03:27:55-04:00, stenn@whimsy.udel.edu +0 -0 + ntpd/ntpdsim-opts.h@1.85, 2009-12-08 07:45:20-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 -ChangeSet@1.1538, 2008-08-16 22:42:08-04:00, stenn@whimsy.udel.edu +2 -0 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpd/ntpdsim-opts.texi@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +61 -2 + NTP_4_2_4P9_RC1 - ChangeLog@1.43, 2008-08-16 22:41:50-04:00, stenn@whimsy.udel.edu +2 -0 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpd/ntpdsim.1@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/refclock_oncore.c@1.63, 2008-08-16 22:41:50-04:00, stenn@whimsy.udel.edu +1 -1 - [BUG 1051] Month off by one in leap second message written to clockstats + ntpdc/ntpdc-opts.c@1.85, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 -ChangeSet@1.1537, 2008-08-10 07:44:31-04:00, stenn@whimsy.udel.edu +25 -0 - NTP_4_2_4P5_RC2 - TAG: NTP_4_2_4P5_RC2 + ntpdc/ntpdc-opts.h@1.85, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.c@1.73, 2008-08-10 07:44:09-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpdc/ntpdc-opts.texi@1.83, 2009-12-08 07:45:21-05:00, stenn@whimsy.udel.edu +7 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.h@1.73, 2008-08-10 07:44:09-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpdc/ntpdc.1@1.83, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/ntpd-opts.texi@1.72, 2008-08-10 07:44:10-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.c@1.87, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpd/ntpd.1@1.71, 2008-08-10 07:44:10-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.h@1.87, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.c@1.73, 2008-08-10 07:44:11-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpq/ntpq-opts.texi@1.84, 2009-12-08 07:45:22-05:00, stenn@whimsy.udel.edu +8 -4 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.h@1.73, 2008-08-10 07:44:12-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpq/ntpq.1@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim-opts.texi@1.71, 2008-08-10 07:44:12-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + packageinfo.sh@1.117, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P9_RC1 - ntpd/ntpdsim.1@1.71, 2008-08-10 07:44:13-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.c@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.c@1.73, 2008-08-10 07:44:14-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.h@1.83, 2009-12-08 07:45:23-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.h@1.73, 2008-08-10 07:44:15-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + sntp/sntp-opts.texi@1.80, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +54 -2 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc-opts.texi@1.71, 2008-08-10 07:44:16-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + sntp/sntp.1@1.83, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpdc/ntpdc.1@1.71, 2008-08-10 07:44:17-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.c@1.84, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +5 -5 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.c@1.75, 2008-08-10 07:44:17-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.h@1.84, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.h@1.75, 2008-08-10 07:44:18-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + util/ntp-keygen-opts.texi@1.82, 2009-12-08 07:45:24-05:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P9_RC1 - ntpq/ntpq-opts.texi@1.72, 2008-08-10 07:44:19-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + util/ntp-keygen.1@1.82, 2009-12-08 07:45:25-05:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P9_RC1 - ntpq/ntpq.1@1.71, 2008-08-10 07:44:20-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 +ChangeSet@1.1609, 2009-12-08 05:36:47-05:00, stenn@whimsy.udel.edu +2 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - packageinfo.sh@1.99, 2008-08-10 07:44:20-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + NEWS@1.102, 2009-12-08 05:36:36-05:00, stenn@whimsy.udel.edu +34 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - sntp/sntp-opts.c@1.71, 2008-08-10 07:44:22-04:00, stenn@whimsy.udel.edu +4 -5 - NTP_4_2_4P5_RC2 + packageinfo.sh@1.116, 2009-12-08 05:36:36-05:00, stenn@whimsy.udel.edu +2 -2 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563 - sntp/sntp-opts.h@1.71, 2008-08-10 07:44:23-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC2 +ChangeSet@1.1608, 2009-10-07 01:33:22+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - sntp/sntp-opts.texi@1.68, 2008-08-10 07:44:23-04:00, stenn@whimsy.udel.edu +2 -3 - NTP_4_2_4P5_RC2 + ChangeLog@1.92, 2009-10-07 01:33:21+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - sntp/sntp.1@1.71, 2008-08-10 07:44:24-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ntpd/ntp_request.c@1.68, 2009-10-07 01:33:21+00:00, davehart@shiny.ad.hartbrothers.com +9 -2 + [Sec 1331] DoS with mode 7 packets - CVE-2009-3563. - util/ntp-keygen-opts.c@1.72, 2008-08-10 07:44:25-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 +ChangeSet@1.1607, 2009-05-18 05:04:41-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7 + TAG: NTP_4_2_4P7 - util/ntp-keygen-opts.h@1.72, 2008-08-10 07:44:25-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC2 + ChangeLog@1.91, 2009-05-18 05:04:18-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7 - util/ntp-keygen-opts.texi@1.70, 2008-08-10 07:44:27-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC2 + ntpd/ntpd-opts.c@1.84, 2009-05-18 05:04:19-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - util/ntp-keygen.1@1.70, 2008-08-10 07:44:27-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC2 + ntpd/ntpd-opts.h@1.84, 2009-05-18 05:04:20-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 -ChangeSet@1.1531.3.1, 2008-08-10 02:22:22-04:00, stenn@whimsy.udel.edu +1 -0 - triggert needs to handle rooted RESYNC paths now + ntpd/ntpd-opts.texi@1.83, 2009-05-18 05:04:21-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - BitKeeper/triggers/triggert@1.5, 2008-08-10 02:22:11-04:00, stenn@whimsy.udel.edu +3 -2 - triggert needs to handle rooted RESYNC paths now + ntpd/ntpd.1@1.82, 2009-05-18 05:04:22-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 -ChangeSet@1.1534, 2008-08-09 20:05:06-04:00, stenn@whimsy.udel.edu +2 -0 - AutoGen'd files must be writable + ntpd/ntpdsim-opts.c@1.84, 2009-05-18 05:04:22-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - sntp/Makefile.am@1.23, 2008-08-09 20:04:56-04:00, stenn@whimsy.udel.edu +2 -2 - AutoGen'd files must be writable + ntpd/ntpdsim-opts.h@1.84, 2009-05-18 05:04:23-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - sntp/sntp-opts.menu@1.3, 2008-08-09 20:04:10-04:00, stenn@whimsy.udel.edu +0 -0 - Change mode to -rw-rw-r-- + ntpd/ntpdsim-opts.texi@1.82, 2009-05-18 05:04:24-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1531.2.1, 2008-08-07 20:44:31+02:00, burnicki@pogo.udel.edu +3 -0 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpd/ntpdsim.1@1.82, 2009-05-18 05:04:25-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ChangeLog@1.39.2.1, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +2 -0 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.c@1.84, 2009-05-18 05:04:26-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpd/ntp_peer.c@1.99.1.1, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +10 -2 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.h@1.84, 2009-05-18 05:04:26-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ports/winnt/ntpd/ntservice.c@1.11, 2008-08-07 20:44:30+02:00, burnicki@pogo.udel.edu +8 -1 - [Bug 450] Windows only: Under original Windows NT we must not discard the - wildcard socket to workaround a bug in NT's getsockname(). + ntpdc/ntpdc-opts.texi@1.82, 2009-05-18 05:04:27-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1531.1.2, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu +1 -0 - Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. + ntpdc/ntpdc.1@1.82, 2009-05-18 05:04:28-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ports/winnt/ntpd/ntp_iocompletionport.c@1.26, 2008-08-05 09:56:08+02:00, burnicki@pogo.udel.edu +0 -8 - Removed Windows-specific debug code which has been added in ntp-dev and fails to compile in ntp-stable. + ntpq/ntpq-opts.c@1.86, 2009-05-18 05:04:29-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 -ChangeSet@1.1531.1.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +10 -0 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + ntpq/ntpq-opts.h@1.86, 2009-05-18 05:04:29-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ChangeLog@1.39.1.1, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +3 -0 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + ntpq/ntpq-opts.texi@1.83, 2009-05-18 05:04:30-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - html/confopt.html@1.36, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -2 - Bug 841: Obsolete the "dynamic" keyword. + ntpq/ntpq.1@1.82, 2009-05-18 05:04:31-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - html/ntpdc.html@1.27, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +2 -3 - Bug 841: Obsolete the "dynamic" keyword. + packageinfo.sh@1.115, 2009-05-18 05:04:32-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - include/ntp.h@1.129, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -1 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp-opts.c@1.82, 2009-05-18 05:04:32-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - include/ntp_request.h@1.31, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +0 -1 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp-opts.h@1.82, 2009-05-18 05:04:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7 - ntpd/ntp_config.c@1.144, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +4 -2 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. - Emit a warning if that keyword is used for configuration. + sntp/sntp-opts.texi@1.79, 2009-05-18 05:04:34-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 - ntpd/ntp_intres.c@1.52, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +1 -3 - Bug 841: Obsolete the "dynamic" keyword. + sntp/sntp.1@1.82, 2009-05-18 05:04:34-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ntpd/ntp_peer.c@1.100, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +5 -25 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. + util/ntp-keygen-opts.c@1.83, 2009-05-18 05:04:35-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpd/ntp_request.c@1.66, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +1 -3 - Bug 841: Obsolete the "dynamic" keyword. + util/ntp-keygen-opts.h@1.83, 2009-05-18 05:04:36-04:00, stenn@whimsy.udel.edu +4 -4 + NTP_4_2_4P7 - ntpdc/ntpdc_ops.c@1.50, 2008-08-05 09:50:23+02:00, burnicki@pogo.udel.edu +3 -3 - [Bug 841] Obsolete the "dynamic" keyword and make deferred binding - to local interfaces the default. + util/ntp-keygen-opts.texi@1.81, 2009-05-18 05:04:37-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7 -ChangeSet@1.1532, 2008-07-22 11:41:26+02:00, burnicki@pogo.udel.edu +2 -0 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. + util/ntp-keygen.1@1.81, 2009-05-18 05:04:37-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7 - ChangeLog@1.40, 2008-07-22 11:41:25+02:00, burnicki@pogo.udel.edu +1 -0 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. +ChangeSet@1.1606, 2009-05-18 03:14:59-04:00, stenn@whimsy.udel.edu +2 -0 + 4.2.4p7 - libntp/machines.c@1.19, 2008-07-22 11:41:25+02:00, burnicki@pogo.udel.edu +2 -2 - [Bug 1038] Built-in getpass() function also prompts for password if not built with DEBUG. + NEWS@1.101, 2009-05-18 03:14:49-04:00, stenn@whimsy.udel.edu +38 -0 + 4.2.4p7 -ChangeSet@1.1531, 2008-05-20 03:51:01-04:00, stenn@whimsy.udel.edu +25 -0 - NTP_4_2_4P5_RC1 - TAG: NTP_4_2_4P5_RC1 + packageinfo.sh@1.114, 2009-05-18 03:14:50-04:00, stenn@whimsy.udel.edu +1 -1 + 4.2.4p7 - ntpd/ntpd-opts.c@1.72, 2008-05-20 03:50:37-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 +ChangeSet@1.1605, 2009-05-18 02:56:36-04:00, stenn@whimsy.udel.edu +2 -0 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd-opts.h@1.72, 2008-05-20 03:50:37-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.90, 2009-05-18 02:56:22-04:00, stenn@whimsy.udel.edu +1 -0 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd-opts.texi@1.71, 2008-05-20 03:50:38-04:00, stenn@whimsy.udel.edu +8 -11 - NTP_4_2_4P5_RC1 + ntpd/ntp_crypto.c@1.110, 2009-05-18 02:56:22-04:00, stenn@whimsy.udel.edu +22 -17 + [Sec 1151] Remote exploit if autokey is enabled - CVE-2009-1252 - ntpd/ntpd.1@1.70, 2008-05-20 03:50:39-04:00, stenn@whimsy.udel.edu +4 -4 - NTP_4_2_4P5_RC1 +ChangeSet@1.1604, 2009-05-18 02:24:31-04:00, stenn@whimsy.udel.edu +2 -0 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.c@1.72, 2008-05-20 03:50:40-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.89, 2009-05-18 02:24:21-04:00, stenn@whimsy.udel.edu +1 -0 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.h@1.72, 2008-05-20 03:50:41-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + include/copyright.def@1.8, 2009-05-18 02:24:22-04:00, stenn@whimsy.udel.edu +1 -1 + [Bug 1187] Update the copyright date. - ntpd/ntpdsim-opts.texi@1.70, 2008-05-20 03:50:42-04:00, stenn@whimsy.udel.edu +3 -4 - NTP_4_2_4P5_RC1 +ChangeSet@1.1603, 2009-05-17 08:59:06+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpd/ntpdsim.1@1.70, 2008-05-20 03:50:43-04:00, stenn@whimsy.udel.edu +4 -4 - NTP_4_2_4P5_RC1 + ChangeLog@1.88, 2009-05-17 08:59:05+00:00, davehart@shiny.ad.hartbrothers.com +5 -0 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpdc/ntpdc-opts.c@1.72, 2008-05-20 03:50:44-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpd/ntp_io.c@1.261, 2009-05-17 08:59:05+00:00, davehart@shiny.ad.hartbrothers.com +45 -34 + [Bug 1191] ntpd fails on Win2000 - "Address already in use" after fix + for [Sec 1149]. - ntpdc/ntpdc-opts.h@1.72, 2008-05-20 03:50:44-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 +ChangeSet@1.1602, 2009-05-14 04:42:10+00:00, davehart@shiny.ad.hartbrothers.com +1 -0 + fix error from BitKeeper/triggers/pre-resolve.licfix triggered (ahem) + by recent BitKeeper/etc/config delta updating repologs email address - ntpdc/ntpdc-opts.texi@1.70, 2008-05-20 03:50:45-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC1 + BitKeeper/triggers/pre-resolve.licfix@1.5, 2009-05-14 04:42:09+00:00, davehart@shiny.ad.hartbrothers.com +4 -1 + bk sccscat has been removed, replaced by bk annotate -R + -q grep -> grep -q (untested until recent BitKeeper/etc/config commit + changing repologs@ntp.isc.org to repologs@ntp.org - ntpdc/ntpdc.1@1.70, 2008-05-20 03:50:46-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 +ChangeSet@1.1601, 2009-05-12 02:41:56-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7_RC7 + TAG: NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.c@1.74, 2008-05-20 03:50:47-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ChangeLog@1.87, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.h@1.74, 2008-05-20 03:50:47-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.c@1.83, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpq/ntpq-opts.texi@1.71, 2008-05-20 03:50:48-04:00, stenn@whimsy.udel.edu +5 -6 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.h@1.83, 2009-05-12 02:41:33-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpq/ntpq.1@1.70, 2008-05-20 03:50:49-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpd/ntpd-opts.texi@1.82, 2009-05-12 02:41:35-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - packageinfo.sh@1.98, 2008-05-20 03:50:50-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpd.1@1.81, 2009-05-12 02:41:35-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.c@1.70, 2008-05-20 03:50:51-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.c@1.83, 2009-05-12 02:41:36-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.h@1.70, 2008-05-20 03:50:52-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.h@1.83, 2009-05-12 02:41:37-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - sntp/sntp-opts.texi@1.67, 2008-05-20 03:50:52-04:00, stenn@whimsy.udel.edu +1 -1 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim-opts.texi@1.81, 2009-05-12 02:41:37-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - sntp/sntp.1@1.70, 2008-05-20 03:50:53-04:00, stenn@whimsy.udel.edu +2 -2 - NTP_4_2_4P5_RC1 + ntpd/ntpdsim.1@1.81, 2009-05-12 02:41:38-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.c@1.71, 2008-05-20 03:50:54-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.c@1.83, 2009-05-12 02:41:39-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.h@1.71, 2008-05-20 03:50:54-04:00, stenn@whimsy.udel.edu +6 -7 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.h@1.83, 2009-05-12 02:41:40-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - util/ntp-keygen-opts.texi@1.69, 2008-05-20 03:50:55-04:00, stenn@whimsy.udel.edu +7 -9 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc-opts.texi@1.81, 2009-05-12 02:41:41-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - util/ntp-keygen.1@1.69, 2008-05-20 03:50:56-04:00, stenn@whimsy.udel.edu +3 -3 - NTP_4_2_4P5_RC1 + ntpdc/ntpdc.1@1.81, 2009-05-12 02:41:42-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1530, 2008-05-18 05:14:37-04:00, stenn@whimsy.udel.edu +1 -0 - Start the 4.2.4p5 release candidate cycle + ntpq/ntpq-opts.c@1.85, 2009-05-12 02:41:43-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - packageinfo.sh@1.97, 2008-05-18 05:14:27-04:00, stenn@whimsy.udel.edu +1 -1 - Start the 4.2.4p5 release candidate cycle + ntpq/ntpq-opts.h@1.85, 2009-05-12 02:41:44-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1529, 2008-04-11 18:41:57-04:00, stenn@whimsy.udel.edu +1 -0 - Solaris _XOPEN_SOURCE updates + ntpq/ntpq-opts.texi@1.82, 2009-05-12 02:41:45-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - configure.ac@1.401, 2008-04-11 18:41:47-04:00, stenn@whimsy.udel.edu +5 -1 - Solaris _XOPEN_SOURCE updates + ntpq/ntpq.1@1.81, 2009-05-12 02:41:46-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.3, 2008-04-10 02:09:52-04:00, stenn@pogo.udel.edu +1 -0 - Changelog cleanup + packageinfo.sh@1.113, 2009-05-12 02:41:47-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - ChangeLog@1.37.1.2, 2008-04-10 02:08:57-04:00, stenn@pogo.udel.edu +2 -1 + sntp/sntp-opts.c@1.81, 2009-05-12 02:41:47-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.2, 2008-04-08 12:20:22+02:00, burnicki@pogo.udel.edu +1 -0 - Always sleep a little before calling doconfigure() to make sure the network is completely up. + sntp/sntp-opts.h@1.81, 2009-05-12 02:41:48-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_intres.c@1.51, 2008-04-08 12:20:21+02:00, burnicki@pogo.udel.edu +5 -6 - Always sleep a little before calling doconfigure() to make sure the network is completely up. + sntp/sntp-opts.texi@1.78, 2009-05-12 02:41:49-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 -ChangeSet@1.1524.1.1, 2008-04-03 10:19:03-04:00, burnicki@pogo.udel.edu +5 -0 - [Bug 987] Wake up the resolver thread/process when a new interface has become available. + sntp/sntp.1@1.81, 2009-05-12 02:41:50-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ChangeLog@1.37.1.1, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +1 -0 - [Bug 987] Wake up the resolver thread/process when a new interface has become available. + util/ntp-keygen-opts.c@1.82, 2009-05-12 02:41:51-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - include/ntpd.h@1.98, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +5 -0 - Added vars used to wake up the resolver process/thread. + util/ntp-keygen-opts.h@1.82, 2009-05-12 02:41:51-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_config.c@1.143, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +34 -1 - Initialize synchronization variables when the resolver process/thread is started. + util/ntp-keygen-opts.texi@1.80, 2009-05-12 02:41:52-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC7 - ntpd/ntp_intres.c@1.50, 2008-04-03 10:18:59-04:00, burnicki@pogo.udel.edu +64 -65 - Enable the resolver to be woken up when a new interface has become available. + util/ntp-keygen.1@1.80, 2009-05-12 02:41:53-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC7 - ntpd/ntp_io.c@1.256, 2008-04-03 10:19:00-04:00, burnicki@pogo.udel.edu +25 -5 - Wake up the resolver thread/process when a new interface has become available. +ChangeSet@1.1600, 2009-05-12 01:07:37-04:00, stenn@whimsy.udel.edu +9 -0 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1527, 2008-03-24 22:12:42-04:00, mayer@pogo.udel.edu +1 -0 - bugs 993 a d 959 + BitKeeper/etc/config@1.10, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ChangeLog@1.38, 2008-03-24 22:12:26-04:00, mayer@pogo.udel.edu +2 -0 - bugs 993 a d 959 + ChangeLog@1.86, 2009-05-12 01:06:01-04:00, stenn@whimsy.udel.edu +1 -0 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1526, 2008-03-24 21:41:55-04:00, mayer@pogo.udel.edu +1 -0 - [Bug 959] Refclock on Windows not properly releasing recvbuffs + README@1.23, 2009-05-12 01:06:02-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ports/winnt/ntpd/ntp_iocompletionport.c@1.25, 2008-03-24 21:41:37-04:00, mayer@pogo.udel.edu +25 -13 - [Bug 959] Refclock on Windows not properly releasing recvbuffs + README.bk@1.19, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1525, 2008-03-24 21:40:32-04:00, mayer@pogo.udel.edu +1 -0 - [Bug 993] Windows: Fix memory leak when fetching system messages + README.patches@1.4, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ports/winnt/libisc/isc_strerror.c@1.5, 2008-03-24 21:40:07-04:00, mayer@pogo.udel.edu +78 -18 - [Bug 993] Windows: Fix memory leak when fetching system messages + WHERE-TO-START@1.7, 2009-05-12 01:06:03-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1520.3.5, 2008-03-22 02:12:10-05:00, stenn@whimsy.udel.edu +2 -0 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + configure.ac@1.418, 2009-05-12 01:06:04-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - ChangeLog@1.35.3.4, 2008-03-22 02:11:57-05:00, stenn@whimsy.udel.edu +1 -0 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + include/copyright.def@1.7, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup - libisc/net.c@1.9, 2008-03-22 02:11:58-05:00, stenn@whimsy.udel.edu +1 -1 - [Bug 977] Fix mismatching #ifdefs for builds without IPv6 + sntp/sntp-opts.def@1.11, 2009-05-12 01:06:49-04:00, stenn@whimsy.udel.edu +1 -1 + ntp.isc.org -> ntp.org cleanup -ChangeSet@1.1520.3.4, 2008-03-22 02:02:36-05:00, stenn@whimsy.udel.edu +3 -0 - Update the copyright year +ChangeSet@1.1597.1.1, 2009-05-08 18:11:36+00:00, davehart@shiny.ad.hartbrothers.com +1 -0 + configure.ac: + correct help text - ChangeLog@1.35.3.3, 2008-03-22 02:02:24-05:00, stenn@whimsy.udel.edu +8 -6 - Update the copyright year + configure.ac@1.415.1.1, 2009-05-08 18:11:24+00:00, davehart@shiny.ad.hartbrothers.com +11 -5 + correct help text - html/copyright.html@1.37, 2008-03-22 02:02:25-05:00, stenn@whimsy.udel.edu +1 -1 - Update the copyright year +ChangeSet@1.1598, 2009-05-08 17:50:37+00:00, davehart@shiny.ad.hartbrothers.com +3 -0 + add configure --enable-ignore-dns-errors to retry on any failure - include/copyright.def@1.6, 2008-03-22 02:02:25-05:00, stenn@whimsy.udel.edu +1 -1 - Update the copyright year + ChangeLog@1.85, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +2 -1 + add configure --enable-ignore-dns-errors to retry on any failure -ChangeSet@1.1520.3.3, 2008-03-22 01:58:52-05:00, stenn@whimsy.udel.edu +5 -0 - Make autogen-generated files writable + configure.ac@1.416, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +26 -4 + add configure --enable-ignore-dns-errors to retry on any failure - ntpd/Makefile.am@1.54, 2008-03-22 01:57:08-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_intres.c@1.55, 2009-05-08 17:50:35+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + add configure --enable-ignore-dns-errors to retry on any failure - ntpdc/Makefile.am@1.35, 2008-03-22 01:57:09-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable +ChangeSet@1.1597, 2009-05-08 15:34:46+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + Do not exceed FD_SETSIZE in ntp_intres.c + --- + ntp_intres.c: + typo + --- + ntp_intres.c: + missing comma typo + --- + ntp_intres.c: + typo - ntpq/Makefile.am@1.27, 2008-03-22 01:57:10-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_intres.c@1.54, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +64 -33 + fix typos, refine "host name not found" log message, stay under FD_SETSIZE - sntp/Makefile.am@1.22, 2008-03-22 01:57:11-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_request.c@1.67, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +21 -3 + after ntp_intres adds a server entry, rescan interfaces, to notice the + return of connectivity sooner. - util/Makefile.am@1.36, 2008-03-22 01:57:11-05:00, stenn@whimsy.udel.edu +1 -1 - Make autogen-generated files writable + ntpd/ntp_timer.c@1.34, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +3 -5 + indent cleanup -ChangeSet@1.1520.4.1, 2008-03-16 09:15:13-04:00, burnicki@pogo.udel.edu +2 -0 - [Bug 957] Windows only: Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. + ports/winnt/include/config.h@1.52, 2009-05-08 15:34:45+00:00, davehart@shiny.ad.hartbrothers.com +4 -10 + remove FORCE_DNSRETRY, no longer used + indent cleanup - ChangeLog@1.35.4.1, 2008-03-16 09:15:10-04:00, burnicki@pogo.udel.edu +3 -0 - [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. +ChangeSet@1.1587.1.1, 2009-05-08 11:24:43+00:00, davehart@shiny.ad.hartbrothers.com +2 -0 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime - ports/winnt/ntpd/ntservice.c@1.10, 2008-03-16 09:15:11-04:00, burnicki@pogo.udel.edu +11 -2 - [Bug 957] Let command line parameters from the Windows SCM GUI override the standard parameters from the ImagePath registry key. + ChangeLog@1.76.1.1, 2009-05-08 11:24:42+00:00, davehart@shiny.ad.hartbrothers.com +4 -0 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime -ChangeSet@1.1520.3.1, 2008-03-03 11:50:50+01:00, martin@pc-martin.py.meinberg.de +2 -0 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). + ntpd/ntp_intres.c@1.53, 2009-05-08 11:24:42+00:00, davehart@shiny.ad.hartbrothers.com +53 -55 + [Bug 1178] Use prior FORCE_DNSRETRY behavior as needed at runtime - ChangeLog@1.35.3.1, 2008-03-03 11:50:49+01:00, martin@pc-martin.py.meinberg.de +10 -0 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). +ChangeSet@1.1595, 2009-05-08 04:42:52-04:00, stenn@whimsy.udel.edu +26 -0 + NTP_4_2_4P7_RC6 + TAG: NTP_4_2_4P7_RC6 - ntpdate/ntpdate.c@1.62, 2008-03-03 11:50:49+01:00, martin@pc-martin.py.meinberg.de +101 -82 - [Bug 532] nptdate timeout is too long if several servers are supplied - [Bug 698] timeBeginPeriod is called without timeEndPeriod in some NTP tools - [Bug 857] ntpdate debug mode adjusts system clock when it shouldn't - [Bug 908] ntpdate crashes sometimes - [Bug 982] ntpdate(and ntptimeset) buffer overrun if HAVE_POLL_H isn't set (dup of 908) - [Bug 997] ntpdate buffer too small and unsafe - Under Windows check whether NTP port in use under same conditions as under other OSs. - Fixed some typos and indents (tabs/spaces). + ChangeLog@1.83, 2009-05-08 04:42:28-04:00, stenn@whimsy.udel.edu +1 -0 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.7, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +2 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.c@1.82, 2009-05-08 04:42:28-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - ChangeLog@1.35.2.3, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +1 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.h@1.82, 2009-05-08 04:42:29-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ports/winnt/include/config.h@1.47, 2008-02-20 12:13:24+01:00, martin@pc-martin4. +2 -0 - [Bug 909] Define int32_t for Windows (backport from ntp-dev) + ntpd/ntpd-opts.texi@1.81, 2009-05-08 04:42:30-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.6, 2008-02-19 11:08:55-05:00, burnicki@pogo.udel.edu +1 -0 - Fixed indentation. + ntpd/ntpd.1@1.80, 2009-05-08 04:42:30-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - ntpd/ntp_io.c@1.255, 2008-02-19 11:08:52-05:00, burnicki@pogo.udel.edu +1 -1 - Fixed indentation. + ntpd/ntpdsim-opts.c@1.82, 2009-05-08 04:42:31-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.5, 2008-02-18 09:30:34-05:00, burnicki@pogo.udel.edu +1 -0 - Use new get_free_recv_buffer_alloc(). + ntpd/ntpdsim-opts.h@1.82, 2009-05-08 04:42:32-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ports/winnt/ntpd/ntp_iocompletionport.c@1.24, 2008-02-18 09:30:31-05:00, burnicki@pogo.udel.edu +4 -4 - Use new get_free_recv_buffer_alloc(). + ntpd/ntpdsim-opts.texi@1.80, 2009-05-08 04:42:33-04:00, stenn@whimsy.udel.edu +1 -1 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.4, 2008-02-17 17:48:29+00:00, kardel@pogo.udel.edu +1 -0 - recvbuff.c: - Bug 1000: add some pico optimizations + ntpd/ntpdsim.1@1.80, 2009-05-08 04:42:34-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 - libntp/recvbuff.c@1.29, 2008-02-17 17:42:21+00:00, kardel@pogo.udel.edu +5 -8 - Bug 1000: add some pico optimizations + ntpdc/ntpdc-opts.c@1.82, 2009-05-08 04:42:35-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 -ChangeSet@1.1520.2.3, 2008-02-17 08:38:07+00:00, kardel@pogo.udel.edu +2 -0 - ntpd.c: - Bug 1000: avoid timer() starvation during high load conditions - ChangeLog: - Bug 1000: additionally fix timer() starvation during high load + ntpdc/ntpdc-opts.h@1.82, 2009-05-08 04:42:35-04:00, stenn@whimsy.udel.edu +3 -3 + NTP_4_2_4P7_RC6 - ChangeLog@1.35.2.2, 2008-02-17 08:37:20+00:00, kardel@pogo.udel.edu +1 -0 - Bug 1000: additionally fix timer() starvation during high load + ntpdc/ntpdc-opts.texi@1.80, 2009-05-08 04:42:36-04:00, stenn@whimsy.udel.edu +2 -2 + NTP_4_2_4P7_RC6 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 22:32:42 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E335C106566B; Sat, 12 Dec 2009 22:32:42 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B904C8FC14; Sat, 12 Dec 2009 22:32: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 nBCMWgRh065661; Sat, 12 Dec 2009 22:32:42 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCMWgaX065660; Sat, 12 Dec 2009 22:32:42 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912122232.nBCMWgaX065660@svn.freebsd.org> From: Ollivier Robert Date: Sat, 12 Dec 2009 22:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200452 - vendor/ntp/4.2.4p8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 22:32:43 -0000 Author: roberto Date: Sat Dec 12 22:32:42 2009 New Revision: 200452 URL: http://svn.freebsd.org/changeset/base/200452 Log: 4.2.4p8 is the new version from vendor code. Security: CVE-2009-3563 Added: vendor/ntp/4.2.4p8/ - copied from r200451, vendor/ntp/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 23:08:58 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4544106566C; Sat, 12 Dec 2009 23:08:58 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0708FC12; Sat, 12 Dec 2009 23:08: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 nBCN8wl7066576; Sat, 12 Dec 2009 23:08:58 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCN8wvF066575; Sat, 12 Dec 2009 23:08:58 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912122308.nBCN8wvF066575@svn.freebsd.org> From: Ollivier Robert Date: Sat, 12 Dec 2009 23:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200453 - vendor/ntp/dist/ntptrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 23:08:58 -0000 Author: roberto Date: Sat Dec 12 23:08:58 2009 New Revision: 200453 URL: http://svn.freebsd.org/changeset/base/200453 Log: ntptrace is being phased out completely. Deleted: vendor/ntp/dist/ntptrace/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 12 23:16:48 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50543106568B; Sat, 12 Dec 2009 23:16:48 +0000 (UTC) (envelope-from roberto@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25D708FC13; Sat, 12 Dec 2009 23:16: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 nBCNGmWn066805; Sat, 12 Dec 2009 23:16:48 GMT (envelope-from roberto@svn.freebsd.org) Received: (from roberto@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBCNGmdX066804; Sat, 12 Dec 2009 23:16:48 GMT (envelope-from roberto@svn.freebsd.org) Message-Id: <200912122316.nBCNGmdX066804@svn.freebsd.org> From: Ollivier Robert Date: Sat, 12 Dec 2009 23:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200454 - in vendor/ntp/4.2.4p8: . ntptrace X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2009 23:16:48 -0000 Author: roberto Date: Sat Dec 12 23:16:47 2009 New Revision: 200454 URL: http://svn.freebsd.org/changeset/base/200454 Log: Merge r200452 into tagged vendor code (remove empty ntptrace/) Deleted: vendor/ntp/4.2.4p8/ntptrace/ Modified: Directory Properties: vendor/ntp/4.2.4p8/ (props changed) vendor/ntp/4.2.4p8/FREEBSD-Xlist (props changed) vendor/ntp/4.2.4p8/FREEBSD-upgrade (props changed)