Date: Thu, 4 Mar 2004 12:03:59 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 48160 for review Message-ID: <200403042003.i24K3xlD018733@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=48160 Change 48160 by rwatson@rwatson_tislabs on 2004/03/04 12:03:38 Integrate netperf_socket branch: - ACPI hacks and fixes. - A variety of ATA fixes and fun. - LINT fixes. - USB vendor IDs - Style and comment fixes for accounting, fork, file descriptor, VM code. - IPv6 multicast code moves entirely into mld. Affected files ... .. //depot/projects/netperf_socket/sys/amd64/conf/NOTES.fixed#2 delete .. //depot/projects/netperf_socket/sys/contrib/dev/acpica/acfreebsd.h#3 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#4 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_cpu.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_ec.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/ata-chipset.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/atapi-cam.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ctau/ctau.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/usb/umass.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/usb/usbdevs#4 integrate .. //depot/projects/netperf_socket/sys/dev/usb/usbdevs.h#4 integrate .. //depot/projects/netperf_socket/sys/dev/usb/usbdevs_data.h#4 integrate .. //depot/projects/netperf_socket/sys/geom/concat/g_concat.c#4 integrate .. //depot/projects/netperf_socket/sys/geom/concat/g_concat.h#4 integrate .. //depot/projects/netperf_socket/sys/kern/kern_acct.c#3 integrate .. //depot/projects/netperf_socket/sys/kern/kern_fork.c#3 integrate .. //depot/projects/netperf_socket/sys/kern/kern_tc.c#3 integrate .. //depot/projects/netperf_socket/sys/netinet6/in6.c#4 integrate .. //depot/projects/netperf_socket/sys/netinet6/mld6.c#2 integrate .. //depot/projects/netperf_socket/sys/sys/filedesc.h#2 integrate .. //depot/projects/netperf_socket/sys/vm/vm_page.h#2 integrate .. //depot/projects/netperf_socket/sys/vm/vm_pageout.c#3 integrate .. //depot/projects/netperf_socket/sys/vm/vm_zeroidle.c#3 integrate Differences ... ==== //depot/projects/netperf_socket/sys/contrib/dev/acpica/acfreebsd.h#3 (text+ko) ==== @@ -119,10 +119,17 @@ /* * Some systems' ASL may have problems because they look for names - * of Microsoft operating systems. To override this, set hw.acpi.os_name - * to the appropriate string. + * of Microsoft operating systems. We default to "Microsoft Windows NT" + * (aka NT5 or Windows 2000) because it is most similar to our + * implementation and also most prevalent. + * + * To override this, set hw.acpi.os_name to the appropriate string. */ +#ifndef ACPICA_PEDANTIC +#define ACPI_OS_NAME "Microsoft Windows NT" +#else #define ACPI_OS_NAME "FreeBSD" +#endif /* FreeBSD uses GCC */ ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi.c#4 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.122 2004/03/03 18:34:42 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.123 2004/03/04 04:42:59 njl Exp $ */ #include "opt_acpi.h" @@ -262,6 +262,8 @@ /* Set up any quirks we have for this XSDT. */ acpi_quirks_set(); + if (acpi_disabled("acpi")) + return_VALUE (AE_ERROR); return_VALUE (AE_OK); } @@ -283,9 +285,6 @@ if (resource_disabled("acpi", 0)) return_VOID; - snprintf(acpi_ca_version, sizeof(acpi_ca_version), "0x%x", - ACPI_CA_VERSION); - /* Make sure we're not being doubly invoked. */ if (device_find_child(parent, "acpi", 0) != NULL) return_VOID; @@ -294,6 +293,8 @@ if (ACPI_FAILURE(acpi_Startup())) return_VOID; + snprintf(acpi_ca_version, sizeof(acpi_ca_version), "%#x", ACPI_CA_VERSION); + /* Attach the actual ACPI device. */ if ((child = BUS_ADD_CHILD(parent, 0, "acpi", 0)) == NULL) { device_printf(parent, "ACPI: could not attach\n"); @@ -583,10 +584,19 @@ char *env, *tmp; int len; - /* If the user specifies "noquirks", leave the settings alone. */ + /* + * If the user loaded a custom table or disabled "quirks", leave + * the settings alone. + */ len = 0; + if ((env = getenv("acpi_dsdt_load")) != NULL) { + /* XXX No strcasecmp but this is good enough. */ + if (*env == 'Y' || *env == 'y') + goto out; + freeenv(env); + } if ((env = getenv("debug.acpi.disabled")) != NULL) { - if (strstr("noquirks", env) != NULL) + if (strstr("quirks", env) != NULL) goto out; len = strlen(env); } ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_cpu.c#2 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.29 2003/12/28 22:15:24 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.30 2004/03/04 05:17:52 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -394,8 +394,12 @@ /* If _PTC not present or other failure, try the P_BLK. */ if (sc->cpu_p_cnt == NULL) { - /* The spec says P_BLK must be at least 6 bytes long. */ - if (sc->cpu_p_blk == 0 || sc->cpu_p_blk_len != 6) + /* + * The spec says P_BLK must be 6 bytes long. However, some + * systems use it to indicate a fractional set of features + * present so we take anything >= 4. + */ + if (sc->cpu_p_blk_len < 4) return (ENXIO); gas.Address = sc->cpu_p_blk; gas.AddressSpaceId = ACPI_ADR_SPACE_SYSTEM_IO; @@ -447,7 +451,14 @@ cx_ptr++; sc->cpu_cx_count++; - if (sc->cpu_p_blk_len != 6) + /* + * The spec says P_BLK must be 6 bytes long. However, some systems + * use it to indicate a fractional set of features present so we + * take 5 as C2. Some may also have a value of 7 to indicate + * another C3 but most use _CST for this (as required) and having + * "only" C1-C3 is not a hardship. + */ + if (sc->cpu_p_blk_len < 5) goto done; /* Validate and allocate resources for C2 (P_LVL2). */ @@ -465,6 +476,8 @@ sc->cpu_cx_count++; } } + if (sc->cpu_p_blk_len < 6) + goto done; /* Validate and allocate resources for C3 (P_LVL3). */ if (AcpiGbl_FADT->Plvl3Lat < 1000 && ==== //depot/projects/netperf_socket/sys/dev/acpica/acpi_ec.c#3 (text+ko) ==== @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.43 2004/03/03 18:34:42 njl Exp $ + * $FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.44 2004/03/04 05:58:50 njl Exp $ */ /****************************************************************************** * @@ -137,7 +137,7 @@ *****************************************************************************/ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.43 2004/03/03 18:34:42 njl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_ec.c,v 1.44 2004/03/04 05:58:50 njl Exp $"); #include "opt_acpi.h" #include <sys/param.h> @@ -713,28 +713,33 @@ ACPI_INTEGER *Value, void *Context, void *RegionContext) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; - ACPI_STATUS Status = AE_OK; + ACPI_STATUS Status; UINT8 EcAddr, EcData; int i; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address); - if (Address > 0xFF || width % 8 != 0 || Value == NULL || Context == NULL) + if (width % 8 != 0 || Value == NULL || Context == NULL) return_ACPI_STATUS (AE_BAD_PARAMETER); + if (Address + (width / 8) - 1 > 0xFF) + return_ACPI_STATUS (AE_BAD_ADDRESS); - /* - * Perform the transaction. - */ + if (Function == ACPI_READ) + *Value = 0; EcAddr = Address; - for (i = 0; i < width; i += 8) { + Status = AE_ERROR; + + /* Perform the transaction(s), based on width. */ + for (i = 0; i < width; i += 8, EcAddr++) { Status = EcLock(sc); if (ACPI_FAILURE(Status)) - return (Status); + break; switch (Function) { case ACPI_READ: - EcData = 0; Status = EcRead(sc, EcAddr, &EcData); + if (ACPI_SUCCESS(Status)) + *Value |= ((ACPI_INTEGER)EcData) << i; break; case ACPI_WRITE: EcData = (UINT8)((*Value) >> i); @@ -746,15 +751,11 @@ Status = AE_BAD_PARAMETER; break; } - EcUnlock(sc); if (ACPI_FAILURE(Status)) - return (Status); + break; + } - *Value |= (ACPI_INTEGER)EcData << i; - if (++EcAddr == 0) - return_ACPI_STATUS (AE_BAD_PARAMETER); - } return_ACPI_STATUS (Status); } ==== //depot/projects/netperf_socket/sys/dev/ata/ata-chipset.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.62 2004/02/25 09:55:49 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.63 2004/03/04 16:39:59 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -1714,14 +1714,15 @@ ch->r_io[ATA_BMDEVSPEC_1].offset = 0x100 + (unit01 << 7) + (unit10 << 9); ch->r_io[ATA_IDX_ADDR].res = ctlr->r_io2; - if (ctlr->chip->max_dma >= ATA_SA150) + if (ctlr->chip->max_dma >= ATA_SA150) { ch->flags |= ATA_NO_SLAVE; + ch->reset = ata_sii_reset; + } ctlr->dmainit(ch); if (ctlr->chip->cfg2 & SIIBUG) ch->dma->boundary = 8 * 1024; - ch->reset = ata_sii_reset; return 0; } ==== //depot/projects/netperf_socket/sys/dev/ata/atapi-cam.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.33 2004/02/11 10:14:08 thomas Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cam.c,v 1.34 2004/03/04 15:37:39 thomas Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -556,7 +556,7 @@ csio = &hcb->ccb->csio; #ifdef CAMDEBUG -# define err (request->error) +# define err (request->u.atapi.sense_key) if (CAM_DEBUGGED(csio->ccb_h.path, CAM_DEBUG_CDB)) { printf("atapi_cb: hcb@%p error = %02x: (sk = %02x%s%s%s)\n", hcb, err, err >> 4, @@ -579,6 +579,7 @@ csio->scsi_status = SCSI_STATUS_CHECK_COND; if ((csio->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0) { +#if 0 static const int8_t ccb[16] = { ATAPI_REQUEST_SENSE, 0, 0, 0, sizeof(struct atapi_sense), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -595,6 +596,14 @@ mtx_unlock (&Giant); ata_queue_request(request); return; +#else + /* The ATA driver has already requested sense for us. */ + if (request->error == 0) { + /* The ATA autosense suceeded. */ + bcopy (&request->u.atapi.sense_data, &csio->sense_data, sizeof(struct atapi_sense)); + csio->ccb_h.status |= CAM_AUTOSNS_VALID; + } +#endif } } else { rc = CAM_REQ_CMP; ==== //depot/projects/netperf_socket/sys/dev/ctau/ctau.c#2 (text+ko) ==== @@ -17,7 +17,7 @@ * Cronyx Id: ctau.c,v 1.1.2.4 2003/12/11 17:33:43 rik Exp $ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ctau/ctau.c,v 1.1 2004/02/23 20:19:00 rik Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ctau/ctau.c,v 1.2 2004/03/04 14:16:12 bms Exp $"); #include <dev/cx/machdep.h> #include <dev/ctau/ctddk.h> @@ -151,7 +151,7 @@ outb (bcr1_port, bcr1); \ dclk_tick (b); } -#define DEBUG(x) /*trace_str x*/ +#define CTAU_DEBUG(x) /*trace_str x*/ int ct_download2 (port_t port, const unsigned char *fwaddr) { @@ -177,7 +177,7 @@ for (val=0; val<2*3; ++val) nconfig_clr(port); if (nstatus(port)) { - DEBUG (("Bad nstatus, downloading aborted (bsr3=0x%x).\n", inb(BSR3(port)))); + CTAU_DEBUG (("Bad nstatus, downloading aborted (bsr3=0x%x).\n", inb(BSR3(port)))); nconfig_set(port); return 0; } @@ -199,7 +199,7 @@ val = unpack_getchar (&t); if (nstatus(port) == 0) { - DEBUG (("Bad nstatus, %d bytes remaining.\n", bytes)); + CTAU_DEBUG (("Bad nstatus, %d bytes remaining.\n", bytes)); goto failed; } @@ -209,13 +209,13 @@ dclk_tick (port); if (nstatus(port) == 0) { - DEBUG (("Bad nstatus after confdone, %d bytes remaining (%d).\n", + CTAU_DEBUG (("Bad nstatus after confdone, %d bytes remaining (%d).\n", bytes, t.ptr - fwaddr)); goto failed; } /* Succeeded. */ - /*DEBUG (("Download succeeded.\n"));*/ + /*CTAU_DEBUG (("Download succeeded.\n"));*/ return 1; } @@ -231,9 +231,9 @@ /* if ((bytes & 1023) == 0) putch ('.'); */ } - DEBUG (("Bad confdone.\n")); + CTAU_DEBUG (("Bad confdone.\n")); failed: - DEBUG (("Downloading aborted.\n")); + CTAU_DEBUG (("Downloading aborted.\n")); return 0; } ==== //depot/projects/netperf_socket/sys/dev/usb/umass.c#3 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/usb/umass.c,v 1.103 2004/02/06 14:38:14 sanpei Exp $ + * $FreeBSD: src/sys/dev/usb/umass.c,v 1.104 2004/03/04 07:20:48 sanpei Exp $ * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ */ @@ -381,6 +381,10 @@ UMASS_PROTO_SCSI | UMASS_PROTO_BBB, WRONG_CSWSIG }, + { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_UCF100, RID_WILDCARD, + UMASS_PROTO_ATAPI | UMASS_PROTO_BBB, + NO_INQUIRY | NO_GETMAXLUN + }, { USB_VENDOR_PANASONIC, USB_PRODUCT_PANASONIC_KXLCB20AN, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_QUIRKS ==== //depot/projects/netperf_socket/sys/dev/usb/usbdevs#4 (text+ko) ==== @@ -1,4 +1,4 @@ -$FreeBSD: src/sys/dev/usb/usbdevs,v 1.164 2004/03/02 19:01:30 peter Exp $ +$FreeBSD: src/sys/dev/usb/usbdevs,v 1.165 2004/03/04 07:20:48 sanpei Exp $ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -272,6 +272,7 @@ vendor MICROTECH 0x07af Microtech vendor GENERALINSTMNTS 0x07b2 General Instruments (Motorola) vendor OLYMPUS 0x07b4 Olympus +vendor ONSPEC 0x07c4 OnSpec Electronic vendor ABOCOM 0x07b8 AboCom Systems vendor KEISOKUGIKEN 0x07c1 Keisokugiken vendor APG 0x07c5 APG Cash Drawer @@ -1015,6 +1016,9 @@ product OMNIVISION OV511 0x0511 OV511 Camera product OMNIVISION OV511PLUS 0xa511 OV511+ Camera +/* OnSpec Electronic, Inc. */ +product ONSPEC UCF100 0xa400 FlashLink UCF-100 CompactFlash Reader + /* Palm Computing, Inc. product */ product PALM SERIAL 0x0080 USB Serial Adaptor product PALM M500 0x0001 Palm m500 ==== //depot/projects/netperf_socket/sys/dev/usb/usbdevs.h#4 (text+ko) ==== @@ -1,10 +1,10 @@ -/* $FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.171 2004/03/02 19:01:56 peter Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usbdevs.h,v 1.172 2004/03/04 07:22:30 sanpei Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/usb/usbdevs,v 1.164 2004/03/02 19:01:30 peter Exp + * FreeBSD: src/sys/dev/usb/usbdevs,v 1.165 2004/03/04 07:20:48 sanpei Exp */ /* @@ -279,6 +279,7 @@ #define USB_VENDOR_MICROTECH 0x07af /* Microtech */ #define USB_VENDOR_GENERALINSTMNTS 0x07b2 /* General Instruments (Motorola) */ #define USB_VENDOR_OLYMPUS 0x07b4 /* Olympus */ +#define USB_VENDOR_ONSPEC 0x07c4 /* OnSpec Electronic */ #define USB_VENDOR_ABOCOM 0x07b8 /* AboCom Systems */ #define USB_VENDOR_KEISOKUGIKEN 0x07c1 /* Keisokugiken */ #define USB_VENDOR_APG 0x07c5 /* APG Cash Drawer */ @@ -1022,6 +1023,9 @@ #define USB_PRODUCT_OMNIVISION_OV511 0x0511 /* OV511 Camera */ #define USB_PRODUCT_OMNIVISION_OV511PLUS 0xa511 /* OV511+ Camera */ +/* OnSpec Electronic, Inc. */ +#define USB_PRODUCT_ONSPEC_UCF100 0xa400 /* FlashLink UCF-100 CompactFlash Reader */ + /* Palm Computing, Inc. product */ #define USB_PRODUCT_PALM_SERIAL 0x0080 /* USB Serial Adaptor */ #define USB_PRODUCT_PALM_M500 0x0001 /* Palm m500 */ ==== //depot/projects/netperf_socket/sys/dev/usb/usbdevs_data.h#4 (text+ko) ==== @@ -1,10 +1,10 @@ -/* $FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.171 2004/03/02 19:01:56 peter Exp $ */ +/* $FreeBSD: src/sys/dev/usb/usbdevs_data.h,v 1.172 2004/03/04 07:22:30 sanpei Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * FreeBSD: src/sys/dev/usb/usbdevs,v 1.164 2004/03/02 19:01:30 peter Exp + * FreeBSD: src/sys/dev/usb/usbdevs,v 1.165 2004/03/04 07:20:48 sanpei Exp */ /* @@ -2332,6 +2332,12 @@ "OV511+ Camera", }, { + USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_UCF100, + 0, + "OnSpec Electronic", + "FlashLink UCF-100 CompactFlash Reader", + }, + { USB_VENDOR_PALM, USB_PRODUCT_PALM_SERIAL, 0, "Palm Computing", @@ -4546,6 +4552,12 @@ NULL, }, { + USB_VENDOR_ONSPEC, 0, + USB_KNOWNDEV_NOPROD, + "OnSpec Electronic", + NULL, + }, + { USB_VENDOR_ABOCOM, 0, USB_KNOWNDEV_NOPROD, "AboCom Systems", ==== //depot/projects/netperf_socket/sys/geom/concat/g_concat.c#4 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Pawel Jakub Dawidek <pjd@FreeBSD.org> + * Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/concat/g_concat.c,v 1.4 2004/03/03 22:29:24 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/concat/g_concat.c,v 1.5 2004/03/04 10:22:42 pjd Exp $"); #include <sys/param.h> #include <sys/systm.h> ==== //depot/projects/netperf_socket/sys/geom/concat/g_concat.h#4 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Pawel Jakub Dawidek <pjd@FreeBSD.org> + * Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/concat/g_concat.h,v 1.4 2004/03/03 22:29:24 pjd Exp $ + * $FreeBSD: src/sys/geom/concat/g_concat.h,v 1.5 2004/03/04 10:22:42 pjd Exp $ */ #ifndef _G_CONCAT_H_ ==== //depot/projects/netperf_socket/sys/kern/kern_acct.c#3 (text+ko) ==== @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_acct.c,v 1.69 2004/02/04 21:52:55 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_acct.c,v 1.70 2004/03/04 09:47:09 bde Exp $"); #include "opt_mac.h" @@ -137,6 +137,7 @@ return (error); mtx_lock(&Giant); + /* * If accounting is to be started to a file, open that file for * appending and make sure it's a 'normal'. @@ -169,16 +170,14 @@ #endif } + mtx_lock(&acct_mtx); + /* * If accounting was previously enabled, kill the old space-watcher, * close the file, and (if no new file was specified, leave). - */ - - /* - * XXX arr: Should not hold lock over vnode operation. + * + * XXX arr: should not hold lock over vnode operation. */ - - mtx_lock(&acct_mtx); if (acctp != NULLVP || savacctp != NULLVP) { callout_stop(&acctwatch_callout); error = vn_close((acctp != NULLVP ? acctp : savacctp), @@ -205,6 +204,7 @@ mtx_unlock(&acct_mtx); log(LOG_NOTICE, "Accounting enabled\n"); acctwatch(NULL); + done2: mtx_unlock(&Giant); return (error); @@ -216,19 +216,18 @@ * and are enumerated below. (They're also noted in the system * "acct.h" header file.) */ - int acct_process(td) struct thread *td; { - struct proc *p = td->td_proc; struct acct acct; + struct timeval ut, st, tmp; + struct plimit *newlim, *oldlim; + struct proc *p; struct rusage *r; - struct timeval ut, st, tmp; + struct ucred *uc; + struct vnode *vp; int t, ret; - struct vnode *vp; - struct ucred *uc; - struct plimit *newlim, *oldlim; mtx_lock(&acct_mtx); @@ -239,6 +238,8 @@ return (0); } + p = td->td_proc; + /* * Get process accounting information. */ @@ -292,7 +293,7 @@ PROC_UNLOCK(p); /* - * Write the accounting information to the file. + * Finish doing things that require acct_mtx, and release acct_mtx. */ uc = crhold(acctcred); vref(vp); @@ -310,6 +311,9 @@ PROC_UNLOCK(p); lim_free(oldlim); + /* + * Write the accounting information to the file. + */ VOP_LEASE(vp, td, uc, LEASE_WRITE); ret = vn_rdwr(UIO_WRITE, vp, (caddr_t)&acct, sizeof (acct), (off_t)0, UIO_SYSSPACE, IO_APPEND|IO_UNIT, uc, NOCRED, @@ -374,10 +378,9 @@ mtx_lock(&acct_mtx); /* - * XXX arr: Need to fix the issue of holding acct_mtx over + * XXX arr: need to fix the issue of holding acct_mtx over * the below vnode operations. */ - if (savacctp != NULLVP) { if (savacctp->v_type == VBAD) { (void) vn_close(savacctp, savacctflags, savacctcred, ==== //depot/projects/netperf_socket/sys/kern/kern_fork.c#3 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.215 2004/02/26 00:27:02 truckman Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.216 2004/03/04 09:56:29 bde Exp $"); #include "opt_ktrace.h" #include "opt_mac.h" @@ -134,12 +134,13 @@ struct thread *td; struct rfork_args *uap; { + struct proc *p2; int error; - struct proc *p2; - /* Don't allow kernel only flags. */ + /* Don't allow kernel-only flags. */ if ((uap->flags & RFKERNELONLY) != 0) return (EINVAL); + error = fork1(td, uap->flags, 0, &p2); if (error == 0) { td->td_retval[0] = p2 ? p2->p_pid : 0; @@ -236,7 +237,7 @@ } /* - * Unshare file descriptors (from parent.) + * Unshare file descriptors (from parent). */ if (flags & RFFDG) { FILEDESC_LOCK(p1->p_fd); @@ -271,7 +272,7 @@ */ PROC_LOCK(p1); if (thread_single(SINGLE_NO_EXIT)) { - /* Abort.. someone else is single threading before us */ + /* Abort. Someone else is single threading before us. */ PROC_UNLOCK(p1); mtx_unlock(&Giant); return (ERESTART); @@ -458,7 +459,7 @@ kg2 = FIRST_KSEGRP_IN_PROC(p2); ke2 = FIRST_KSE_IN_KSEGRP(kg2); - /* Allocate and switch to an alternate kstack if specified */ + /* Allocate and switch to an alternate kstack if specified. */ if (pages != 0) vm_thread_new_altkstack(td2, pages); @@ -532,16 +533,16 @@ p2->p_fdtol = fdtol; /* - * p_limit is copy-on-write, bump refcnt, + * p_limit is copy-on-write. Bump its refcount. */ p2->p_limit = lim_hold(p1->p_limit); PROC_UNLOCK(p1); PROC_UNLOCK(p2); /* - * Setup linkage for kernel based threading + * Set up linkage for kernel based threading. */ - if((flags & RFTHREAD) != 0) { + if ((flags & RFTHREAD) != 0) { mtx_lock(&ppeers_lock); p2->p_peers = p1->p_peers; p1->p_peers = p2; @@ -723,7 +724,7 @@ PROC_UNLOCK(p2); /* - * If other threads are waiting, let them continue now + * If other threads are waiting, let them continue now. */ if (p1->p_flag & P_SA) { PROC_LOCK(p1); ==== //depot/projects/netperf_socket/sys/kern/kern_tc.c#3 (text+ko) ==== @@ -8,7 +8,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.160 2004/01/22 19:50:06 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_tc.c,v 1.161 2004/03/04 14:14:23 phk Exp $"); #include "opt_ntp.h" @@ -670,10 +670,6 @@ return; } - /* Return if nothing really happened. */ - if (*pcount == pps->capcount) - return; - /* Convert the count to a timespec. */ tcount = pps->capcount - pps->capth->th_offset_count; tcount &= pps->capth->th_counter->tc_counter_mask; ==== //depot/projects/netperf_socket/sys/netinet6/in6.c#4 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/in6.c,v 1.44 2004/03/03 14:33:16 ume Exp $ */ +/* $FreeBSD: src/sys/netinet6/in6.c,v 1.46 2004/03/04 15:07:42 ume Exp $ */ /* $KAME: in6.c,v 1.259 2002/01/21 11:37:50 keiichi Exp $ */ /* @@ -1563,94 +1563,6 @@ } /* - * Add an address to the list of IP6 multicast addresses for a - * given interface. - */ -struct in6_multi * -in6_addmulti(maddr6, ifp, errorp) - struct in6_addr *maddr6; - struct ifnet *ifp; - int *errorp; -{ - struct in6_multi *in6m; - struct sockaddr_in6 sin6; - struct ifmultiaddr *ifma; - int s = splnet(); - - *errorp = 0; - - /* - * Call generic routine to add membership or increment - * refcount. It wants addresses in the form of a sockaddr, - * so we build one here (being careful to zero the unused bytes). - */ - bzero(&sin6, sizeof sin6); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof sin6; - sin6.sin6_addr = *maddr6; - *errorp = if_addmulti(ifp, (struct sockaddr *)&sin6, &ifma); - if (*errorp) { - splx(s); - return 0; - } - - /* - * If ifma->ifma_protospec is null, then if_addmulti() created - * a new record. Otherwise, we are done. - */ - if (ifma->ifma_protospec != 0) - return ifma->ifma_protospec; - - /* XXX - if_addmulti uses M_WAITOK. Can this really be called - at interrupt time? If so, need to fix if_addmulti. XXX */ - in6m = (struct in6_multi *)malloc(sizeof(*in6m), M_IPMADDR, M_NOWAIT); - if (in6m == NULL) { - splx(s); - return (NULL); - } - - bzero(in6m, sizeof *in6m); - in6m->in6m_addr = *maddr6; - in6m->in6m_ifp = ifp; - in6m->in6m_ifma = ifma; - ifma->ifma_protospec = in6m; - LIST_INSERT_HEAD(&in6_multihead, in6m, in6m_entry); - - /* - * Let MLD6 know that we have joined a new IPv6 multicast - * group. - */ - mld6_start_listening(in6m); - splx(s); - return (in6m); -} - -/* - * Delete a multicast address record. - */ -void -in6_delmulti(in6m) - struct in6_multi *in6m; -{ - struct ifmultiaddr *ifma = in6m->in6m_ifma; - int s = splnet(); - - if (ifma->ifma_refcount == 1) { - /* - * No remaining claims to this record; let MLD6 know - * that we are leaving the multicast group. - */ - mld6_stop_listening(in6m); - ifma->ifma_protospec = 0; - LIST_REMOVE(in6m, in6m_entry); - free(in6m, M_IPMADDR); - } - /* XXX - should be separate API for when we have an ifma? */ - if_delmulti(ifma->ifma_ifp, ifma->ifma_addr); - splx(s); -} - -/* * Find an IPv6 interface link-local address specific to an interface. */ struct in6_ifaddr * ==== //depot/projects/netperf_socket/sys/netinet6/mld6.c#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/mld6.c,v 1.15 2003/10/31 16:07:15 ume Exp $ */ +/* $FreeBSD: src/sys/netinet6/mld6.c,v 1.16 2004/03/04 15:07:42 ume Exp $ */ /* $KAME: mld6.c,v 1.27 2001/04/04 05:17:30 itojun Exp $ */ /* @@ -78,6 +78,7 @@ #include <sys/socket.h> #include <sys/protosw.h> #include <sys/syslog.h> +#include <sys/malloc.h> #include <net/if.h> @@ -475,3 +476,95 @@ } } } + +/* + * Add an address to the list of IP6 multicast addresses for a given interface. + * Add source addresses to the list also, if upstream router is MLDv2 capable + * and the number of source is not 0. + */ +struct in6_multi * +in6_addmulti(maddr6, ifp, errorp) + struct in6_addr *maddr6; + struct ifnet *ifp; + int *errorp; +{ + struct in6_multi *in6m; + struct ifmultiaddr *ifma; + struct sockaddr_in6 sa6; + int s = splnet(); + + *errorp = 0; + + /* + * Call generic routine to add membership or increment + * refcount. It wants addresses in the form of a sockaddr, + * so we build one here (being careful to zero the unused bytes). + */ + bzero(&sa6, sizeof(sa6)); + sa6.sin6_family = AF_INET6; + sa6.sin6_len = sizeof(struct sockaddr_in6); + sa6.sin6_addr = *maddr6; + *errorp = if_addmulti(ifp, (struct sockaddr *)&sa6, &ifma); + if (*errorp) { + splx(s); + return 0; + } + + /* + * If ifma->ifma_protospec is null, then if_addmulti() created + * a new record. Otherwise, we are done. + */ + if (ifma->ifma_protospec != 0) { + splx(s); + return ifma->ifma_protospec; + } + + /* XXX - if_addmulti uses M_WAITOK. Can this really be called + at interrupt time? If so, need to fix if_addmulti. XXX */ + in6m = (struct in6_multi *)malloc(sizeof(*in6m), M_IPMADDR, M_NOWAIT); + if (in6m == NULL) { + splx(s); + return (NULL); + } + + bzero(in6m, sizeof *in6m); + in6m->in6m_addr = *maddr6; + in6m->in6m_ifp = ifp; + in6m->in6m_refcount = 1; + in6m->in6m_ifma = ifma; + ifma->ifma_protospec = in6m; + LIST_INSERT_HEAD(&in6_multihead, in6m, in6m_entry); + + /* + * Let MLD6 know that we have joined a new IPv6 multicast + * group. + */ + mld6_start_listening(in6m); + splx(s); + return (in6m); +} + +/* + * Delete a multicast address record. + */ +void +in6_delmulti(in6m) + struct in6_multi *in6m; +{ + struct ifmultiaddr *ifma = in6m->in6m_ifma; + int s = splnet(); + + if (ifma->ifma_refcount == 1) { + /* + * No remaining claims to this record; let MLD6 know + * that we are leaving the multicast group. + */ + mld6_stop_listening(in6m); + ifma->ifma_protospec = 0; + LIST_REMOVE(in6m, in6m_entry); + free(in6m, M_IPMADDR); + } + /* XXX - should be separate API for when we have an ifma? */ + if_delmulti(ifma->ifma_ifp, ifma->ifma_addr); + splx(s); +} >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403042003.i24K3xlD018733>