svn commit: r207056 - in head: sys/conf usr.sbin/config
Author: netchild Date: Thu Apr 22 09:20:17 2010 New Revision: 207056 URL: http://svn.freebsd.org/changeset/base/207056 Log: Revert r206179 (by imp) and do something similar which is more consistent with all other corresponding CTF places by changing the corresponding code which is generated by config(8). Or in short, move the '@' from the variable definition to the use of the variable. [1] While I'm here break up a long line. [2] Discussed with: imp [1,2], bde [2] Modified: head/sys/conf/kern.pre.mk head/usr.sbin/config/mkmakefile.c Modified: head/sys/conf/kern.pre.mk == --- head/sys/conf/kern.pre.mk Thu Apr 22 06:58:59 2010(r207055) +++ head/sys/conf/kern.pre.mk Thu Apr 22 09:20:17 2010(r207056) @@ -128,7 +128,8 @@ NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${ NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.PREFIX}.c -NORMAL_CTFCONVERT= @[ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +NORMAL_CTFCONVERT= [ -z "${CTFCONVERT}" -o -n "${NO_CTF}" ] || \ + ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC} Modified: head/usr.sbin/config/mkmakefile.c == --- head/usr.sbin/config/mkmakefile.c Thu Apr 22 06:58:59 2010 (r207055) +++ head/usr.sbin/config/mkmakefile.c Thu Apr 22 09:20:17 2010 (r207056) @@ -741,7 +741,7 @@ do_rules(FILE *f) printf("config: don't know rules for %s\n", np); break; } - snprintf(cmd, sizeof(cmd), "${%s_%c%s}\n.if defined(NORMAL_CTFCONVERT) && !empty(NORMAL_CTFCONVERT)\n\t${NORMAL_CTFCONVERT}\n.endif", ftype, + snprintf(cmd, sizeof(cmd), "${%s_%c%s}\...@${normal_ctfconvert}", ftype, toupper(och), ftp->f_flags & NOWERROR ? "_NOWERROR" : ""); compilewith = cmd; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207057 - head/sys/conf
Author: netchild Date: Thu Apr 22 09:24:01 2010 New Revision: 207057 URL: http://svn.freebsd.org/changeset/base/207057 Log: Do the ctfmerge (= all symbols, not only symbols from one object file) for KLDs too. Noticed by: np Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk == --- head/sys/conf/kmod.mk Thu Apr 22 09:20:17 2010(r207056) +++ head/sys/conf/kmod.mk Thu Apr 22 09:24:01 2010(r207057) @@ -137,6 +137,10 @@ CFLAGS+= -mlongcall -fno-omit-frame-poin CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls .endif +.if defined(DEBUG) || defined(DEBUG_FLAGS) +CTFFLAGS+= -g +.endif + .if defined(FIRMWS) .if !exists(@) ${KMOD:S/$/.c/}: @ @@ -202,6 +206,7 @@ ${KMOD}.kld: ${OBJS} ${FULLPROG}: ${OBJS} .endif ${LD} ${LDFLAGS} -r -d -o ${.TARGET} ${OBJS} + @[ -z "${CTFMERGE}" -o -n "${NO_CTF}" ] || ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .if defined(EXPORT_SYMS) .if ${EXPORT_SYMS} != YES .if ${EXPORT_SYMS} == NO ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207058 - head
Author: netchild Date: Thu Apr 22 09:30:02 2010 New Revision: 207058 URL: http://svn.freebsd.org/changeset/base/207058 Log: Remove explicit setting of NO_CTF in WMAKEENV and in the make call for the buildkernel. This way makeoptions WITH_CTF=yes not only works when compiling the tradtitional way, but also when using buildkernel. This does not enable the CTF part of the world, it still defaults to without CTF info. The cross/build-tools/bootstrap targets are not affected by this, they still have and should keep the explicit NO_CTF. Notified by: np Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Thu Apr 22 09:24:01 2010(r207057) +++ head/Makefile.inc1 Thu Apr 22 09:30:02 2010(r207058) @@ -259,7 +259,7 @@ WMAKEENV= ${CROSSENV} \ VERSION="${VERSION}" \ INSTALL="sh ${.CURDIR}/tools/install.sh" \ PATH=${TMPPATH} -.if ${MK_CDDL} == "no" || defined(NO_CTF) +.if ${MK_CDDL} == "no" WMAKEENV+= NO_CTF=1 .endif WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 DESTDIR=${WORLDTMP} @@ -780,7 +780,7 @@ buildkernel: @echo "--" cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207066 - head/sys/dev/drm
Author: rnoland Date: Thu Apr 22 18:21:25 2010 New Revision: 207066 URL: http://svn.freebsd.org/changeset/base/207066 Log: Rework how drm maps are handled. * On 32 bit platforms we steal the upper 4 bits of the map handle to store a unique map id. * On 64 bit platforms we steal the upper 24 bits. Resolves issues where the offsets that are handed to mmap may overlap the VRAM on some cards. Tested on: radeon, intel, mga, and via. This will break nouveau. I will spin new patches shortly. Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_context.c head/sys/dev/drm/drm_drv.c head/sys/dev/drm/drm_memory.c head/sys/dev/drm/drm_scatter.c head/sys/dev/drm/drm_sysctl.c head/sys/dev/drm/drm_vm.c head/sys/dev/drm/i915_dma.c head/sys/dev/drm/mach64_dma.c head/sys/dev/drm/mga_dma.c head/sys/dev/drm/mga_warp.c head/sys/dev/drm/r128_cce.c head/sys/dev/drm/r128_state.c head/sys/dev/drm/r600_blit.c head/sys/dev/drm/r600_cp.c head/sys/dev/drm/radeon_cp.c head/sys/dev/drm/radeon_cs.c head/sys/dev/drm/radeon_state.c head/sys/dev/drm/savage_bci.c head/sys/dev/drm/via_dma.c head/sys/dev/drm/via_map.c head/sys/dev/drm/via_mm.c Modified: head/sys/dev/drm/drmP.h == --- head/sys/dev/drm/drmP.h Thu Apr 22 14:54:54 2010(r207065) +++ head/sys/dev/drm/drmP.h Thu Apr 22 18:21:25 2010(r207066) @@ -239,22 +239,22 @@ typedef u_int8_t u8; #define DRM_MEMORYBARRIER()mb() #define DRM_READ8(map, offset) \ - *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \ + *(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) #define DRM_READ16(map, offset) \ - *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \ + *(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) #define DRM_READ32(map, offset) \ - *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \ + *(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) #define DRM_WRITE8(map, offset, val) \ - *(volatile u_int8_t *)(((vm_offset_t)(map)->handle) + \ + *(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) = val #define DRM_WRITE16(map, offset, val) \ - *(volatile u_int16_t *)(((vm_offset_t)(map)->handle) + \ + *(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) = val #define DRM_WRITE32(map, offset, val) \ - *(volatile u_int32_t *)(((vm_offset_t)(map)->handle) + \ + *(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \ (vm_offset_t)(offset)) = val #define DRM_VERIFYAREA_READ( uaddr, size ) \ @@ -481,18 +481,21 @@ typedef struct drm_sg_mem { struct drm_dma_handle*dmah; /* Handle to PCI memory */ } drm_sg_mem_t; +#define DRM_MAP_HANDLE_BITS(sizeof(void *) == 4 ? 4 : 24) +#define DRM_MAP_HANDLE_SHIFT (sizeof(void *) * 8 - DRM_MAP_HANDLE_BITS) typedef TAILQ_HEAD(drm_map_list, drm_local_map) drm_map_list_t; typedef struct drm_local_map { - unsigned long offset; /* Physical address (0 for SAREA)*/ - unsigned long size;/* Physical size (bytes) */ - enum drm_map_type type;/* Type of memory mapped */ - enum drm_map_flags flags; /* Flags */ - void*handle; /* User-space: "Handle" to pass to mmap*/ -/* Kernel-space: kernel-virtual address*/ - int mtrr;/* Boolean: MTRR used */ -/* Private data*/ - int rid; /* PCI resource ID for bus_space */ + unsigned long offset; /* Physical address (0 for SAREA) */ + unsigned long size; /* Physical size (bytes)*/ + enum drm_map_type type; /* Type of memory mapped*/ + enum drm_map_flags flags; /* Flags*/ + void *handle; /* User-space: "Handle" to pass to mmap */ + /* Kernel-space: kernel-virtual address */ + int mtrr; /* Boolean: MTRR used */ + /* Private data */ + int rid; /* PCI resource ID for bus_space*/ + void *virtu
svn commit: r207067 - head/sys/dev/drm
Author: rnoland Date: Thu Apr 22 18:44:23 2010 New Revision: 207067 URL: http://svn.freebsd.org/changeset/base/207067 Log: re-write scatter gather memory allocation yet again... This time, abandon the use of busdma and start interacting with the VM system directly. Make use of the new kmem_alloc_attr() which allows us to easily allocate non-contiguous pages to back the GART table. This should help a lot when starting or restarting X after the system has been running for a while and memory has become fragmented. MFC after:2 weeks Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_bufs.c head/sys/dev/drm/drm_scatter.c head/sys/dev/drm/r128_cce.c head/sys/dev/drm/r600_cp.c head/sys/dev/drm/radeon_cp.c Modified: head/sys/dev/drm/drmP.h == --- head/sys/dev/drm/drmP.h Thu Apr 22 18:21:25 2010(r207066) +++ head/sys/dev/drm/drmP.h Thu Apr 22 18:44:23 2010(r207067) @@ -49,6 +49,7 @@ struct drm_file; #include #include #include +#include #include #if __FreeBSD_version >= 70 #include @@ -68,10 +69,13 @@ struct drm_file; #include #include #include +#include #include #include #include +#include #include +#include #include #include #include @@ -474,11 +478,10 @@ typedef struct drm_agp_head { } drm_agp_head_t; typedef struct drm_sg_mem { - unsigned long handle; - void *virtual; - int pages; - dma_addr_t *busaddr; - struct drm_dma_handle*dmah; /* Handle to PCI memory */ + vm_offset_t vaddr; + vm_paddr_t *busaddr; + vm_pindex_t pages; + vm_object_t obj; } drm_sg_mem_t; #define DRM_MAP_HANDLE_BITS(sizeof(void *) == 4 ? 4 : 24) Modified: head/sys/dev/drm/drm_bufs.c == --- head/sys/dev/drm/drm_bufs.c Thu Apr 22 18:21:25 2010(r207066) +++ head/sys/dev/drm/drm_bufs.c Thu Apr 22 18:44:23 2010(r207067) @@ -226,8 +226,8 @@ int drm_addmap(struct drm_device * dev, DRM_LOCK(); return EINVAL; } - map->virtual = (void *)(dev->sg->handle + offset); - map->offset = dev->sg->handle + offset; + map->virtual = (void *)(dev->sg->vaddr + offset); + map->offset = dev->sg->vaddr + offset; break; case _DRM_CONSISTENT: /* Unfortunately, we don't get any alignment specification from @@ -744,7 +744,7 @@ static int drm_do_addbufs_sg(struct drm_ buf->offset = (dma->byte_count + offset); buf->bus_address = agp_offset + offset; - buf->address = (void *)(agp_offset + offset + dev->sg->handle); + buf->address = (void *)(agp_offset + offset + dev->sg->vaddr); buf->next= NULL; buf->pending = 0; buf->file_priv = NULL; Modified: head/sys/dev/drm/drm_scatter.c == --- head/sys/dev/drm/drm_scatter.c Thu Apr 22 18:21:25 2010 (r207066) +++ head/sys/dev/drm/drm_scatter.c Thu Apr 22 18:44:23 2010 (r207067) @@ -1,5 +1,5 @@ /*- - * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + * Copyright (c) 2009 Robert C. Noland III * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -20,11 +20,6 @@ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - * - * Authors: - * Gareth Hughes - * Eric Anholt - * */ #include @@ -32,99 +27,58 @@ __FBSDID("$FreeBSD$"); /** @file drm_scatter.c * Allocation of memory for scatter-gather mappings by the graphics chip. - * * The memory allocated here is then made into an aperture in the card - * by drm_ati_pcigart_init(). + * by mapping the pages into the GART. */ #include "dev/drm/drmP.h" -static void drm_sg_alloc_cb(void *arg, bus_dma_segment_t *segs, - int nsegs, int error); - int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request) { struct drm_sg_mem *entry; - struct drm_dma_handle *dmah; - int ret; + vm_size_t size; + vm_pindex_t pindex; if (dev->sg) return EINVAL; - entry = malloc(sizeof(*entry), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); - entry->pages = round_page(request->size) / PAGE_SIZE; - DRM_DEBUG("sg size=%ld pages=%d\n", request->size, entry->pages); + DRM_DEBUG("request size=%ld\n", request->size); + + entry = malloc(sizeof(*entry), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); + size
svn commit: r207068 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: pjd Date: Thu Apr 22 18:47:23 2010 New Revision: 207068 URL: http://svn.freebsd.org/changeset/base/207068 Log: Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK, sunlnk) flag is set. We only deny dirctory's removal or rename. PR: kern/143343 Reported by: marck MFC after:3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Apr 22 18:44:23 2010(r207067) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Apr 22 18:47:23 2010(r207068) @@ -2235,11 +2235,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t return (EPERM); } +#ifdef sun if ((v4_mode & (ACE_DELETE | ACE_DELETE_CHILD)) && (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { *check_privs = B_FALSE; return (EPERM); } +#else + /* +* In FreeBSD we allow to modify directory's content is ZFS_NOUNLINK +* (sunlnk) is set. We just don't allow directory removal, which is +* handled in zfs_zaccess_delete(). +*/ + if ((v4_mode & ACE_DELETE) && + (zp->z_phys->zp_flags & ZFS_NOUNLINK)) { + *check_privs = B_FALSE; + return (EPERM); + } +#endif if (((v4_mode & (ACE_READ_DATA|ACE_EXECUTE)) && (zp->z_phys->zp_flags & ZFS_AV_QUARANTINED))) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207069 - head/sys/dev/drm
Author: rnoland Date: Thu Apr 22 18:47:30 2010 New Revision: 207069 URL: http://svn.freebsd.org/changeset/base/207069 Log: Now that we properly set write-combining on the pages that back the GART, disable snooping on radeons. MFC after:2 weeks Modified: head/sys/dev/drm/ati_pcigart.c head/sys/dev/drm/r600_cp.c Modified: head/sys/dev/drm/ati_pcigart.c == --- head/sys/dev/drm/ati_pcigart.c Thu Apr 22 18:47:23 2010 (r207068) +++ head/sys/dev/drm/ati_pcigart.c Thu Apr 22 18:47:30 2010 (r207069) @@ -39,8 +39,9 @@ __FBSDID("$FreeBSD$"); #define ATI_PCIGART_PAGE_SIZE 4096/* PCI GART page size */ #define ATI_PCIGART_PAGE_MASK (~(ATI_PCIGART_PAGE_SIZE-1)) -#define ATI_PCIE_WRITE 0x4 -#define ATI_PCIE_READ 0x8 +#define ATI_GART_NOSNOOP 0x1 +#define ATI_GART_WRITE 0x4 +#define ATI_GART_READ 0x8 static void drm_ati_alloc_pcigart_table_cb(void *arg, bus_dma_segment_t *segs, @@ -196,13 +197,15 @@ drm_ati_pcigart_init(struct drm_device * case DRM_ATI_GART_IGP: page_base |= (upper_32_bits(entry_addr) & 0xff) << 4; - page_base |= 0xc; + page_base |= ATI_GART_READ | ATI_GART_WRITE; + page_base |= ATI_GART_NOSNOOP; break; case DRM_ATI_GART_PCIE: page_base >>= 8; page_base |= (upper_32_bits(entry_addr) & 0xff) << 24; - page_base |= ATI_PCIE_READ | ATI_PCIE_WRITE; + page_base |= ATI_GART_READ | ATI_GART_WRITE; + page_base |= ATI_GART_NOSNOOP; break; default: case DRM_ATI_GART_PCI: Modified: head/sys/dev/drm/r600_cp.c == --- head/sys/dev/drm/r600_cp.c Thu Apr 22 18:47:23 2010(r207068) +++ head/sys/dev/drm/r600_cp.c Thu Apr 22 18:47:30 2010(r207069) @@ -180,7 +180,7 @@ int r600_page_table_init(struct drm_devi entry_addr = entry->busaddr[i]; for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) { page_base = (u64) entry_addr & ATI_PCIGART_PAGE_MASK; - page_base |= R600_PTE_VALID | R600_PTE_SYSTEM | R600_PTE_SNOOPED; + page_base |= R600_PTE_VALID | R600_PTE_SYSTEM; page_base |= R600_PTE_READABLE | R600_PTE_WRITEABLE; *pci_gart = page_base; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207070 - in head/sbin: hastctl hastd
Author: pjd Date: Thu Apr 22 19:18:10 2010 New Revision: 207070 URL: http://svn.freebsd.org/changeset/base/207070 Log: Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options. Reported by: Andrei V. Lavreniyuk MFC after:3 days Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/hastd/hast_proto.c Modified: head/sbin/hastctl/Makefile == --- head/sbin/hastctl/Makefile Thu Apr 22 18:47:30 2010(r207069) +++ head/sbin/hastctl/Makefile Thu Apr 22 19:18:10 2010(r207070) @@ -25,8 +25,13 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBL} -LDADD= -lcrypto -ll +DPADD= ${LIBL} +LDADD= -ll +.if ${MK_OPENSSL} != "no" +DPADD+=${LIBCRYPTO} +LDADD+=-lcrypto +CFLAGS+=-DHAVE_CRYPTO +.endif YFLAGS+=-v Modified: head/sbin/hastd/Makefile == --- head/sbin/hastd/MakefileThu Apr 22 18:47:30 2010(r207069) +++ head/sbin/hastd/MakefileThu Apr 22 19:18:10 2010(r207070) @@ -26,9 +26,13 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \ - ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +.if ${MK_OPENSSL} != "no" +DPADD+=${LIBCRYPTO} +LDADD+=-lcrypto +CFLAGS+=-DHAVE_CRYPTO +.endif YFLAGS+=-v Modified: head/sbin/hastd/hast_proto.c == --- head/sbin/hastd/hast_proto.cThu Apr 22 18:47:30 2010 (r207069) +++ head/sbin/hastd/hast_proto.cThu Apr 22 19:18:10 2010 (r207070) @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef HAVE_CRYPTO #include +#endif #include #include @@ -67,14 +69,18 @@ static int compression_send(struct hast_ void **datap, size_t *sizep, bool *freedatap); static int compression_recv(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap); +#ifdef HAVE_CRYPTO static int checksum_send(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap); static int checksum_recv(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap); +#endif static struct hast_pipe_stage pipeline[] = { { "compression", compression_send, compression_recv }, +#ifdef HAVE_CRYPTO { "checksum", checksum_send, checksum_recv } +#endif }; static int @@ -161,6 +167,7 @@ compression_recv(struct hast_resource *r return (0); } +#ifdef HAVE_CRYPTO static int checksum_send(struct hast_resource *res, struct nv *nv, void **datap, size_t *sizep, bool *freedatap __unused) @@ -221,6 +228,7 @@ checksum_recv(struct hast_resource *res, return (0); } +#endif /* HAVE_CRYPTO */ /* * Send the given nv structure via conn. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207071 - head/sys/dev/sge
Author: yongari Date: Thu Apr 22 20:25:07 2010 New Revision: 207071 URL: http://svn.freebsd.org/changeset/base/207071 Log: Intialize interrupt moderation control register. The magic value was chosen by lots of trial and errors. The chosen value shows good interrupt moderation without additional latency. Without this change, controller can generate more than 140k interrupts per second under high network load. Submitted by: xclin cs dot nctu dot edu dot tw > Modified: head/sys/dev/sge/if_sge.c Modified: head/sys/dev/sge/if_sge.c == --- head/sys/dev/sge/if_sge.c Thu Apr 22 19:18:10 2010(r207070) +++ head/sys/dev/sge/if_sge.c Thu Apr 22 20:25:07 2010(r207071) @@ -1551,10 +1551,13 @@ sge_init_locked(struct sge_softc *sc) /* * XXX Try to mitigate interrupts. */ + CSR_WRITE_4(sc, IntrControl, 0x0888); +#ifdef notyet if (sc->sge_intrcontrol != 0) CSR_WRITE_4(sc, IntrControl, sc->sge_intrcontrol); if (sc->sge_intrtimer != 0) CSR_WRITE_4(sc, IntrTimer, sc->sge_intrtimer); +#endif /* * Clear and enable interrupts. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207072 - head/sbin/devd
Author: thompsa Date: Thu Apr 22 20:46:39 2010 New Revision: 207072 URL: http://svn.freebsd.org/changeset/base/207072 Log: Document the new USB notification types. Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 == --- head/sbin/devd/devd.conf.5 Thu Apr 22 20:25:07 2010(r207071) +++ head/sbin/devd/devd.conf.5 Thu Apr 22 20:46:39 2010(r207072) @@ -250,18 +250,40 @@ CIS-vendor. Device class. .It Li device Device ID. +.It Li devclass +Device Class (USB) +.It Li devsubclass +Device Sub-class (USB) .It Li device-name Name of attached/detached device. +.It Li endpoints +Endpoint count (USB) .It Li function Card functions. +.It Li interface +Interface ID (USB) +.It Li intclass +Interface Class (USB) +.It Li intprotocol +Interface Protocol (USB) +.It Li intsubclass +Interface Sub-class (USB) .It Li manufacturer Manufacturer ID (pccard). +.It Li mode +Peripheral mode (USB) .It Li notify Match the value of the .Dq Li notify variable. +.It Li parent +Parent device +.It Li port +Hub port number (USB) .It Li product -Product ID (pccard). +Product ID (pccard/USB). +.It Li release +Hardware revision (USB) .It Li serial Serial Number (USB). .It Li slot @@ -342,6 +364,27 @@ The node is destroyed. .El .El +.It Li USB +Events related to the USB subsystem. +.Bl -tag -width ".Sy Subsystem" -compact +.It Sy Subsystem +.It Li DEVICE +.Bl -tag -width ".Li DETACH" -compact +.It Sy Type +.It Li ATTACH +USB device is attached to the system. +.It Li DETACH +USB device is detached from the system. +.El +.It Li INTERFACE +.Bl -tag -width ".Li DETACH" -compact +.It Sy Type +.It Li ATTACH +USB interface is attached from a device. +.It Li DETACH +USB interface is detached from a device. +.El +.El .It Li coretemp Events related to the .Xr coretemp 4 @@ -461,6 +504,17 @@ notify 0 { }; # +# Match a USB device type +# +notify 0 { + match "system" "USB"; + match "subsystem" "INTERFACE"; + match "type""ATTACH"; + match "intclass""0x0e"; + action "logger USB video device attached"; +}; + +# # Try to configure ath and wi devices with pccard_ether # as they are attached. # ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207077 - in head/sys: amd64/conf arm/conf dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage dev/usb/wlan i386/conf ia64/con...
Author: thompsa Date: Thu Apr 22 21:31:34 2010 New Revision: 207077 URL: http://svn.freebsd.org/changeset/base/207077 Log: Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had the illusion of a tunable setting but was always turned on regardless. MFC after:1 week Modified: head/sys/amd64/conf/GENERIC head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/HL200 head/sys/arm/conf/KB920X head/sys/arm/conf/LN2410SBC head/sys/arm/conf/SHEEVAPLUG head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/input/atp.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/ubser.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/usb_serial.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/storage/ustorage_fs.c head/sys/dev/usb/usb_debug.h head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_zyd.c head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX head/sys/ia64/conf/GENERIC head/sys/mips/conf/SENTRY5 head/sys/mips/conf/XLR head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/MPC85XX head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Thu Apr 22 21:17:00 2010(r207076) +++ head/sys/amd64/conf/GENERIC Thu Apr 22 21:31:34 2010(r207077) @@ -281,6 +281,7 @@ device firmware# firmware assist modul device bpf # Berkeley packet filter # USB support +#options USB_DEBUG # enable debug msgs device uhci# UHCI PCI->USB interface device ohci# OHCI PCI->USB interface device ehci# EHCI PCI->USB interface (USB 2.0) Modified: head/sys/arm/conf/DB-78XXX == --- head/sys/arm/conf/DB-78XXX Thu Apr 22 21:17:00 2010(r207076) +++ head/sys/arm/conf/DB-78XXX Thu Apr 22 21:31:34 2010(r207077) @@ -67,6 +67,7 @@ devicee1000phy device bpf # USB +optionsUSB_DEBUG # enable debug msgs device usb device ehci device umass Modified: head/sys/arm/conf/DB-88F5XXX == --- head/sys/arm/conf/DB-88F5XXXThu Apr 22 21:17:00 2010 (r207076) +++ head/sys/arm/conf/DB-88F5XXXThu Apr 22 21:31:34 2010 (r207077) @@ -74,6 +74,7 @@ deviceiicbus device ds133x # USB +optionsUSB_DEBUG # enable debug msgs device usb device ehci device umass Modified: head/sys/arm/conf/DB-88F6XXX == --- head/sys/arm/conf/DB-88F6XXXThu Apr 22 21:17:00 2010 (r207076) +++ head/sys/arm/conf/DB-88F6XXXThu Apr 22 21:31:34 2010 (r207077) @@ -67,6 +67,7 @@ devicee1000phy device bpf # USB +optionsUSB_DEBUG # enable debug msgs device usb device ehci device umass Modified: head/sys/arm/conf/HL200 == --- head/sys/arm/conf/HL200 Thu Apr 22 21:17:00 2010(r207076) +++ head/sys/arm/conf/HL200 Thu Apr 22 21:31:34 2010(r207077) @@ -95,6 +95,7 @@ deviceicee device bpf # USB support +optionsUSB_DEBUG # enable debug msgs device ohci# OHCI localbus->USB interface device usb # USB Bus (required) #deviceudbp# USB Double Bulk Pipe devices Modified: head/sys/arm/conf/KB920X == --- head/sys/arm/conf/KB920X
svn commit: r207078 - head/sys/dev/usb
Author: thompsa Date: Thu Apr 22 21:41:50 2010 New Revision: 207078 URL: http://svn.freebsd.org/changeset/base/207078 Log: Use SX_DUPOK rather than making the string unique. Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c == --- head/sys/dev/usb/usb_device.c Thu Apr 22 21:31:34 2010 (r207077) +++ head/sys/dev/usb/usb_device.c Thu Apr 22 21:41:50 2010 (r207078) @@ -1491,10 +1491,10 @@ usb_alloc_device(device_t parent_dev, st return (NULL); } /* initialise our SX-lock */ - sx_init(udev->default_sx, "0123456789ABCDEF - USB device SX lock" + depth); + sx_init_flags(udev->default_sx, "USB device SX lock", SX_DUPOK); /* initialise our SX-lock */ - sx_init(udev->default_sx + 1, "0123456789ABCDEF - USB config SX lock" + depth); + sx_init_flags(udev->default_sx + 1, "USB config SX lock", SX_DUPOK); cv_init(udev->default_cv, "WCTRL"); cv_init(udev->default_cv + 1, "UGONE"); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207079 - head/sys/dev/usb
Author: thompsa Date: Thu Apr 22 22:00:16 2010 New Revision: 207079 URL: http://svn.freebsd.org/changeset/base/207079 Log: Properly name the sxlocks, mutexes and condvars. Modified: head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_dev.c == --- head/sys/dev/usb/usb_dev.c Thu Apr 22 21:41:50 2010(r207078) +++ head/sys/dev/usb/usb_dev.c Thu Apr 22 22:00:16 2010(r207079) @@ -284,7 +284,7 @@ error: usbd_enum_unlock(cpd->udev); if (--(cpd->udev->refcount) == 0) { - cv_signal(cpd->udev->default_cv + 1); + cv_signal(&cpd->udev->ref_cv); } } mtx_unlock(&usb_ref_lock); @@ -352,7 +352,7 @@ usb_unref_device(struct usb_cdev_privdat } if (crd->is_uref) { if (--(cpd->udev->refcount) == 0) { - cv_signal(cpd->udev->default_cv + 1); + cv_signal(&cpd->udev->ref_cv); } crd->is_uref = 0; } @@ -500,7 +500,7 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_TX; f->dev_ep_index = e; - f->priv_mtx = udev->default_mtx; + f->priv_mtx = &udev->device_mtx; f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; @@ -527,7 +527,7 @@ usb_fifo_create(struct usb_cdev_privdata /* update some fields */ f->fifo_index = n + USB_FIFO_RX; f->dev_ep_index = e; - f->priv_mtx = udev->default_mtx; + f->priv_mtx = &udev->device_mtx; f->priv_sc0 = ep; f->methods = &usb_ugen_methods; f->iface_index = ep->iface_index; Modified: head/sys/dev/usb/usb_device.c == --- head/sys/dev/usb/usb_device.c Thu Apr 22 21:41:50 2010 (r207078) +++ head/sys/dev/usb/usb_device.c Thu Apr 22 22:00:16 2010 (r207079) @@ -655,7 +655,7 @@ usb_config_parse(struct usb_device *udev goto cleanup; if (cmd == USB_CFG_INIT) { - sx_assert(udev->default_sx + 1, SA_LOCKED); + sx_assert(&udev->enum_sx, SA_LOCKED); /* check for in-use endpoints */ @@ -1062,7 +1062,7 @@ usb_detach_device(struct usb_device *ude } DPRINTFN(4, "udev=%p\n", udev); - sx_assert(udev->default_sx + 1, SA_LOCKED); + sx_assert(&udev->enum_sx, SA_LOCKED); /* * First detach the child to give the child's detach routine a @@ -1380,7 +1380,7 @@ usb_suspend_resume(struct usb_device *ud } DPRINTFN(4, "udev=%p do_suspend=%d\n", udev, do_suspend); - sx_assert(udev->default_sx + 1, SA_LOCKED); + sx_assert(&udev->enum_sx, SA_LOCKED); USB_BUS_LOCK(udev->bus); /* filter the suspend events */ @@ -1419,13 +1419,13 @@ usbd_clear_stall_proc(struct usb_proc_ms /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(udev->default_mtx); + mtx_lock(&udev->device_mtx); /* Start clear stall callback */ usbd_transfer_start(udev->default_xfer[1]); /* Change lock */ - mtx_unlock(udev->default_mtx); + mtx_unlock(&udev->device_mtx); USB_BUS_LOCK(udev->bus); } @@ -1491,16 +1491,16 @@ usb_alloc_device(device_t parent_dev, st return (NULL); } /* initialise our SX-lock */ - sx_init_flags(udev->default_sx, "USB device SX lock", SX_DUPOK); + sx_init_flags(&udev->ctrl_sx, "USB device SX lock", SX_DUPOK); /* initialise our SX-lock */ - sx_init_flags(udev->default_sx + 1, "USB config SX lock", SX_DUPOK); + sx_init_flags(&udev->enum_sx, "USB config SX lock", SX_DUPOK); - cv_init(udev->default_cv, "WCTRL"); - cv_init(udev->default_cv + 1, "UGONE"); + cv_init(&udev->ctrlreq_cv, "WCTRL"); + cv_init(&udev->ref_cv, "UGONE"); /* initialise our mutex */ - mtx_init(udev->default_mtx, "USB device mutex", NULL, MTX_DEF); + mtx_init(&udev->device_mtx, "USB device mutex", NULL, MTX_DEF); /* initialise generic clear stall */ udev->cs_msg[0].hdr.pm_callback = &usbd_clear_stall_proc; @@ -2005,7 +2005,7 @@ usb_free_device(struct usb_device *udev, mtx_lock(&usb_ref_lock); udev->refcount--; while (udev->refcount != 0) { - cv_wait(udev->default_cv + 1, &usb_ref_lock); + cv_wait(&udev->ref_cv, &usb_ref_lock); } mtx_unlock(&usb_ref_lock); @@ -2036,13
svn commit: r207080 - head/sys/dev/usb
Author: thompsa Date: Thu Apr 22 22:15:08 2010 New Revision: 207080 URL: http://svn.freebsd.org/changeset/base/207080 Log: Use a more obvious prefix for the USB control (endpoint 0) transfers rather than default_*. Modified: head/sys/dev/usb/usb_compat_linux.c head/sys/dev/usb/usb_dev.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_generic.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usb_transfer.h Modified: head/sys/dev/usb/usb_compat_linux.c == --- head/sys/dev/usb/usb_compat_linux.c Thu Apr 22 22:00:16 2010 (r207079) +++ head/sys/dev/usb/usb_compat_linux.c Thu Apr 22 22:15:08 2010 (r207080) @@ -971,7 +971,7 @@ usb_linux_create_usb_device(struct usb_d udev->devnum = device_get_unit(dev); bcopy(&udev->ddesc, &udev->descriptor, sizeof(udev->descriptor)); - bcopy(udev->default_ep.edesc, &udev->ep0.desc, + bcopy(udev->ctrl_ep.edesc, &udev->ep0.desc, sizeof(udev->ep0.desc)); } } Modified: head/sys/dev/usb/usb_dev.c == --- head/sys/dev/usb/usb_dev.c Thu Apr 22 22:00:16 2010(r207079) +++ head/sys/dev/usb/usb_dev.c Thu Apr 22 22:15:08 2010(r207080) @@ -615,7 +615,7 @@ usb_dev_get_ep(struct usb_device *udev, uint8_t ep_dir; if (ep_index == 0) { - ep = &udev->default_ep; + ep = &udev->ctrl_ep; } else { if (dir == USB_FIFO_RX) { if (udev->flags.usb_mode == USB_MODE_HOST) { Modified: head/sys/dev/usb/usb_device.c == --- head/sys/dev/usb/usb_device.c Thu Apr 22 22:00:16 2010 (r207079) +++ head/sys/dev/usb/usb_device.c Thu Apr 22 22:15:08 2010 (r207080) @@ -179,9 +179,9 @@ usbd_get_ep_by_addr(struct usb_device *u /* * The default endpoint is always present and is checked separately: */ - if ((udev->default_ep.edesc) && - ((udev->default_ep.edesc->bEndpointAddress & EA_MASK) == ea_val)) { - ep = &udev->default_ep; + if ((udev->ctrl_ep.edesc) && + ((udev->ctrl_ep.edesc->bEndpointAddress & EA_MASK) == ea_val)) { + ep = &udev->ctrl_ep; goto found; } return (NULL); @@ -297,11 +297,11 @@ usbd_get_endpoint(struct usb_device *ude * address" and "any direction" returns the first endpoint of the * interface. "iface_index" and "direction" is ignored: */ - if ((udev->default_ep.edesc) && - ((udev->default_ep.edesc->bEndpointAddress & ea_mask) == ea_val) && - ((udev->default_ep.edesc->bmAttributes & type_mask) == type_val) && + if ((udev->ctrl_ep.edesc) && + ((udev->ctrl_ep.edesc->bEndpointAddress & ea_mask) == ea_val) && + ((udev->ctrl_ep.edesc->bmAttributes & type_mask) == type_val) && (!index)) { - ep = &udev->default_ep; + ep = &udev->ctrl_ep; goto found; } return (NULL); @@ -1422,7 +1422,7 @@ usbd_clear_stall_proc(struct usb_proc_ms mtx_lock(&udev->device_mtx); /* Start clear stall callback */ - usbd_transfer_start(udev->default_xfer[1]); + usbd_transfer_start(udev->ctrl_xfer[1]); /* Change lock */ mtx_unlock(&udev->device_mtx); @@ -1529,13 +1529,13 @@ usb_alloc_device(device_t parent_dev, st udev->refcount = 1; /* set up default endpoint descriptor */ - udev->default_ep_desc.bLength = sizeof(udev->default_ep_desc); - udev->default_ep_desc.bDescriptorType = UDESC_ENDPOINT; - udev->default_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT; - udev->default_ep_desc.bmAttributes = UE_CONTROL; - udev->default_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET; - udev->default_ep_desc.wMaxPacketSize[1] = 0; - udev->default_ep_desc.bInterval = 0; + udev->ctrl_ep_desc.bLength = sizeof(udev->ctrl_ep_desc); + udev->ctrl_ep_desc.bDescriptorType = UDESC_ENDPOINT; + udev->ctrl_ep_desc.bEndpointAddress = USB_CONTROL_ENDPOINT; + udev->ctrl_ep_desc.bmAttributes = UE_CONTROL; + udev->ctrl_ep_desc.wMaxPacketSize[0] = USB_MAX_IPACKET; + udev->ctrl_ep_desc.wMaxPacketSize[1] = 0; + udev->ctrl_ep_desc.bInterval = 0; udev->ddesc.bMaxPacketSize = USB_MAX_IPACKET; udev->speed = speed; @@ -1559,8 +1559,8 @@ usb_alloc_device(device_t parent_dev, st /* init the default endpoint */ usb_init_endpoint(udev, 0, - &udev->default_ep_desc, -
svn commit: r207081 - in head/sys: amd64/amd64 i386/i386
Author: jkim Date: Thu Apr 22 23:47:19 2010 New Revision: 207081 URL: http://svn.freebsd.org/changeset/base/207081 Log: If a conditional jump instruction has the same jt and jf, do not perform the test and jump unconditionally. Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/amd64/amd64/bpf_jit_machdep.h head/sys/i386/i386/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.h Modified: head/sys/amd64/amd64/bpf_jit_machdep.c == --- head/sys/amd64/amd64/bpf_jit_machdep.c Thu Apr 22 22:15:08 2010 (r207080) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Thu Apr 22 23:47:19 2010 (r207081) @@ -419,62 +419,77 @@ bpf_jit_compile(struct bpf_insn *prog, u break; case BPF_JMP|BPF_JA: - JMP(stream.refs[stream.bpf_pc + ins->k] - - stream.refs[stream.bpf_pc]); + JUMP(ins->k); break; case BPF_JMP|BPF_JGT|BPF_K: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } CMPid(ins->k, EAX); JCC(JA, JBE); break; case BPF_JMP|BPF_JGE|BPF_K: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } CMPid(ins->k, EAX); JCC(JAE, JB); break; case BPF_JMP|BPF_JEQ|BPF_K: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } CMPid(ins->k, EAX); JCC(JE, JNE); break; case BPF_JMP|BPF_JSET|BPF_K: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } TESTid(ins->k, EAX); JCC(JNE, JE); break; case BPF_JMP|BPF_JGT|BPF_X: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } CMPrd(EDX, EAX); JCC(JA, JBE); break; case BPF_JMP|BPF_JGE|BPF_X: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } CMPrd(EDX, EAX); JCC(JAE, JB); break; case BPF_JMP|BPF_JEQ|BPF_X: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } CMPrd(EDX, EAX); JCC(JE, JNE); break; case BPF_JMP|BPF_JSET|BPF_X: - if (ins->jt == 0 && ins->jf == 0) + if (ins->jt == ins->jf) { + JUMP(ins->jt); break; + } TESTrd(EDX, EAX); JCC(JNE, JE); break; Modified: head/sys/amd64/amd64/bpf_jit_machdep.h == --- head/sys/amd64/amd64/bpf_jit_machdep.h Thu Apr 22 22:15:08 2010 (r207080) +++ head/sys/amd64/amd64/bpf_jit_machdep.h Thu Apr 22 23:47:19 2010 (r207081)
svn commit: r207082 - in head/sys/fs: nfs nfsclient
Author: rmacklem Date: Thu Apr 22 23:51:01 2010 New Revision: 207082 URL: http://svn.freebsd.org/changeset/base/207082 Log: When the experimental NFS client is handling an NFSv4 server reboot with delegations enabled, the recovery could fail if the renew thread is trying to return a delegation, since it will not do the recovery. This patch fixes the above by having nfscl_recalldeleg() fail with the I/O operations returning EIO, so that they will be attempted later. Most of the patch consists of adding an argument to various functions to indicate the delegation recall case where this needs to be done. MFC after:1 week Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnfsiod.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfs_var.h == --- head/sys/fs/nfs/nfs_var.h Thu Apr 22 23:47:19 2010(r207081) +++ head/sys/fs/nfs/nfs_var.h Thu Apr 22 23:51:01 2010(r207082) @@ -369,7 +369,7 @@ int nfsrpc_readlink(vnode_t, struct uio int nfsrpc_read(vnode_t, struct uio *, struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *); int nfsrpc_write(vnode_t, struct uio *, int *, u_char *, -struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *); +struct ucred *, NFSPROC_T *, struct nfsvattr *, int *, void *, int); int nfsrpc_mknod(vnode_t, char *, int, struct vattr *, u_int32_t, enum vtype, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *); @@ -502,7 +502,7 @@ int nfscl_maperr(NFSPROC_T *, int, uid_t void nfscl_init(void); /* nfs_clbio.c */ -int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int); +int ncl_flush(vnode_t, int, struct ucred *, NFSPROC_T *, int, int); /* nfs_clnode.c */ void ncl_invalcaches(vnode_t); Modified: head/sys/fs/nfsclient/nfs.h == --- head/sys/fs/nfsclient/nfs.h Thu Apr 22 23:47:19 2010(r207081) +++ head/sys/fs/nfsclient/nfs.h Thu Apr 22 23:51:01 2010(r207082) @@ -79,14 +79,16 @@ int ncl_biowrite(struct vnode *, struct int ncl_vinvalbuf(struct vnode *, int, struct thread *, int); int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); -int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); +int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *, +int); void ncl_nhinit(void); void ncl_nhuninit(void); void ncl_nodelock(struct nfsnode *); void ncl_nodeunlock(struct nfsnode *); int ncl_getattrcache(struct vnode *, struct vattr *); int ncl_readrpc(struct vnode *, struct uio *, struct ucred *); -int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *); +int ncl_writerpc(struct vnode *, struct uio *, struct ucred *, int *, int *, +int); int ncl_readlinkrpc(struct vnode *, struct uio *, struct ucred *); int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); Modified: head/sys/fs/nfsclient/nfs_clbio.c == --- head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 22 23:47:19 2010 (r207081) +++ head/sys/fs/nfsclient/nfs_clbio.c Thu Apr 22 23:51:01 2010 (r207082) @@ -336,7 +336,7 @@ ncl_putpages(struct vop_putpages_args *a else iomode = NFSWRITE_FILESYNC; - error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit); + error = ncl_writerpc(vp, &uio, cred, &iomode, &must_commit, 0); pmap_qremove(kva, npages); relpbuf(bp, &ncl_pbuf_freecnt); @@ -554,7 +554,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); if (error) { brelse(bp); return (error); @@ -583,7 +583,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error = ncl_doio(vp, bp, cred, td); + error = ncl_doio(vp, bp, cred, td, 0); if (error) { bp->b_ioflags |= BIO_ERROR; brelse(bp); @@ -609,7 +609,7 @@ ncl_bioread(struct vnode *vp, struct uio if ((bp->b_flags & B_CACHE) == 0) { bp->b_iocmd = BIO_READ; vfs_busy_pages(bp, 0); - error =
svn commit: r207089 - head/sys/mips/mips
Author: neel Date: Fri Apr 23 01:34:01 2010 New Revision: 207089 URL: http://svn.freebsd.org/changeset/base/207089 Log: Fix compilation error. tick.c:298:5: error: "KDTRACE_HOOKS" is not defined Modified: head/sys/mips/mips/tick.c Modified: head/sys/mips/mips/tick.c == --- head/sys/mips/mips/tick.c Fri Apr 23 01:22:48 2010(r207088) +++ head/sys/mips/mips/tick.c Fri Apr 23 01:34:01 2010(r207089) @@ -295,7 +295,7 @@ clock_intr(void *arg) */ if (delta > cycles_per_hz) delta = cycles_per_hz; -#if KDTRACE_HOOKS +#ifdef KDTRACE_HOOKS /* * If the DTrace hooks are configured and a callback function * has been registered, then call it to process the high speed ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r207094 - head/sys/geom/part
Author: marcel Date: Fri Apr 23 03:11:39 2010 New Revision: 207094 URL: http://svn.freebsd.org/changeset/base/207094 Log: Implement the resize verb and add support for resizing partitions for all schemes but EBR. Quality work by Andrey! Submitted by: "Andrey V. Elsukov" Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_if.m head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part.c == --- head/sys/geom/part/g_part.c Fri Apr 23 02:31:28 2010(r207093) +++ head/sys/geom/part/g_part.c Fri Apr 23 03:11:39 2010(r207094) @@ -971,9 +971,85 @@ g_part_ctl_recover(struct gctl_req *req, static int g_part_ctl_resize(struct gctl_req *req, struct g_part_parms *gpp) { - gctl_error(req, "%d verb 'resize'", ENOSYS); - return (ENOSYS); -} + struct g_geom *gp; + struct g_provider *pp; + struct g_part_entry *pe, *entry; + struct g_part_table *table; + struct sbuf *sb; + quad_t end; + int error; + + gp = gpp->gpp_geom; + G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name)); + g_topology_assert(); + table = gp->softc; + + /* check gpp_index */ + LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { + if (entry->gpe_deleted || entry->gpe_internal) + continue; + if (entry->gpe_index == gpp->gpp_index) + break; + } + if (entry == NULL) { + gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index); + return (ENOENT); + } + + /* check gpp_size */ + end = entry->gpe_start + gpp->gpp_size - 1; + if (gpp->gpp_size < 1 || end > table->gpt_last) { + gctl_error(req, "%d size '%jd'", EINVAL, + (intmax_t)gpp->gpp_size); + return (EINVAL); + } + + LIST_FOREACH(pe, &table->gpt_entry, gpe_entry) { + if (pe->gpe_deleted || pe->gpe_internal || pe == entry) + continue; + if (end >= pe->gpe_start && end <= pe->gpe_end) { + gctl_error(req, "%d end '%jd'", ENOSPC, + (intmax_t)end); + return (ENOSPC); + } + if (entry->gpe_start < pe->gpe_start && end > pe->gpe_end) { + gctl_error(req, "%d size '%jd'", ENOSPC, + (intmax_t)gpp->gpp_size); + return (ENOSPC); + } + } + + pp = entry->gpe_pp; + if ((g_debugflags & 16) == 0 && + (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) { + gctl_error(req, "%d", EBUSY); + return (EBUSY); + } + + error = G_PART_RESIZE(table, entry, gpp); + if (error) { + gctl_error(req, "%d", error); + return (error); + } + + if (!entry->gpe_created) + entry->gpe_modified = 1; + + /* update mediasize of changed provider */ + pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) * + pp->sectorsize; + + /* Provide feedback if so requested. */ + if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { + sb = sbuf_new_auto(); + G_PART_FULLNAME(table, entry, sb, gp->name); + sbuf_cat(sb, " resized\n"); + sbuf_finish(sb); + gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + } + return (0); +} static int g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp, @@ -1194,7 +1270,8 @@ g_part_ctlreq(struct gctl_req *req, stru mparms |= G_PART_PARM_GEOM; } else if (!strcmp(verb, "resize")) { ctlreq = G_PART_CTL_RESIZE; - mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX; + mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX | + G_PART_PARM_SIZE; } break; case 's': Modified: head/sys/geom/part/g_part_apm.c == --- head/sys/geom/part/g_part_apm.c Fri Apr 23 02:31:28 2010 (r207093) +++ head/sys/geom/part/g_part_apm.c Fri Apr 23 03:11:39 2010 (r207094) @@ -74,6 +74,8 @@ static int g_part_apm_read(struct g_part static const char *g_part_apm_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_apm_write(struct g_part_table *, struct g_consumer *); +static int g_part_apm_resize(struct g_part_table *, struct g_part_entry *, +struct g_part_parms
svn commit: r207095 - head/sbin/geom/class/part
Author: marcel Date: Fri Apr 23 03:14:04 2010 New Revision: 207095 URL: http://svn.freebsd.org/changeset/base/207095 Log: Implement the resize command for resizing partitions. Without new size, the partition in question is resized to fill all available space. Quality work by Andrey! Submitted by: "Andrey V. Elsukov" Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/geom_part.c == --- head/sbin/geom/class/part/geom_part.c Fri Apr 23 03:11:39 2010 (r207094) +++ head/sbin/geom/class/part/geom_part.c Fri Apr 23 03:14:04 2010 (r207095) @@ -133,6 +133,13 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, + { "resize", 0, gpart_issue, { + { 's', "size", autofill, G_TYPE_ASCLBA }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", flags, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "geom", NULL + }, G_CMD_SENTINEL }; @@ -243,6 +250,99 @@ fmtattrib(struct gprovider *pp) } static int +gpart_autofill_resize(struct gctl_req *req) +{ + struct gmesh mesh; + struct gclass *cp; + struct ggeom *gp; + struct gprovider *pp; + unsigned long long last, size, start, new_size; + unsigned long long lba, new_lba; + const char *s; + char *val; + int error, idx; + + s = gctl_get_ascii(req, "size"); + if (*s == '*') + new_size = (unsigned long long)atoll(s); + else + return (0); + + s = gctl_get_ascii(req, index_param); + idx = strtol(s, &val, 10); + if (idx < 1 || *s == '\0' || *val != '\0') + errx(EXIT_FAILURE, "invalid partition index"); + + error = geom_gettree(&mesh); + if (error) + return (error); + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + cp = find_class(&mesh, s); + if (cp == NULL) + errx(EXIT_FAILURE, "Class %s not found.", s); + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(cp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + last = atoll(find_geomcfg(gp, "last")); + + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (atoi(s) == idx) + break; + } + if (pp == NULL) + errx(EXIT_FAILURE, "invalid partition index"); + + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + start = atoll(s) / pp->lg_sectorsize; + } else + start = atoll(s); + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + lba = start + atoll(s) / pp->lg_sectorsize; + } else + lba = atoll(s) + 1; + + if (lba > last) + return (ENOSPC); + size = lba - start; + pp = find_provider(gp, lba); + if (pp == NULL) + new_size = last - start + 1; + else { + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + new_lba = atoll(s) / pp->lg_sectorsize; + } else + new_lba = atoll(s); + /* Is there any free space between current and +* next providers? +*/ + if (new_lba > lba) + new_size = new_lba - start; + else + return (ENOSPC); + } + asprintf(&val, "%llu", new_size); + if (val == NULL) + return (ENOMEM); + gctl_change_param(req, "size", -1, val); + + return (0); +} + +static int gpart_autofill(struct gctl_req *req) { struct gmesh mesh; @@ -257,6 +357,8 @@ gpart_autofill(struct gctl_req *req) int error, has_size, has_start; s = gctl_get_ascii(req, "verb"); + if (strcmp(s, "resize") == 0) + return gpart_autofill_resize(req); if (strcmp(s, "add") != 0) return (0); Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Fri Apr 23 03:11:39 2010 (r207094) +++ head/sbin/geom/class/part/gpart.8 Fri Apr 23 03:14:04 2010 (r207095) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2008 +.Dd April 22, 2010 .Dt GPART 8 .Os .Sh NAME @@ -120,6 +120,13 @@ utility: .Op Fl t Ar type
svn commit: r207096 - head/sbin/geom/class/part
Author: marcel Date: Fri Apr 23 03:37:39 2010 New Revision: 207096 URL: http://svn.freebsd.org/changeset/base/207096 Log: Add and describe GEOM_PART_EBR. Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Fri Apr 23 03:14:04 2010 (r207095) +++ head/sbin/geom/class/part/gpart.8 Fri Apr 23 03:37:39 2010 (r207096) @@ -37,6 +37,7 @@ lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" +.Cd "options GEOM_PART_EBR" .Cd "options GEOM_PART_GPT" .Cd "options GEOM_PART_MBR" .Cd "options GEOM_PART_PC98" @@ -53,6 +54,10 @@ option adds support for the traditional .Bx disklabel. The +.Dv GEOM_PART_EBR +option adds support for the Extended Boot Record (EBR), +which is used to define a logical partition. +The .Dv GEOM_PART_GPT option adds support for the GUID Partition Table (GPT) found on Intel Itanium computers and Intel-based Macintosh computers. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r207077 - in head/sys: amd64/conf arm/conf dev/sound/usb dev/usb dev/usb/controller dev/usb/input dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage dev/usb/wlan i386/conf ia64/co
On Thu, Apr 22, 2010 at 09:31:34PM +, Andrew Thompson wrote: > Author: thompsa > Date: Thu Apr 22 21:31:34 2010 > New Revision: 207077 > URL: http://svn.freebsd.org/changeset/base/207077 > > Log: > Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this > had > the illusion of a tunable setting but was always turned on regardless. > What's the rationale behind enabling it in all configuration files except those of amd64 and pc98? Marius ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"