From owner-svn-src-head@FreeBSD.ORG Sun Dec 6 00:10:13 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 01:10:31 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 01:27:28 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 01:29:49 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 08:59:21 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 11:48:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 11:53:13 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 12:37:20 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 13:54:41 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 14:04:17 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 14:20:31 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 14:22:14 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 17:26:44 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 18:04:27 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 20:30:22 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 20:59:05 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:05:18 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:27:25 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:31:24 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:43:25 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:48:39 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:51:28 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:55:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Dec 6 23:56:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Dec 7 00:22:11 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 00:54:02 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 02:17:59 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 04:31:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD38D1065670 for ; Mon, 7 Dec 2009 04:31:22 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mx1.freebsd.org (Postfix) with ESMTP id 717958FC0C 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=mrbap2) with ESMTP (Nemesis) id 0MM06e-1N9pDA2COi-007vC3; 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: V01U2FsdGVkX1+WBYGTETp32gZGDnDLyDxaj5eODtP8q1HBNpP H19Kk1oWkFz+FEJ5xDeaWqvm0yED/6SG07S4eKtRvZvGzMYQWi Gy4B1qFbZvAdXDOnSimLA== 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 04:31:22 -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-head@FreeBSD.ORG Mon Dec 7 05:11:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 05:57:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 05:57:53 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 06:37:12 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vova@fbsd.ru List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 06:41:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 09:07:38 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 09:41:13 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 10:45:26 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 10:55:16 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 10:56:19 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 11:10:19 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 11:27:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:09:48 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:14:38 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:19:33 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:28:06 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:36:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:40:00 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:44:10 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:46:18 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:55:00 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 12:56:14 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 13:11:46 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 13:22:58 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 14:33:39 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 14:46:34 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 14:56:10 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 15:15:09 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 15:29:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 16:00:59 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 16:10:49 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 16:23:27 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 16:29:43 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 17:42:44 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 18:03:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A28C1065692 for ; Mon, 7 Dec 2009 18:03:40 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outD.internet-mail-service.net (outd.internet-mail-service.net [216.240.47.227]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2F28FC1D 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 18:19:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B971065692 for ; Mon, 7 Dec 2009 18:19:12 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outQ.internet-mail-service.net (outq.internet-mail-service.net [216.240.47.240]) by mx1.freebsd.org (Postfix) with ESMTP id 406D38FC1C 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 18:37:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 19:18:23 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 19:26:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 19:29:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74D321065692 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.187]) by mx1.freebsd.org (Postfix) with ESMTP id 058168FC21 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 0MBo9r-1NPjML3FCR-00AaTc; 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: V01U2FsdGVkX1/aL0yTZnlodF2YQGm7ahq8GDR93L/v7DNCwUw 0JbxeLMOBaAqE5U+2spNG28ZoAo1bbuRjaCmJTu0c2gZthd7xD ymlTtt9NrrZ//MUerdIFA== 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 20:05:02 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 20:11:53 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 20:17:34 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 20:21:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 20:30:10 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 20:56:43 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 21:00:37 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 21:15:55 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 21:24:07 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 21:30:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 21:42:33 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Dec 7 21:45:32 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Dec 8 00:44:24 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 00:52:59 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 00:54:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 01:07:45 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 03:24:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 05:35:52 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 12:10:06 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 13:04:27 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 13:06:36 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 13:36:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 14:36:32 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 14:55:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 17:54:24 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 18:54:37 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 19:12:38 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 20:18:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 20:32:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C1F106568B 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 5D7A58FC15 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 72C99D01FE 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 20:46:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 20:47:10 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 20:48:06 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 20:53:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33FD910656D7 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 89A418FC25 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 21:42:05 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 21:45:57 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 22:10:30 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 22:38:43 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 22:43:30 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 22:43:40 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Dec 8 23:43:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Dec 9 08:09:25 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 11:00:00 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 13:10:10 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 13:54:33 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 14:21:22 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 17:41:47 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 17:42:14 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 17:47:01 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 17:48:05 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 17:49:44 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 17:49:45 -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-head@FreeBSD.ORG Wed Dec 9 19:46:57 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:05:38 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:15:05 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:17:22 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:24:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:27:07 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:28:33 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 20:36:56 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 21:09:32 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 21:18:56 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 21:39:43 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 21:52:53 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Dec 9 22:03:57 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Dec 10 00:16:12 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 00:24:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 01:01:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 02:51:41 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 03:09:35 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 06:42:28 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 07:48:48 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 09:26:56 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 10:34:30 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 13:59:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 14:41:47 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 14:54:29 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 15:17:35 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 16:47:49 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 16:55:16 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 17:34:32 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 18:34:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 18:37:14 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 21:16:17 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 21:18:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 21:21:25 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Dec 10 22:25:53 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Dec 11 00:38:14 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 00:57:30 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 01:06:04 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 02:09:46 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 02:44:15 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 02:52:14 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 03:08:07 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 07:53:44 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 10:35:58 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 11:57:15 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 12:36:59 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 12:52:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 13:05:09 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 13:14:15 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 13:20:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 13:31:03 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syrinx@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-head@FreeBSD.ORG Fri Dec 11 14:15:55 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 16:32:59 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 18:20:13 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 19:36:10 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:03:36 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:20:02 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:23:57 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:30:23 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:35:40 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:50:53 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Dec 11 23:52:42 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Dec 12 00:06:44 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 00:11:40 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 00:24:31 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 01:34:37 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 02:19:42 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 05:39:17 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 05:39:18 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 05:46:29 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 930D91065670 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 21E798FC17 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 09:24:27 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FFD7106568D 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 A5F928FC25 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 09:35:59 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FF71065693 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 60B938FC1A 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 09:41:43 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 09:51:19 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 09:53:11 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B3C1065672 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 84C038FC1B 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 11:02:54 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 12:35:01 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 15:49:28 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 17:04:37 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 17:48:49 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 18:04:50 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 18:08:05 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 18:18:46 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 19:35:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 398AC1065672 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 73B338FC16 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 19:46:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 269CC1065679 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 A8E918FC0A 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 19:56:05 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 20:11:31 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 21:31:08 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 21:51:51 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 21:59:31 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Dec 12 22:08:38 2009 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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