From owner-svn-src-stable-8@FreeBSD.ORG Mon Sep 26 07:38:02 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F0AF106566B; Mon, 26 Sep 2011 07:38:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D5C08FC0C; Mon, 26 Sep 2011 07:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8Q7c2Jj061597; Mon, 26 Sep 2011 07:38:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8Q7c2Qx061589; Mon, 26 Sep 2011 07:38:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109260738.p8Q7c2Qx061589@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 26 Sep 2011 07:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225759 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 07:38:02 -0000 Author: hselasky Date: Mon Sep 26 07:38:01 2011 New Revision: 225759 URL: http://svn.freebsd.org/changeset/base/225759 Log: MFC r225659: Implement missing USB debug information functions. Modified: stable/8/lib/libusb/Makefile stable/8/lib/libusb/libusb.3 stable/8/lib/libusb/libusb.h stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb20.3 stable/8/lib/libusb/libusb20.c stable/8/lib/libusb/libusb20.h Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/Makefile ============================================================================== --- stable/8/lib/libusb/Makefile Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/Makefile Mon Sep 26 07:38:01 2011 (r225759) @@ -38,6 +38,7 @@ CFLAGS+= -DCOMPAT_32BIT MLINKS += libusb.3 libusb_init.3 MLINKS += libusb.3 libusb_exit.3 MLINKS += libusb.3 libusb_strerror.3 +MLINKS += libusb.3 libusb_error_name.3 MLINKS += libusb.3 libusb_set_debug.3 MLINKS += libusb.3 libusb_get_device_list.3 MLINKS += libusb.3 libusb_free_device_list.3 @@ -208,3 +209,5 @@ MLINKS += libusb20.3 libusb20_me_get_2.3 MLINKS += libusb20.3 libusb20_me_encode.3 MLINKS += libusb20.3 libusb20_me_decode.3 MLINKS += libusb20.3 libusb20_desc_foreach.3 +MLINKS += libusb20.3 libusb20_strerror.3 +MLINKS += libusb20.3 libusb20_error_name.3 Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb.3 Mon Sep 26 07:38:01 2011 (r225759) @@ -63,6 +63,14 @@ Other libusb routines may not be called Get the ASCII representation of the error given by the .Fa code argument. +This function does not return NULL. +.Pp +.Ft const char * +.Fn libusb_error_name "int code" +Get the ASCII representation of the error enum given by the +.Fa code +argument. +This function does not return NULL. .Pp .Ft void .Fn libusb_set_debug "libusb_context *ctx" "int level" @@ -502,7 +510,8 @@ The library is also compliant with LibUS .Sh SEE ALSO .Xr libusb20 3 , .Xr usb 4 , -.Xr usbconfig 8 +.Xr usbconfig 8 , +.Xr usbdump 8 .Pp .Pa http://libusb.sourceforge.net/ .Sh HISTORY Modified: stable/8/lib/libusb/libusb.h ============================================================================== --- stable/8/lib/libusb/libusb.h Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb.h Mon Sep 26 07:38:01 2011 (r225759) @@ -303,6 +303,7 @@ typedef struct libusb_transfer { void libusb_set_debug(libusb_context * ctx, int level); const char *libusb_strerror(int code); +const char *libusb_error_name(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb10.c Mon Sep 26 07:38:01 2011 (r225759) @@ -1449,6 +1449,73 @@ libusb_le16_to_cpu(uint16_t x) const char * libusb_strerror(int code) { - /* TODO */ - return ("Unknown error"); + switch (code) { + case LIBUSB_SUCCESS: + return ("Success"); + case LIBUSB_ERROR_IO: + return ("I/O error"); + case LIBUSB_ERROR_INVALID_PARAM: + return ("Invalid parameter"); + case LIBUSB_ERROR_ACCESS: + return ("Permissions error"); + case LIBUSB_ERROR_NO_DEVICE: + return ("No device"); + case LIBUSB_ERROR_NOT_FOUND: + return ("Not found"); + case LIBUSB_ERROR_BUSY: + return ("Device busy"); + case LIBUSB_ERROR_TIMEOUT: + return ("Timeout"); + case LIBUSB_ERROR_OVERFLOW: + return ("Overflow"); + case LIBUSB_ERROR_PIPE: + return ("Pipe error"); + case LIBUSB_ERROR_INTERRUPTED: + return ("Interrupted"); + case LIBUSB_ERROR_NO_MEM: + return ("Out of memory"); + case LIBUSB_ERROR_NOT_SUPPORTED: + return ("Not supported"); + case LIBUSB_ERROR_OTHER: + return ("Other error"); + default: + return ("Unknown error"); + } +} + +const char * +libusb_error_name(int code) +{ + switch (code) { + case LIBUSB_SUCCESS: + return ("LIBUSB_SUCCESS"); + case LIBUSB_ERROR_IO: + return ("LIBUSB_ERROR_IO"); + case LIBUSB_ERROR_INVALID_PARAM: + return ("LIBUSB_ERROR_INVALID_PARAM"); + case LIBUSB_ERROR_ACCESS: + return ("LIBUSB_ERROR_ACCESS"); + case LIBUSB_ERROR_NO_DEVICE: + return ("LIBUSB_ERROR_NO_DEVICE"); + case LIBUSB_ERROR_NOT_FOUND: + return ("LIBUSB_ERROR_NOT_FOUND"); + case LIBUSB_ERROR_BUSY: + return ("LIBUSB_ERROR_BUSY"); + case LIBUSB_ERROR_TIMEOUT: + return ("LIBUSB_ERROR_TIMEOUT"); + case LIBUSB_ERROR_OVERFLOW: + return ("LIBUSB_ERROR_OVERFLOW"); + case LIBUSB_ERROR_PIPE: + return ("LIBUSB_ERROR_PIPE"); + case LIBUSB_ERROR_INTERRUPTED: + return ("LIBUSB_ERROR_INTERRUPTED"); + case LIBUSB_ERROR_NO_MEM: + return ("LIBUSB_ERROR_NO_MEM"); + case LIBUSB_ERROR_NOT_SUPPORTED: + return ("LIBUSB_ERROR_NOT_SUPPORTED"); + case LIBUSB_ERROR_OTHER: + return ("LIBUSB_ERROR_OTHER"); + default: + return ("LIBUSB_ERROR_UNKNOWN"); + } } Modified: stable/8/lib/libusb/libusb20.3 ============================================================================== --- stable/8/lib/libusb/libusb20.3 Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb20.3 Mon Sep 26 07:38:01 2011 (r225759) @@ -212,6 +212,10 @@ USB access library (libusb -lusb) .Fn libusb20_me_decode "const void *pdata" "uint16_t len" "void *pdecoded" .Ft "const uint8_t *" .Fn libusb20_desc_foreach "const struct libusb20_me_struct *me" "const uint8_t *pdesc" +.Ft "const char *" +.Fn libusb20_strerror "int code" +.Ft "const char *" +.Fn libusb20_error_name "int code" . . .Sh DESCRIPTION @@ -996,6 +1000,22 @@ The total decoded length is returned. The buffer pointer cannot be NULL. . . +.Sh USB DEBUGGING +.Pp +.Ft const char * +.Fn libusb20_strerror "int code" +Get the ASCII representation of the error given by the +.Fa code +argument. +This function does not return NULL. +.Pp +.Ft const char * +.Fn libusb20_error_name "int code" +Get the ASCII representation of the error enum given by the +.Fa code +argument. +This function does not return NULL. +. .Sh FILES . . @@ -1003,7 +1023,8 @@ The buffer pointer cannot be NULL. .Sh SEE ALSO .Xr usb 4 , .Xr libusb 3 , -.Xr usbconfig 8 +.Xr usbconfig 8 , +.Xr usbdump 8 . . .Sh HISTORY Modified: stable/8/lib/libusb/libusb20.c ============================================================================== --- stable/8/lib/libusb/libusb20.c Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb20.c Mon Sep 26 07:38:01 2011 (r225759) @@ -1244,3 +1244,77 @@ libusb20_be_dequeue_device(struct libusb { TAILQ_REMOVE(&(pbe->usb_devs), pdev, dev_entry); } + +const char * +libusb20_strerror(int code) +{ + switch (code) { + case LIBUSB20_SUCCESS: + return ("Success"); + case LIBUSB20_ERROR_IO: + return ("I/O error"); + case LIBUSB20_ERROR_INVALID_PARAM: + return ("Invalid parameter"); + case LIBUSB20_ERROR_ACCESS: + return ("Permissions error"); + case LIBUSB20_ERROR_NO_DEVICE: + return ("No device"); + case LIBUSB20_ERROR_NOT_FOUND: + return ("Not found"); + case LIBUSB20_ERROR_BUSY: + return ("Device busy"); + case LIBUSB20_ERROR_TIMEOUT: + return ("Timeout"); + case LIBUSB20_ERROR_OVERFLOW: + return ("Overflow"); + case LIBUSB20_ERROR_PIPE: + return ("Pipe error"); + case LIBUSB20_ERROR_INTERRUPTED: + return ("Interrupted"); + case LIBUSB20_ERROR_NO_MEM: + return ("Out of memory"); + case LIBUSB20_ERROR_NOT_SUPPORTED: + return ("Not supported"); + case LIBUSB20_ERROR_OTHER: + return ("Other error"); + default: + return ("Unknown error"); + } +} + +const char * +libusb20_error_name(int code) +{ + switch (code) { + case LIBUSB20_SUCCESS: + return ("LIBUSB20_SUCCESS"); + case LIBUSB20_ERROR_IO: + return ("LIBUSB20_ERROR_IO"); + case LIBUSB20_ERROR_INVALID_PARAM: + return ("LIBUSB20_ERROR_INVALID_PARAM"); + case LIBUSB20_ERROR_ACCESS: + return ("LIBUSB20_ERROR_ACCESS"); + case LIBUSB20_ERROR_NO_DEVICE: + return ("LIBUSB20_ERROR_NO_DEVICE"); + case LIBUSB20_ERROR_NOT_FOUND: + return ("LIBUSB20_ERROR_NOT_FOUND"); + case LIBUSB20_ERROR_BUSY: + return ("LIBUSB20_ERROR_BUSY"); + case LIBUSB20_ERROR_TIMEOUT: + return ("LIBUSB20_ERROR_TIMEOUT"); + case LIBUSB20_ERROR_OVERFLOW: + return ("LIBUSB20_ERROR_OVERFLOW"); + case LIBUSB20_ERROR_PIPE: + return ("LIBUSB20_ERROR_PIPE"); + case LIBUSB20_ERROR_INTERRUPTED: + return ("LIBUSB20_ERROR_INTERRUPTED"); + case LIBUSB20_ERROR_NO_MEM: + return ("LIBUSB20_ERROR_NO_MEM"); + case LIBUSB20_ERROR_NOT_SUPPORTED: + return ("LIBUSB20_ERROR_NOT_SUPPORTED"); + case LIBUSB20_ERROR_OTHER: + return ("LIBUSB20_ERROR_OTHER"); + default: + return ("LIBUSB20_ERROR_UNKNOWN"); + } +} Modified: stable/8/lib/libusb/libusb20.h ============================================================================== --- stable/8/lib/libusb/libusb20.h Mon Sep 26 07:05:40 2011 (r225758) +++ stable/8/lib/libusb/libusb20.h Mon Sep 26 07:38:01 2011 (r225759) @@ -293,6 +293,11 @@ void libusb20_be_dequeue_device(struct l void libusb20_be_enqueue_device(struct libusb20_backend *pbe, struct libusb20_device *pdev); void libusb20_be_free(struct libusb20_backend *pbe); +/* USB debugging */ + +const char *libusb20_strerror(int); +const char *libusb20_error_name(int); + #if 0 { /* style */ #endif From owner-svn-src-stable-8@FreeBSD.ORG Mon Sep 26 10:12:17 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76D4B106564A; Mon, 26 Sep 2011 10:12:17 +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 2C8DA8FC0A; Mon, 26 Sep 2011 10:12:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8QACHKJ066420; Mon, 26 Sep 2011 10:12:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8QACHXr066417; Mon, 26 Sep 2011 10:12:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109261012.p8QACHXr066417@svn.freebsd.org> From: Attilio Rao Date: Mon, 26 Sep 2011 10:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225760 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2011 10:12:17 -0000 Author: attilio Date: Mon Sep 26 10:12:16 2011 New Revision: 225760 URL: http://svn.freebsd.org/changeset/base/225760 Log: MFC r225675: Initialize the pmap lock for the kernel pmap when it is really appropriate. Modified: stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Mon Sep 26 07:38:01 2011 (r225759) +++ stable/8/sys/sparc64/sparc64/machdep.c Mon Sep 26 10:12:16 2011 (r225760) @@ -596,11 +596,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l wrpr(pil, 0, 0); wrpr(pstate, 0, PSTATE_KERNEL); - /* - * Finish pmap initialization now that we're ready for mutexes. - */ - PMAP_LOCK_INIT(kernel_pmap); - OF_getprop(root, "name", sparc64_model, sizeof(sparc64_model) - 1); kdb_init(); Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Mon Sep 26 07:38:01 2011 (r225759) +++ stable/8/sys/sparc64/sparc64/pmap.c Mon Sep 26 10:12:16 2011 (r225760) @@ -671,11 +671,9 @@ pmap_bootstrap(u_int cpu_impl) /* * Initialize the kernel pmap (which is statically allocated). - * NOTE: PMAP_LOCK_INIT() is needed as part of the initialization - * but sparc64 start up is not ready to initialize mutexes yet. - * It is called in machdep.c. */ pm = kernel_pmap; + PMAP_LOCK_INIT(pm); for (i = 0; i < MAXCPU; i++) pm->pm_context[i] = TLB_CTX_KERNEL; pm->pm_active = ~0; From owner-svn-src-stable-8@FreeBSD.ORG Tue Sep 27 07:19:02 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D26E106566B; Tue, 27 Sep 2011 07:19:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE538FC14; Tue, 27 Sep 2011 07:19:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7J2Uq010250; Tue, 27 Sep 2011 07:19:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7J2eY010248; Tue, 27 Sep 2011 07:19:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201109270719.p8R7J2eY010248@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 27 Sep 2011 07:19:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225779 - stable/8/sys/dev/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:19:02 -0000 Author: hselasky Date: Tue Sep 27 07:19:01 2011 New Revision: 225779 URL: http://svn.freebsd.org/changeset/base/225779 Log: MFC r225695: Fix minor race in device side mode. Modified: stable/8/sys/dev/usb/usb_transfer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/8/sys/dev/usb/usb_transfer.c Tue Sep 27 07:14:12 2011 (r225778) +++ stable/8/sys/dev/usb/usb_transfer.c Tue Sep 27 07:19:01 2011 (r225779) @@ -2417,8 +2417,9 @@ usbd_transfer_start_cb(void *arg) #if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); #endif - /* start the transfer */ - (ep->methods->start) (xfer); + /* start USB transfer, if no error */ + if (xfer->error == 0) + (ep->methods->start) (xfer); xfer->flags_int.can_cancel_immed = 1; @@ -2597,8 +2598,9 @@ usbd_pipe_start(struct usb_xfer_queue *p #if USB_HAVE_PF usbpf_xfertap(xfer, USBPF_XFERTAP_SUBMIT); #endif - /* start USB transfer */ - (ep->methods->start) (xfer); + /* start USB transfer, if no error */ + if (xfer->error == 0) + (ep->methods->start) (xfer); xfer->flags_int.can_cancel_immed = 1; From owner-svn-src-stable-8@FreeBSD.ORG Tue Sep 27 07:33:04 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E5A41065677; Tue, 27 Sep 2011 07:33:04 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D90C8FC12; Tue, 27 Sep 2011 07:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8R7X4CK010766; Tue, 27 Sep 2011 07:33:04 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8R7X4wD010764; Tue, 27 Sep 2011 07:33:04 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201109270733.p8R7X4wD010764@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 27 Sep 2011 07:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225780 - stable/8/sys/dev/smc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 07:33:04 -0000 Author: stas Date: Tue Sep 27 07:33:04 2011 New Revision: 225780 URL: http://svn.freebsd.org/changeset/base/225780 Log: - MFC r225354: - Fix NULL pointer dereference when a packet of uneven size is being transmitted. Modified: stable/8/sys/dev/smc/if_smc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/smc/if_smc.c ============================================================================== --- stable/8/sys/dev/smc/if_smc.c Tue Sep 27 07:19:01 2011 (r225779) +++ stable/8/sys/dev/smc/if_smc.c Tue Sep 27 07:33:04 2011 (r225780) @@ -538,6 +538,7 @@ smc_task_tx(void *context, int pending) struct smc_softc *sc; struct mbuf *m, *m0; u_int packet, len; + int last_len; uint8_t *data; (void)pending; @@ -590,16 +591,18 @@ smc_task_tx(void *context, int pending) * Push the data out to the device. */ data = NULL; + last_len = 0; for (; m != NULL; m = m->m_next) { data = mtod(m, uint8_t *); smc_write_multi_2(sc, DATA0, (uint16_t *)data, m->m_len / 2); + last_len = m->m_len; } /* * Push out the control byte and and the odd byte if needed. */ if ((len & 1) != 0 && data != NULL) - smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[m->m_len - 1]); + smc_write_2(sc, DATA0, (CTRL_ODD << 8) | data[last_len - 1]); else smc_write_2(sc, DATA0, 0); From owner-svn-src-stable-8@FreeBSD.ORG Tue Sep 27 13:50:30 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A51FB106564A; Tue, 27 Sep 2011 13:50:30 +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 94D9B8FC0C; Tue, 27 Sep 2011 13:50:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8RDoUI5026353; Tue, 27 Sep 2011 13:50:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8RDoUwi026351; Tue, 27 Sep 2011 13:50:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201109271350.p8RDoUwi026351@svn.freebsd.org> From: Attilio Rao Date: Tue, 27 Sep 2011 13:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225796 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2011 13:50:30 -0000 Author: attilio Date: Tue Sep 27 13:50:30 2011 New Revision: 225796 URL: http://svn.freebsd.org/changeset/base/225796 Log: MFC r225794: Backout r225372 MFC. Modified: stable/8/sys/kern/subr_kdb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/subr_kdb.c ============================================================================== --- stable/8/sys/kern/subr_kdb.c Tue Sep 27 13:47:23 2011 (r225795) +++ stable/8/sys/kern/subr_kdb.c Tue Sep 27 13:50:30 2011 (r225796) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" #include "opt_stack.h" -#include "opt_watchdog.h" #include #include @@ -41,9 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SW_WATCHDOG -#include -#endif #include #include @@ -517,9 +513,6 @@ int kdb_trap(int type, int code, struct trapframe *tf) { struct kdb_dbbe *be; -#ifdef SW_WATCHDOG - u_int wdoglvt; -#endif register_t intr; #ifdef SMP int did_stop_cpus; @@ -536,10 +529,6 @@ kdb_trap(int type, int code, struct trap intr = intr_disable(); -#ifdef SW_WATCHDOG - wdoglvt = wdog_kern_last_timeout(); - wdog_kern_pat(WD_TO_NEVER); -#endif #ifdef SMP if ((did_stop_cpus = kdb_stop_cpus) != 0) stop_cpus_hard(PCPU_GET(other_cpus)); @@ -571,9 +560,6 @@ kdb_trap(int type, int code, struct trap if (did_stop_cpus) restart_cpus(stopped_cpus); #endif -#ifdef SW_WATCHDOG - wdog_kern_pat(wdoglvt); -#endif intr_restore(intr); From owner-svn-src-stable-8@FreeBSD.ORG Wed Sep 28 08:47:18 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F3B81065677; Wed, 28 Sep 2011 08:47:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1348FC21; Wed, 28 Sep 2011 08:47:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8S8lIRe063645; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8S8lIm6063641; Wed, 28 Sep 2011 08:47:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201109280847.p8S8lIm6063641@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 28 Sep 2011 08:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225827 - head/sys/kern head/usr.bin/compress head/usr.bin/gzip releng/7.3 releng/7.3/sys/conf releng/7.3/sys/kern releng/7.3/usr.bin/compress releng/7.3/usr.bin/gzip releng/7.4 releng/... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2011 08:47:18 -0000 Author: bz Date: Wed Sep 28 08:47:17 2011 New Revision: 225827 URL: http://svn.freebsd.org/changeset/base/225827 Log: Fix handling of corrupt compress(1)ed data. [11:04] Add missing length checks on unix socket addresses. [11:05] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-11:04.compress Security: CVE-2011-2895 [11:04] Security: FreeBSD-SA-11:05.unix Modified: stable/8/sys/kern/uipc_usrreq.c stable/8/usr.bin/compress/zopen.c stable/8/usr.bin/gzip/zuncompress.c Changes in other areas also in this revision: Modified: head/sys/kern/uipc_usrreq.c head/usr.bin/compress/zopen.c head/usr.bin/gzip/zuncompress.c releng/7.3/UPDATING releng/7.3/sys/conf/newvers.sh releng/7.3/sys/kern/uipc_usrreq.c releng/7.3/usr.bin/compress/zopen.c releng/7.3/usr.bin/gzip/zuncompress.c releng/7.4/UPDATING releng/7.4/sys/conf/newvers.sh releng/7.4/sys/kern/uipc_usrreq.c releng/7.4/usr.bin/compress/zopen.c releng/7.4/usr.bin/gzip/zuncompress.c releng/8.1/UPDATING releng/8.1/sys/conf/newvers.sh releng/8.1/sys/kern/uipc_usrreq.c releng/8.1/usr.bin/compress/zopen.c releng/8.1/usr.bin/gzip/zuncompress.c releng/8.2/UPDATING releng/8.2/sys/conf/newvers.sh releng/8.2/sys/kern/uipc_usrreq.c releng/8.2/usr.bin/compress/zopen.c releng/8.2/usr.bin/gzip/zuncompress.c stable/7/sys/kern/uipc_usrreq.c stable/7/usr.bin/compress/zopen.c stable/7/usr.bin/gzip/zuncompress.c stable/9/sys/kern/uipc_usrreq.c stable/9/usr.bin/compress/zopen.c stable/9/usr.bin/gzip/zuncompress.c Modified: stable/8/sys/kern/uipc_usrreq.c ============================================================================== --- stable/8/sys/kern/uipc_usrreq.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/8/sys/kern/uipc_usrreq.c Wed Sep 28 08:47:17 2011 (r225827) @@ -419,6 +419,8 @@ uipc_bind(struct socket *so, struct sock unp = sotounpcb(so); KASSERT(unp != NULL, ("uipc_bind: unp == NULL")); + if (soun->sun_len > sizeof(struct sockaddr_un)) + return (EINVAL); namelen = soun->sun_len - offsetof(struct sockaddr_un, sun_path); if (namelen <= 0) return (EINVAL); @@ -1168,6 +1170,8 @@ unp_connect(struct socket *so, struct so unp = sotounpcb(so); KASSERT(unp != NULL, ("unp_connect: unp == NULL")); + if (nam->sa_len > sizeof(struct sockaddr_un)) + return (EINVAL); len = nam->sa_len - offsetof(struct sockaddr_un, sun_path); if (len <= 0) return (EINVAL); Modified: stable/8/usr.bin/compress/zopen.c ============================================================================== --- stable/8/usr.bin/compress/zopen.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/8/usr.bin/compress/zopen.c Wed Sep 28 08:47:17 2011 (r225827) @@ -490,7 +490,7 @@ zread(void *cookie, char *rbp, int num) block_compress = maxbits & BLOCK_MASK; maxbits &= BIT_MASK; maxmaxcode = 1L << maxbits; - if (maxbits > BITS) { + if (maxbits > BITS || maxbits < 12) { errno = EFTYPE; return (-1); } @@ -517,17 +517,28 @@ zread(void *cookie, char *rbp, int num) for (code = 255; code >= 0; code--) tab_prefixof(code) = 0; clear_flg = 1; - free_ent = FIRST - 1; - if ((code = getcode(zs)) == -1) /* O, untimely death! */ - break; + free_ent = FIRST; + oldcode = -1; + continue; } incode = code; - /* Special case for KwKwK string. */ + /* Special case for kWkWk string. */ if (code >= free_ent) { + if (code > free_ent || oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *stackp++ = finchar; code = oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (code >= 256) { @@ -544,7 +555,7 @@ middle: do { } while (stackp > de_stack); /* Generate the new entry. */ - if ((code = free_ent) < maxmaxcode) { + if ((code = free_ent) < maxmaxcode && oldcode != -1) { tab_prefixof(code) = (u_short) oldcode; tab_suffixof(code) = finchar; free_ent = code + 1; Modified: stable/8/usr.bin/gzip/zuncompress.c ============================================================================== --- stable/8/usr.bin/gzip/zuncompress.c Wed Sep 28 08:19:45 2011 (r225826) +++ stable/8/usr.bin/gzip/zuncompress.c Wed Sep 28 08:47:17 2011 (r225827) @@ -247,7 +247,7 @@ zread(void *cookie, char *rbp, int num) zs->zs_block_compress = zs->zs_maxbits & BLOCK_MASK; zs->zs_maxbits &= BIT_MASK; zs->zs_maxmaxcode = 1L << zs->zs_maxbits; - if (zs->zs_maxbits > BITS) { + if (zs->zs_maxbits > BITS || zs->zs_maxbits < 12) { errno = EFTYPE; return (-1); } @@ -259,13 +259,7 @@ zread(void *cookie, char *rbp, int num) } zs->zs_free_ent = zs->zs_block_compress ? FIRST : 256; - zs->u.r.zs_finchar = zs->u.r.zs_oldcode = getcode(zs); - if (zs->u.r.zs_oldcode == -1) /* EOF already? */ - return (0); /* Get out of here */ - - /* First code must be 8 bits = char. */ - *bp++ = (u_char)zs->u.r.zs_finchar; - count--; + zs->u.r.zs_oldcode = -1; zs->u.r.zs_stackp = de_stack; while ((zs->u.r.zs_code = getcode(zs)) > -1) { @@ -275,17 +269,29 @@ zread(void *cookie, char *rbp, int num) zs->u.r.zs_code--) tab_prefixof(zs->u.r.zs_code) = 0; zs->zs_clear_flg = 1; - zs->zs_free_ent = FIRST - 1; - if ((zs->u.r.zs_code = getcode(zs)) == -1) /* O, untimely death! */ - break; + zs->zs_free_ent = FIRST; + zs->u.r.zs_oldcode = -1; + continue; } zs->u.r.zs_incode = zs->u.r.zs_code; /* Special case for KwKwK string. */ if (zs->u.r.zs_code >= zs->zs_free_ent) { + if (zs->u.r.zs_code > zs->zs_free_ent || + zs->u.r.zs_oldcode == -1) { + /* Bad stream. */ + errno = EINVAL; + return (-1); + } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; zs->u.r.zs_code = zs->u.r.zs_oldcode; } + /* + * The above condition ensures that code < free_ent. + * The construction of tab_prefixof in turn guarantees that + * each iteration decreases code and therefore stack usage is + * bound by 1 << BITS - 256. + */ /* Generate output characters in reverse order. */ while (zs->u.r.zs_code >= 256) { @@ -302,7 +308,8 @@ middle: do { } while (zs->u.r.zs_stackp > de_stack); /* Generate the new entry. */ - if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode) { + if ((zs->u.r.zs_code = zs->zs_free_ent) < zs->zs_maxmaxcode && + zs->u.r.zs_oldcode != -1) { tab_prefixof(zs->u.r.zs_code) = (u_short) zs->u.r.zs_oldcode; tab_suffixof(zs->u.r.zs_code) = zs->u.r.zs_finchar; zs->zs_free_ent = zs->u.r.zs_code + 1; From owner-svn-src-stable-8@FreeBSD.ORG Thu Sep 29 00:39:57 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50CE1106564A; Thu, 29 Sep 2011 00:39:57 +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 3CCCC8FC12; Thu, 29 Sep 2011 00:39:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8T0dveU096801; Thu, 29 Sep 2011 00:39:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8T0dvEo096785; Thu, 29 Sep 2011 00:39:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201109290039.p8T0dvEo096785@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Sep 2011 00:39:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225855 - in stable/8/sys: amd64/amd64 amd64/ia32 amd64/include i386/i386 ia64/ia32 ia64/ia64 kern powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 00:39:57 -0000 Author: kib Date: Thu Sep 29 00:39:56 2011 New Revision: 225855 URL: http://svn.freebsd.org/changeset/base/225855 Log: Merge the optimizations for the syscall entry and leave. MFC r225474: Inline the syscallenter() and syscallret(). This reduces the time measured by the syscall entry speed microbenchmarks by ~10% on amd64. MFC r225475: Perform amd64-specific microoptimizations for native syscall entry sequence. The effect is ~1% on the microbenchmark. In particular, do not restore registers which are preserved by the C calling sequence. Align the jump target. Avoid unneeded memory accesses by calculating some data in syscall entry trampoline. MFC r225483: The jump target shall be after the padding, not into it. MFC r225575: Microoptimize the return path for the fast syscalls on amd64. Arrange the code to have the fall-through path to follow the likely target. Do not use intermediate register to reload user %rsp. MFC r225576: Put amd64_syscall() prototype in md_var.h. Tested by: Alexandr Kovalenko Added: stable/8/sys/kern/subr_syscall.c - copied, changed from r225474, head/sys/kern/subr_syscall.c Modified: stable/8/sys/amd64/amd64/exception.S stable/8/sys/amd64/amd64/genassym.c stable/8/sys/amd64/amd64/trap.c stable/8/sys/amd64/ia32/ia32_syscall.c stable/8/sys/amd64/include/md_var.h stable/8/sys/i386/i386/trap.c stable/8/sys/ia64/ia32/ia32_trap.c stable/8/sys/ia64/ia64/trap.c stable/8/sys/kern/subr_trap.c stable/8/sys/powerpc/aim/trap.c stable/8/sys/powerpc/booke/trap.c stable/8/sys/sparc64/sparc64/trap.c stable/8/sys/sun4v/sun4v/trap.c stable/8/sys/sys/proc.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/exception.S ============================================================================== --- stable/8/sys/amd64/amd64/exception.S Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/amd64/exception.S Thu Sep 29 00:39:56 2011 (r225855) @@ -380,8 +380,11 @@ IDTVEC(fast_syscall) movl $TF_HASSEGS,TF_FLAGS(%rsp) cld FAKE_MCOUNT(TF_RIP(%rsp)) - movq %rsp,%rdi - call syscall + movq PCPU(CURTHREAD),%rdi + movq %rsp,TD_FRAME(%rdi) + movl TF_RFLAGS(%rsp),%esi + andl $PSL_T,%esi + call amd64_syscall 1: movq PCPU(CURPCB),%rax /* Disable interrupts before testing PCB_FULL_IRET. */ cli @@ -390,29 +393,25 @@ IDTVEC(fast_syscall) /* Check for and handle AST's on return to userland. */ movq PCPU(CURTHREAD),%rax testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) - je 2f - sti - movq %rsp, %rdi - call ast - jmp 1b -2: /* Restore preserved registers. */ + jne 2f + /* Restore preserved registers. */ MEXITCOUNT movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ movq TF_RDX(%rsp),%rdx /* return value 2 */ movq TF_RAX(%rsp),%rax /* return value 1 */ - movq TF_RBX(%rsp),%rbx /* C preserved */ - movq TF_RBP(%rsp),%rbp /* C preserved */ - movq TF_R12(%rsp),%r12 /* C preserved */ - movq TF_R13(%rsp),%r13 /* C preserved */ - movq TF_R14(%rsp),%r14 /* C preserved */ - movq TF_R15(%rsp),%r15 /* C preserved */ movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ - movq TF_RSP(%rsp),%r9 /* user stack pointer */ - movq %r9,%rsp /* original %rsp */ + movq TF_RSP(%rsp),%rsp /* user stack pointer */ swapgs sysretq + +2: /* AST scheduled. */ + sti + movq %rsp,%rdi + call ast + jmp 1b + 3: /* Requested full context restore, use doreti for that. */ MEXITCOUNT jmp doreti Modified: stable/8/sys/amd64/amd64/genassym.c ============================================================================== --- stable/8/sys/amd64/amd64/genassym.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/amd64/genassym.c Thu Sep 29 00:39:56 2011 (r225855) @@ -87,6 +87,7 @@ ASSYM(TD_PCB, offsetof(struct thread, td ASSYM(TD_PFLAGS, offsetof(struct thread, td_pflags)); ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_TID, offsetof(struct thread, td_tid)); +ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); Modified: stable/8/sys/amd64/amd64/trap.c ============================================================================== --- stable/8/sys/amd64/amd64/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/amd64/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -889,41 +889,37 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * syscall - system call request C handler * * A system call is essentially treated as a trap. */ void -syscall(struct trapframe *frame) +amd64_syscall(struct thread *td, int traced) { - struct thread *td; struct syscall_args sa; - register_t orig_tf_rflags; int error; ksiginfo_t ksi; #ifdef DIAGNOSTIC - if (ISPL(frame->tf_cs) != SEL_UPL) { + if (ISPL(td->td_frame->tf_cs) != SEL_UPL) { panic("syscall"); /* NOT REACHED */ } #endif - orig_tf_rflags = frame->tf_rflags; - td = curthread; - td->td_frame = frame; - error = syscallenter(td, &sa); /* * Traced syscall. */ - if (orig_tf_rflags & PSL_T) { - frame->tf_rflags &= ~PSL_T; + if (__predict_false(traced)) { + td->td_frame->tf_rflags &= ~PSL_T; ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGTRAP; ksi.ksi_code = TRAP_TRACE; - ksi.ksi_addr = (void *)frame->tf_rip; + ksi.ksi_addr = (void *)td->td_frame->tf_rip; trapsignal(td, &ksi); } Modified: stable/8/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/8/sys/amd64/ia32/ia32_syscall.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/ia32/ia32_syscall.c Thu Sep 29 00:39:56 2011 (r225855) @@ -156,6 +156,8 @@ ia32_fetch_syscall_args(struct thread *t return (error); } +#include "../../kern/subr_syscall.c" + void ia32_syscall(struct trapframe *frame) { Modified: stable/8/sys/amd64/include/md_var.h ============================================================================== --- stable/8/sys/amd64/include/md_var.h Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/amd64/include/md_var.h Thu Sep 29 00:39:56 2011 (r225855) @@ -75,6 +75,7 @@ struct fpreg; struct dbreg; struct dumperinfo; +void amd64_syscall(struct thread *td, int traced); void busdma_swi(void); void cpu_setregs(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); Modified: stable/8/sys/i386/i386/trap.c ============================================================================== --- stable/8/sys/i386/i386/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/i386/i386/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -1060,6 +1060,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * syscall - system call request C handler * Modified: stable/8/sys/ia64/ia32/ia32_trap.c ============================================================================== --- stable/8/sys/ia64/ia32/ia32_trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/ia64/ia32/ia32_trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -144,6 +144,8 @@ ia32_fetch_syscall_args(struct thread *t return (error); } +#include "../../kern/subr_syscall.c" + static void ia32_syscall(struct trapframe *tf) { Modified: stable/8/sys/ia64/ia64/trap.c ============================================================================== --- stable/8/sys/ia64/ia64/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/ia64/ia64/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -936,6 +936,8 @@ cpu_fetch_syscall_args(struct thread *td return (0); } +#include "../../kern/subr_syscall.c" + /* * Process a system call. * Copied and modified: stable/8/sys/kern/subr_syscall.c (from r225474, head/sys/kern/subr_syscall.c) ============================================================================== --- head/sys/kern/subr_syscall.c Sun Sep 11 16:05:09 2011 (r225474, copy source) +++ stable/8/sys/kern/subr_syscall.c Thu Sep 29 00:39:56 2011 (r225855) @@ -38,13 +38,11 @@ * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 */ -#include "opt_capsicum.h" #include "opt_ktrace.h" #include "opt_kdtrace.h" __FBSDID("$FreeBSD$"); -#include #include #ifdef KTRACE #include @@ -100,22 +98,6 @@ syscallenter(struct thread *td, struct s goto retval; } -#ifdef CAPABILITY_MODE - /* - * In capability mode, we only allow access to system calls - * flagged with SYF_CAPENABLED. - */ - if (IN_CAPABILITY_MODE(td) && - !(sa->callp->sy_flags & SYF_CAPENABLED)) { - error = ECAPMODE; - goto retval; - } -#endif - - error = syscall_thread_enter(td, sa->callp); - if (error != 0) - goto retval; - #ifdef KDTRACE_HOOKS /* * If the systrace module has registered it's probe @@ -144,7 +126,6 @@ syscallenter(struct thread *td, struct s (*systrace_probe_func)(sa->callp->sy_return, sa->code, sa->callp, NULL, (error) ? -1 : td->td_retval[0]); #endif - syscall_thread_exit(td, sa->callp); CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", p, error, td->td_retval[0], td->td_retval[1]); } Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/kern/subr_trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -249,7 +249,6 @@ ast(struct trapframe *framep) mtx_assert(&Giant, MA_NOTOWNED); } -#ifdef HAVE_SYSCALL_ARGS_DEF const char * syscallname(struct proc *p, u_int code) { @@ -261,148 +260,3 @@ syscallname(struct proc *p, u_int code) return (unknown); return (sv->sv_syscallnames[code]); } - -int -syscallenter(struct thread *td, struct syscall_args *sa) -{ - struct proc *p; - int error, traced; - - PCPU_INC(cnt.v_syscall); - p = td->td_proc; - td->td_syscalls++; - - td->td_pticks = 0; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); - if (p->p_flag & P_TRACED) { - traced = 1; - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_USERWR; - td->td_dbgflags |= TDB_SCE; - PROC_UNLOCK(p); - } else - traced = 0; - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif - - CTR6(KTR_SYSC, -"syscall: td=%p pid %d %s (%#lx, %#lx, %#lx)", - td, td->td_proc->p_pid, syscallname(p, sa->code), - sa->args[0], sa->args[1], sa->args[2]); - - if (error == 0) { - STOPEVENT(p, S_SCE, sa->narg); - PTRACESTOP_SC(p, td, S_PT_SCE); - if (td->td_dbgflags & TDB_USERWR) { - /* - * Reread syscall number and arguments if - * debugger modified registers or memory. - */ - error = (p->p_sysent->sv_fetch_syscall_args)(td, sa); -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSCALL)) - ktrsyscall(sa->code, sa->narg, sa->args); -#endif - if (error != 0) - goto retval; - } - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'entry', process the probe. - */ - if (systrace_probe_func != NULL && sa->callp->sy_entry != 0) - (*systrace_probe_func)(sa->callp->sy_entry, sa->code, - sa->callp, sa->args, 0); -#endif - - AUDIT_SYSCALL_ENTER(sa->code, td); - error = (sa->callp->sy_call)(td, sa->args); - AUDIT_SYSCALL_EXIT(error, td); - - /* Save the latest error return value. */ - td->td_errno = error; - -#ifdef KDTRACE_HOOKS - /* - * If the systrace module has registered it's probe - * callback and if there is a probe active for the - * syscall 'return', process the probe. - */ - if (systrace_probe_func != NULL && sa->callp->sy_return != 0) - (*systrace_probe_func)(sa->callp->sy_return, sa->code, - sa->callp, NULL, (error) ? -1 : td->td_retval[0]); -#endif - CTR4(KTR_SYSC, "syscall: p=%p error=%d return %#lx %#lx", - p, error, td->td_retval[0], td->td_retval[1]); - } - retval: - if (traced) { - PROC_LOCK(p); - td->td_dbgflags &= ~TDB_SCE; - PROC_UNLOCK(p); - } - (p->p_sysent->sv_set_syscall_retval)(td, error); - return (error); -} - -void -syscallret(struct thread *td, int error, struct syscall_args *sa __unused) -{ - struct proc *p; - int traced; - - p = td->td_proc; - - /* - * Check for misbehavior. - */ - WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning", - syscallname(p, sa->code)); - KASSERT(td->td_critnest == 0, - ("System call %s returning in a critical section", - syscallname(p, sa->code))); - KASSERT(td->td_locks == 0, - ("System call %s returning with %d locks held", - syscallname(p, sa->code), td->td_locks)); - - /* - * Handle reschedule and other end-of-syscall issues - */ - userret(td, td->td_frame); - - CTR4(KTR_SYSC, "syscall %s exit thread %p pid %d proc %s", - syscallname(p, sa->code), td, td->td_proc->p_pid, td->td_name); - -#ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(sa->code, error, td->td_retval[0]); -#endif - - if (p->p_flag & P_TRACED) { - traced = 1; - PROC_LOCK(p); - td->td_dbgflags |= TDB_SCX; - PROC_UNLOCK(p); - } else - traced = 0; - /* - * This works because errno is findable through the - * register set. If we ever support an emulation where this - * is not the case, this code will need to be revisited. - */ - STOPEVENT(p, S_SCX, sa->code); - PTRACESTOP_SC(p, td, S_PT_SCX); - if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { - PROC_LOCK(p); - td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); - PROC_UNLOCK(p); - } -} -#endif /* HAVE_SYSCALL_ARGS_DEF */ Modified: stable/8/sys/powerpc/aim/trap.c ============================================================================== --- stable/8/sys/powerpc/aim/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/powerpc/aim/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -394,6 +394,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + void syscall(struct trapframe *frame) { Modified: stable/8/sys/powerpc/booke/trap.c ============================================================================== --- stable/8/sys/powerpc/booke/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/powerpc/booke/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -379,6 +379,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + void syscall(struct trapframe *frame) { Modified: stable/8/sys/sparc64/sparc64/trap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/sparc64/sparc64/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -614,6 +614,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * Syscall handler * The arguments to the syscall are passed in the out registers by the caller, Modified: stable/8/sys/sun4v/sun4v/trap.c ============================================================================== --- stable/8/sys/sun4v/sun4v/trap.c Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/sun4v/sun4v/trap.c Thu Sep 29 00:39:56 2011 (r225855) @@ -610,6 +610,8 @@ cpu_fetch_syscall_args(struct thread *td return (error); } +#include "../../kern/subr_syscall.c" + /* * Syscall handler. The arguments to the syscall are passed in the o registers * by the caller, and are saved in the trap frame. The syscall number is passed Modified: stable/8/sys/sys/proc.h ============================================================================== --- stable/8/sys/sys/proc.h Wed Sep 28 21:42:13 2011 (r225854) +++ stable/8/sys/sys/proc.h Thu Sep 29 00:39:56 2011 (r225855) @@ -853,9 +853,6 @@ void cpu_switch(struct thread *, struct void cpu_throw(struct thread *, struct thread *) __dead2; void unsleep(struct thread *); void userret(struct thread *, struct trapframe *); -struct syscall_args; -int syscallenter(struct thread *, struct syscall_args *); -void syscallret(struct thread *, int, struct syscall_args *); void cpu_exit(struct thread *); void exit1(struct thread *, int) __dead2; From owner-svn-src-stable-8@FreeBSD.ORG Thu Sep 29 10:42:52 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C96C1065674; Thu, 29 Sep 2011 10:42:52 +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 4F0F08FC13; Thu, 29 Sep 2011 10:42:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TAgqDO018232; Thu, 29 Sep 2011 10:42:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TAgqWL018230; Thu, 29 Sep 2011 10:42:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201109291042.p8TAgqWL018230@svn.freebsd.org> From: Alexander Motin Date: Thu, 29 Sep 2011 10:42:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225874 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 10:42:52 -0000 Author: mav Date: Thu Sep 29 10:42:51 2011 New Revision: 225874 URL: http://svn.freebsd.org/changeset/base/225874 Log: MFC r225789: Add one more ID for the Marvell 88SE9128 6Gbps SATA controller. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Sep 29 10:37:59 2011 (r225873) +++ stable/8/sys/dev/ahci/ahci.c Thu Sep 29 10:42:51 2011 (r225874) @@ -197,6 +197,7 @@ static struct { {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, {0x91251b4b, 0x00, "Marvell 88SE9125", AHCI_Q_NOBSYRES}, + {0x91281b4b, 0x00, "Marvell 88SE9128", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, {0x91721b4b, 0x00, "Marvell 88SE9172", AHCI_Q_NOBSYRES}, {0x91821b4b, 0x00, "Marvell 88SE9182", AHCI_Q_NOBSYRES}, {0x06201103, 0x00, "HighPoint RocketRAID 620", AHCI_Q_NOBSYRES}, From owner-svn-src-stable-8@FreeBSD.ORG Thu Sep 29 15:05:17 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BBA01065675; Thu, 29 Sep 2011 15:05:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEC7E8FC13; Thu, 29 Sep 2011 15:05:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p8TF5GhT028105; Thu, 29 Sep 2011 15:05:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8TF5G13028102; Thu, 29 Sep 2011 15:05:16 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201109291505.p8TF5G13028102@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 29 Sep 2011 15:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225876 - in stable/8/sys: modules/netgraph/ipfw netgraph X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 15:05:17 -0000 Author: ae Date: Thu Sep 29 15:05:16 2011 New Revision: 225876 URL: http://svn.freebsd.org/changeset/base/225876 Log: MFC r225586: Add IPv6 support to the ng_ipfw(4) [1]. Also add ifdefs to be able build it with and without INET/INET6 support. Submitted by: Alexander V. Chernikov [1] Tested by: Alexander V. Chernikov [1] Modified: stable/8/sys/modules/netgraph/ipfw/Makefile stable/8/sys/netgraph/ng_ipfw.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/modules/netgraph/ipfw/Makefile ============================================================================== --- stable/8/sys/modules/netgraph/ipfw/Makefile Thu Sep 29 14:19:34 2011 (r225875) +++ stable/8/sys/modules/netgraph/ipfw/Makefile Thu Sep 29 15:05:16 2011 (r225876) @@ -1,6 +1,20 @@ # $FreeBSD$ +.include + KMOD= ng_ipfw -SRCS= ng_ipfw.c +SRCS= ng_ipfw.c opt_inet.h opt_inet6.h + +.if !defined(KERNBUILDDIR) + +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + echo "#define INET 1" > ${.TARGET} +.endif +.if ${MK_INET6_SUPPORT} != "no" +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif +.endif .include Modified: stable/8/sys/netgraph/ng_ipfw.c ============================================================================== --- stable/8/sys/netgraph/ng_ipfw.c Thu Sep 29 14:19:34 2011 (r225875) +++ stable/8/sys/netgraph/ng_ipfw.c Thu Sep 29 15:05:16 2011 (r225876) @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include "opt_inet.h" +#include "opt_inet6.h" + #include #include #include @@ -47,6 +50,8 @@ #include #include #include +#include +#include #include #include @@ -224,6 +229,7 @@ ng_ipfw_rcvdata(hook_p hook, item_p item struct m_tag *tag; struct ipfw_rule_ref *r; struct mbuf *m; + struct ip *ip; NGI_GET_M(item, m); NG_FREE_ITEM(item); @@ -234,23 +240,47 @@ ng_ipfw_rcvdata(hook_p hook, item_p item return (EINVAL); /* XXX: find smth better */ }; + if (m->m_len < sizeof(struct ip) && + (m = m_pullup(m, sizeof(struct ip))) == NULL) + return (EINVAL); + + ip = mtod(m, struct ip *); + r = (struct ipfw_rule_ref *)(tag + 1); if (r->info & IPFW_INFO_IN) { - ip_input(m); + switch (ip->ip_v) { +#ifdef INET + case IPVERSION: + ip_input(m); + break; +#endif +#ifdef INET6 + case IPV6_VERSION >> 4: + ip6_input(m); + break; +#endif + default: + NG_FREE_M(m); + return (EINVAL); + } return (0); } else { - struct ip *ip; - - if (m->m_len < sizeof(struct ip) && - (m = m_pullup(m, sizeof(struct ip))) == NULL) + switch (ip->ip_v) { +#ifdef INET + case IPVERSION: + SET_HOST_IPLEN(ip); + return (ip_output(m, NULL, NULL, IP_FORWARDING, + NULL, NULL)); +#endif +#ifdef INET6 + case IPV6_VERSION >> 4: + return (ip6_output(m, NULL, NULL, 0, NULL, + NULL, NULL)); +#endif + default: return (EINVAL); - - ip = mtod(m, struct ip *); - - SET_HOST_IPLEN(ip); - - return ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); - } + } + } } static int From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 1 11:49:25 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42D8F106566B; Sat, 1 Oct 2011 11:49:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28ED78FC0A; Sat, 1 Oct 2011 11:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91BnPLV015804; Sat, 1 Oct 2011 11:49:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91BnP96015802; Sat, 1 Oct 2011 11:49:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011149.p91BnP96015802@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 11:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225895 - stable/8/lib/libthr/thread X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 11:49:25 -0000 Author: kib Date: Sat Oct 1 11:49:24 2011 New Revision: 225895 URL: http://svn.freebsd.org/changeset/base/225895 Log: MFC r211526: Reduce redundant code. Modified: stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 10:18:55 2011 (r225894) +++ stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 11:49:24 2011 (r225895) @@ -233,23 +233,26 @@ _pthread_sigmask(int how, const sigset_t __weak_reference(__sigsuspend, sigsuspend); -int -_sigsuspend(const sigset_t * set) +static const sigset_t * +thr_remove_thr_signals(const sigset_t *set, sigset_t *newset) { - sigset_t newset; const sigset_t *pset; - int ret; if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; + *newset = *set; + SIGDELSET(*newset, SIGCANCEL); + pset = newset; } else pset = set; + return (pset); +} - ret = __sys_sigsuspend(pset); +int +_sigsuspend(const sigset_t * set) +{ + sigset_t newset; - return (ret); + return (__sys_sigsuspend(thr_remove_thr_signals(set, &newset))); } int @@ -257,18 +260,10 @@ __sigsuspend(const sigset_t * set) { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigsuspend(pset); + ret = __sys_sigsuspend(thr_remove_thr_signals(set, &newset)); _thr_cancel_leave(curthread); return (ret); @@ -283,17 +278,9 @@ _sigtimedwait(const sigset_t *set, sigin const struct timespec * timeout) { sigset_t newset; - const sigset_t *pset; - int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - ret = __sys_sigtimedwait(pset, info, timeout); - return (ret); + return (__sys_sigtimedwait(thr_remove_thr_signals(set, &newset), info, + timeout)); } int @@ -302,17 +289,11 @@ __sigtimedwait(const sigset_t *set, sigi { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; _thr_cancel_enter(curthread); - ret = __sys_sigtimedwait(pset, info, timeout); + ret = __sys_sigtimedwait(thr_remove_thr_signals(set, &newset), info, + timeout); _thr_cancel_leave(curthread); return (ret); } @@ -321,18 +302,8 @@ int _sigwaitinfo(const sigset_t *set, siginfo_t *info) { sigset_t newset; - const sigset_t *pset; - int ret; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - ret = __sys_sigwaitinfo(pset, info); - return (ret); + return (__sys_sigwaitinfo(thr_remove_thr_signals(set, &newset), info)); } int @@ -340,18 +311,10 @@ __sigwaitinfo(const sigset_t *set, sigin { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigwaitinfo(pset, info); + ret = __sys_sigwaitinfo(thr_remove_thr_signals(set, &newset), info); _thr_cancel_leave(curthread); return (ret); } @@ -360,18 +323,8 @@ int _sigwait(const sigset_t *set, int *sig) { sigset_t newset; - const sigset_t *pset; - int ret; - - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - ret = __sys_sigwait(pset, sig); - return (ret); + return (__sys_sigwait(thr_remove_thr_signals(set, &newset), sig)); } int @@ -379,18 +332,10 @@ __sigwait(const sigset_t *set, int *sig) { struct pthread *curthread = _get_curthread(); sigset_t newset; - const sigset_t *pset; int ret; - if (SIGISMEMBER(*set, SIGCANCEL)) { - newset = *set; - SIGDELSET(newset, SIGCANCEL); - pset = &newset; - } else - pset = set; - _thr_cancel_enter(curthread); - ret = __sys_sigwait(pset, sig); + ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig); _thr_cancel_leave(curthread); return (ret); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 1 11:59:45 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4FD9106566C; Sat, 1 Oct 2011 11:59:45 +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 932A98FC17; Sat, 1 Oct 2011 11:59:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91BxjqG016153; Sat, 1 Oct 2011 11:59:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91Bxj1N016147; Sat, 1 Oct 2011 11:59:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011159.p91Bxj1N016147@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 11:59:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225896 - in stable/8/lib: libc/stdlib libc/sys libthr/thread X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 11:59:45 -0000 Author: kib Date: Sat Oct 1 11:59:45 2011 New Revision: 225896 URL: http://svn.freebsd.org/changeset/base/225896 Log: MFC r212405 (by davidxu): Because POSIX does not allow EINTR to be returned from sigwait(), add a wrapper for it in libc and rework the code in libthr, the system call still can return EINTR, we keep this feature. Discussed with: davidxu Added: stable/8/lib/libc/sys/sigwait.c - copied unchanged from r212405, head/lib/libc/sys/sigwait.c Modified: stable/8/lib/libc/stdlib/Makefile.inc stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/lib/libthr/thread/thr_sig.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/8/lib/libc/stdlib/Makefile.inc Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/stdlib/Makefile.inc Sat Oct 1 11:59:45 2011 (r225896) @@ -9,7 +9,7 @@ MISRCS+=_Exit.c a64l.c abort.c abs.c ate getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c malloc.c \ merge.c ptsname.c qsort.c qsort_r.c radixsort.c rand.c random.c \ - reallocf.c realpath.c remque.c strfmon.c strtoimax.c \ + reallocf.c realpath.c remque.c sigwait.c strfmon.c strtoimax.c \ strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c Modified: stable/8/lib/libc/sys/Makefile.inc ============================================================================== --- stable/8/lib/libc/sys/Makefile.inc Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/sys/Makefile.inc Sat Oct 1 11:59:45 2011 (r225896) @@ -23,6 +23,9 @@ SRCS+= stack_protector.c stack_protector SRCS+= fcntl.c ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c PSEUDO+= _fcntl.o .endif +SRCS+= sigwait.c +NOASM+= sigwait.o +PSEUDO+= _sigwait.o # Add machine dependent asm sources: SRCS+=${MDASM} Modified: stable/8/lib/libc/sys/Symbol.map ============================================================================== --- stable/8/lib/libc/sys/Symbol.map Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libc/sys/Symbol.map Sat Oct 1 11:59:45 2011 (r225896) @@ -917,6 +917,7 @@ FBSDprivate_1.0 { _sigtimedwait; __sys_sigtimedwait; _sigwait; + __sigwait; __sys_sigwait; _sigwaitinfo; __sys_sigwaitinfo; Copied: stable/8/lib/libc/sys/sigwait.c (from r212405, head/lib/libc/sys/sigwait.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/sigwait.c Sat Oct 1 11:59:45 2011 (r225896, copy of r212405, head/lib/libc/sys/sigwait.c) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2010 davidxu@freebsd.org + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int __sys_sigwait(const sigset_t * restrict, int * restrict); + +__weak_reference(__sigwait, sigwait); + +int +__sigwait(const sigset_t * restrict set, int * restrict sig) +{ + int ret; + + /* POSIX does not allow EINTR to be returned */ + do { + ret = __sys_sigwait(set, sig); + } while (ret == EINTR); + return (ret); +} Modified: stable/8/lib/libthr/thread/thr_sig.c ============================================================================== --- stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 11:49:24 2011 (r225895) +++ stable/8/lib/libthr/thread/thr_sig.c Sat Oct 1 11:59:45 2011 (r225896) @@ -56,7 +56,7 @@ int _sigtimedwait(const sigset_t *set, s const struct timespec * timeout); int __sigwaitinfo(const sigset_t *set, siginfo_t *info); int _sigwaitinfo(const sigset_t *set, siginfo_t *info); -int __sigwait(const sigset_t *set, int *sig); +int ___sigwait(const sigset_t *set, int *sig); int _sigwait(const sigset_t *set, int *sig); int __sigsuspend(const sigset_t *sigmask); @@ -269,7 +269,7 @@ __sigsuspend(const sigset_t * set) return (ret); } -__weak_reference(__sigwait, sigwait); +__weak_reference(___sigwait, sigwait); __weak_reference(__sigtimedwait, sigtimedwait); __weak_reference(__sigwaitinfo, sigwaitinfo); @@ -328,14 +328,16 @@ _sigwait(const sigset_t *set, int *sig) } int -__sigwait(const sigset_t *set, int *sig) +___sigwait(const sigset_t *set, int *sig) { struct pthread *curthread = _get_curthread(); sigset_t newset; int ret; - _thr_cancel_enter(curthread); - ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig); - _thr_cancel_leave(curthread); + do { + _thr_cancel_enter(curthread); + ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig); + _thr_cancel_leave(curthread); + } while (ret == EINTR); return (ret); } From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 1 12:35:10 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F78106566C; Sat, 1 Oct 2011 12:35:10 +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 48CC78FC08; Sat, 1 Oct 2011 12:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91CZABQ017275; Sat, 1 Oct 2011 12:35:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91CZAoQ017272; Sat, 1 Oct 2011 12:35:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110011235.p91CZAoQ017272@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 1 Oct 2011 12:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225898 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 12:35:10 -0000 Author: kib Date: Sat Oct 1 12:35:09 2011 New Revision: 225898 URL: http://svn.freebsd.org/changeset/base/225898 Log: MFC r225172: Clarify the behaviour of sigwait() on signal interruption, and note the difference between sigwait() and sigtimedwait()/sigwaitinfo(). Modified: stable/8/lib/libc/sys/sigwait.2 stable/8/lib/libc/sys/sigwaitinfo.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/sigwait.2 ============================================================================== --- stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwait.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait +system call, which retries the call on +.Er EINTR +error. .Sh RETURN VALUES If successful, .Fn sigwait Modified: stable/8/lib/libc/sys/sigwaitinfo.2 ============================================================================== --- stable/8/lib/libc/sys/sigwaitinfo.2 Sat Oct 1 12:19:48 2011 (r225897) +++ stable/8/lib/libc/sys/sigwaitinfo.2 Sat Oct 1 12:35:09 2011 (r225898) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGTIMEDWAIT 2 .Os .Sh NAME @@ -116,6 +116,16 @@ except that the selected signal number s member, and the cause of the signal shall be stored in the .Va si_code member. +Besides this, the +.Fn sigwaitinfo +and +.Fn sigtimedwait +system calls may return +.Er EINTR +if interrupted by signal, which is not allowed for the +.Fn sigwait +function. +.Pp If any value is queued to the selected signal, the first such queued value is dequeued and, if the info argument is .Pf non- Dv NULL , From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 1 13:54:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BD03106566C; Sat, 1 Oct 2011 13:54:49 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD568FC08; Sat, 1 Oct 2011 13:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p91DsmV0020398; Sat, 1 Oct 2011 13:54:48 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p91Dsm58020396; Sat, 1 Oct 2011 13:54:48 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201110011354.p91Dsm58020396@svn.freebsd.org> From: Gabor Kovesdan Date: Sat, 1 Oct 2011 13:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225903 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 13:54:49 -0000 Author: gabor Date: Sat Oct 1 13:54:48 2011 New Revision: 225903 URL: http://svn.freebsd.org/changeset/base/225903 Log: MFC: r225775 - Move misplaced reference - Sort references - s/Since/Because/ Modified: stable/8/share/man/man4/smp.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/smp.4 ============================================================================== --- stable/8/share/man/man4/smp.4 Sat Oct 1 13:47:50 2011 (r225902) +++ stable/8/share/man/man4/smp.4 Sat Oct 1 13:54:48 2011 (r225903) @@ -120,25 +120,25 @@ tasks on CPUs that are closely grouped t .Pp .Fx supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Since using logical CPUs can cause performance penalties under certain loads, +Because using logical CPUs can cause performance penalties under certain loads, the logical CPUs can be disabled by setting the .Va machdep.hlt_logical_cpus sysctl to one. Note that this operation is different from the mechanism used by the -.Xr cpuset 1 . .Sh SEE ALSO +.Xr cpuset 1 , .Xr mptable 1 , +.Xr sched_4bsd 4 , +.Xr sched_ule 4 , +.Xr loader 8 , .Xr sysctl 8 , .Xr condvar 9 , .Xr msleep 9 , .Xr mtx_pool 9 , .Xr mutex 9 , -.Xr sema 9 , -.Xr sx 9 , .Xr rwlock 9 , -.Xr sched_4bsd 4 , -.Xr sched_ule 4 , -.Xr cpuset 1 +.Xr sema 9 , +.Xr sx 9 .Sh HISTORY The .Nm From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 1 15:32:54 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 836B41065673; Sat, 1 Oct 2011 15:32:54 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 08C728FC08; Sat, 1 Oct 2011 15:32:53 +0000 (UTC) Received: by ywp17 with SMTP id 17so2937174ywp.13 for ; Sat, 01 Oct 2011 08:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=kNzumgCM8bi5u40iTBGFo6njY6BS+ktTxzgM4Fv6t1M=; b=u64cXPe0FZNjHpefC+pC9hlRDhK50C9rfpuTqhLXPNED8LA4BN33J6MWhxKxvbIK73 Yww9knJsbfvKGoyN4e12HD9ituMS7R2PHwQ42MVHQaYkieOijjSW0vlqXaSpgY8OSDOO vslNLqV4/Jus3a5ALYnpgFyVdGgZ0yRcEgghQ= MIME-Version: 1.0 Received: by 10.236.103.102 with SMTP id e66mr27283026yhg.1.1317481534999; Sat, 01 Oct 2011 08:05:34 -0700 (PDT) Received: by 10.236.103.130 with HTTP; Sat, 1 Oct 2011 08:05:34 -0700 (PDT) In-Reply-To: <201110011235.p91CZAoQ017272@svn.freebsd.org> References: <201110011235.p91CZAoQ017272@svn.freebsd.org> Date: Sat, 1 Oct 2011 11:05:34 -0400 Message-ID: From: Ben Kaduk To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r225898 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 15:32:54 -0000 On Sat, Oct 1, 2011 at 8:35 AM, Konstantin Belousov wrote= : > Author: kib > Date: Sat Oct =A01 12:35:09 2011 > New Revision: 225898 > URL: http://svn.freebsd.org/changeset/base/225898 > > Log: > =A0MFC r225172: > =A0Clarify the behaviour of sigwait() on signal interruption, and note > =A0the difference between sigwait() and sigtimedwait()/sigwaitinfo(). > > Modified: > =A0stable/8/lib/libc/sys/sigwait.2 > =A0stable/8/lib/libc/sys/sigwaitinfo.2 > Directory Properties: > =A0stable/8/lib/libc/ =A0 (props changed) > =A0stable/8/lib/libc/stdtime/ =A0 (props changed) > > Modified: stable/8/lib/libc/sys/sigwait.2 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/lib/libc/sys/sigwait.2 =A0 =A0 Sat Oct =A01 12:19:48 2011 = =A0 =A0 =A0 =A0(r225897) > +++ stable/8/lib/libc/sys/sigwait.2 =A0 =A0 Sat Oct =A01 12:35:09 2011 = =A0 =A0 =A0 =A0(r225898) > @@ -27,7 +27,7 @@ > =A0.\" > =A0.\" $FreeBSD$ > =A0.\" > -.Dd November 11, 2005 > +.Dd August 24, 2011 > =A0.Dt SIGWAIT 2 > =A0.Os > =A0.Sh NAME > @@ -82,6 +82,14 @@ selected, it will be the lowest numbered > =A0The selection order between realtime > =A0and non-realtime signals, or between multiple pending non-realtime sig= nals, > =A0is unspecified. > +.Sh IMPLEMENTATION NOTES > +The > +.Fn sigwait > +function is implemented as a wrapper around the > +.Fn __sys_sigwait I thought the sys_sigwait rename was only on head/stable-9? -Ben Kaduk > +system call, which retries the call on > +.Er EINTR > +error. > =A0.Sh RETURN VALUES > =A0If successful, > =A0.Fn sigwait > From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 1 17:46:45 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7937F1065670; Sat, 1 Oct 2011 17:46:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 125DC8FC14; Sat, 1 Oct 2011 17:46:44 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p91HkZWl073972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 1 Oct 2011 20:46:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p91HkZ0m066411; Sat, 1 Oct 2011 20:46:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p91HkZWO066410; Sat, 1 Oct 2011 20:46:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 1 Oct 2011 20:46:35 +0300 From: Kostik Belousov To: Ben Kaduk Message-ID: <20111001174634.GD1511@deviant.kiev.zoral.com.ua> References: <201110011235.p91CZAoQ017272@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tJ6vydIQpqz6Mizf" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r225898 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Oct 2011 17:46:45 -0000 --tJ6vydIQpqz6Mizf Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 01, 2011 at 11:05:34AM -0400, Ben Kaduk wrote: > On Sat, Oct 1, 2011 at 8:35 AM, Konstantin Belousov wro= te: > > Author: kib > > Date: Sat Oct =9A1 12:35:09 2011 > > New Revision: 225898 > > URL: http://svn.freebsd.org/changeset/base/225898 > > > > Log: > > =9AMFC r225172: > > =9AClarify the behaviour of sigwait() on signal interruption, and note > > =9Athe difference between sigwait() and sigtimedwait()/sigwaitinfo(). > > > > Modified: > > =9Astable/8/lib/libc/sys/sigwait.2 > > =9Astable/8/lib/libc/sys/sigwaitinfo.2 > > Directory Properties: > > =9Astable/8/lib/libc/ =9A (props changed) > > =9Astable/8/lib/libc/stdtime/ =9A (props changed) > > > > Modified: stable/8/lib/libc/sys/sigwait.2 > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/8/lib/libc/sys/sigwait.2 =9A =9A Sat Oct =9A1 12:19:48 2011 = =9A =9A =9A =9A(r225897) > > +++ stable/8/lib/libc/sys/sigwait.2 =9A =9A Sat Oct =9A1 12:35:09 2011 = =9A =9A =9A =9A(r225898) > > @@ -27,7 +27,7 @@ > > =9A.\" > > =9A.\" $FreeBSD$ > > =9A.\" > > -.Dd November 11, 2005 > > +.Dd August 24, 2011 > > =9A.Dt SIGWAIT 2 > > =9A.Os > > =9A.Sh NAME > > @@ -82,6 +82,14 @@ selected, it will be the lowest numbered > > =9AThe selection order between realtime > > =9Aand non-realtime signals, or between multiple pending non-realtime s= ignals, > > =9Ais unspecified. > > +.Sh IMPLEMENTATION NOTES > > +The > > +.Fn sigwait > > +function is implemented as a wrapper around the > > +.Fn __sys_sigwait >=20 > I thought the sys_sigwait rename was only on head/stable-9? I merged the wrapper sigwait(3) several commits earlier, see r225896. --tJ6vydIQpqz6Mizf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEUEARECAAYFAk6HUfoACgkQC3+MBN1Mb4iowwCXXSGVFpGyrFktUhkJEJykq8j+ cACg4owwP7H9+4a4clrNTaommbWi2N0= =ig1t -----END PGP SIGNATURE----- --tJ6vydIQpqz6Mizf--