From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 00:05:44 2010 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 ED87B1065673; Sun, 7 Mar 2010 00:05:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4198FC17; Sun, 7 Mar 2010 00:05:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2705ivp077686; Sun, 7 Mar 2010 00:05:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2705iQX077683; Sun, 7 Mar 2010 00:05:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003070005.o2705iQX077683@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 7 Mar 2010 00:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204813 - in stable/8/sys: kern 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: Sun, 07 Mar 2010 00:05:45 -0000 Author: marcel Date: Sun Mar 7 00:05:44 2010 New Revision: 204813 URL: http://svn.freebsd.org/changeset/base/204813 Log: MFC revs 203696, 203708, 203783 and 203788: Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. Requested by: kib@ Modified: stable/8/sys/kern/sys_process.c stable/8/sys/sys/ptrace.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/kern/sys_process.c ============================================================================== --- stable/8/sys/kern/sys_process.c Sat Mar 6 23:01:10 2010 (r204812) +++ stable/8/sys/kern/sys_process.c Sun Mar 7 00:05:44 2010 (r204813) @@ -72,6 +72,20 @@ struct ptrace_io_desc32 { u_int32_t piod_addr; u_int32_t piod_len; }; + +struct ptrace_vm_entry32 { + int pve_entry; + int pve_timestamp; + uint32_t pve_start; + uint32_t pve_end; + uint32_t pve_offset; + u_int pve_prot; + u_int pve_pathlen; + int32_t pve_fileid; + u_int pve_fsid; + uint32_t pve_path; +}; + #endif /* @@ -339,6 +353,148 @@ proc_rwmem(struct proc *p, struct uio *u return (error); } +static int +ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) +{ + struct vattr vattr; + vm_map_t map; + vm_map_entry_t entry; + vm_object_t obj, tobj, lobj; + struct vmspace *vm; + struct vnode *vp; + char *freepath, *fullpath; + u_int pathlen; + int error, index, vfslocked; + + error = 0; + obj = NULL; + + vm = vmspace_acquire_ref(p); + map = &vm->vm_map; + vm_map_lock_read(map); + + do { + entry = map->header.next; + index = 0; + while (index < pve->pve_entry && entry != &map->header) { + entry = entry->next; + index++; + } + if (index != pve->pve_entry) { + error = EINVAL; + break; + } + while (entry != &map->header && + (entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) { + entry = entry->next; + index++; + } + if (entry == &map->header) { + error = ENOENT; + break; + } + + /* We got an entry. */ + pve->pve_entry = index + 1; + pve->pve_timestamp = map->timestamp; + pve->pve_start = entry->start; + pve->pve_end = entry->end - 1; + pve->pve_offset = entry->offset; + pve->pve_prot = entry->protection; + + /* Backing object's path needed? */ + if (pve->pve_pathlen == 0) + break; + + pathlen = pve->pve_pathlen; + pve->pve_pathlen = 0; + + obj = entry->object.vm_object; + if (obj != NULL) + VM_OBJECT_LOCK(obj); + } while (0); + + vm_map_unlock_read(map); + vmspace_free(vm); + + pve->pve_fsid = VNOVAL; + pve->pve_fileid = VNOVAL; + + if (error == 0 && obj != NULL) { + lobj = obj; + for (tobj = obj; tobj != NULL; tobj = tobj->backing_object) { + if (tobj != obj) + VM_OBJECT_LOCK(tobj); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + lobj = tobj; + pve->pve_offset += tobj->backing_object_offset; + } + vp = (lobj->type == OBJT_VNODE) ? lobj->handle : NULL; + if (vp != NULL) + vref(vp); + if (lobj != obj) + VM_OBJECT_UNLOCK(lobj); + VM_OBJECT_UNLOCK(obj); + + if (vp != NULL) { + freepath = NULL; + fullpath = NULL; + vn_fullpath(td, vp, &fullpath, &freepath); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_lock(vp, LK_SHARED | LK_RETRY); + if (VOP_GETATTR(vp, &vattr, td->td_ucred) == 0) { + pve->pve_fileid = vattr.va_fileid; + pve->pve_fsid = vattr.va_fsid; + } + vput(vp); + VFS_UNLOCK_GIANT(vfslocked); + + if (fullpath != NULL) { + pve->pve_pathlen = strlen(fullpath) + 1; + if (pve->pve_pathlen <= pathlen) { + error = copyout(fullpath, pve->pve_path, + pve->pve_pathlen); + } else + error = ENAMETOOLONG; + } + if (freepath != NULL) + free(freepath, M_TEMP); + } + } + + return (error); +} + +#ifdef COMPAT_IA32 +static int +ptrace_vm_entry32(struct thread *td, struct proc *p, + struct ptrace_vm_entry32 *pve32) +{ + struct ptrace_vm_entry pve; + int error; + + pve.pve_entry = pve32->pve_entry; + pve.pve_pathlen = pve32->pve_pathlen; + pve.pve_path = (void *)(uintptr_t)pve32->pve_path; + + error = ptrace_vm_entry(td, p, &pve); + if (error == 0) { + pve32->pve_entry = pve.pve_entry; + pve32->pve_timestamp = pve.pve_timestamp; + pve32->pve_start = pve.pve_start; + pve32->pve_end = pve.pve_end; + pve32->pve_offset = pve.pve_offset; + pve32->pve_prot = pve.pve_prot; + pve32->pve_fileid = pve.pve_fileid; + pve32->pve_fsid = pve.pve_fsid; + } + + pve32->pve_pathlen = pve.pve_pathlen; + return (error); +} +#endif /* COMPAT_IA32 */ + /* * Process debugging system call. */ @@ -382,6 +538,7 @@ ptrace(struct thread *td, struct ptrace_ union { struct ptrace_io_desc piod; struct ptrace_lwpinfo pl; + struct ptrace_vm_entry pve; struct dbreg dbreg; struct fpreg fpreg; struct reg reg; @@ -390,6 +547,7 @@ ptrace(struct thread *td, struct ptrace_ struct fpreg32 fpreg32; struct reg32 reg32; struct ptrace_io_desc32 piod32; + struct ptrace_vm_entry32 pve32; #endif } r; void *addr; @@ -422,6 +580,9 @@ ptrace(struct thread *td, struct ptrace_ case PT_IO: error = COPYIN(uap->addr, &r.piod, sizeof r.piod); break; + case PT_VM_ENTRY: + error = COPYIN(uap->addr, &r.pve, sizeof r.pve); + break; default: addr = uap->addr; break; @@ -434,6 +595,9 @@ ptrace(struct thread *td, struct ptrace_ return (error); switch (uap->req) { + case PT_VM_ENTRY: + error = COPYOUT(&r.pve, uap->addr, sizeof r.pve); + break; case PT_IO: error = COPYOUT(&r.piod, uap->addr, sizeof r.piod); break; @@ -970,6 +1134,21 @@ kern_ptrace(struct thread *td, int req, PROC_LOCK(p); break; + case PT_VM_TIMESTAMP: + td->td_retval[0] = p->p_vmspace->vm_map.timestamp; + break; + + case PT_VM_ENTRY: + PROC_UNLOCK(p); +#ifdef COMPAT_IA32 + if (wrap32) + error = ptrace_vm_entry32(td, p, addr); + else +#endif + error = ptrace_vm_entry(td, p, addr); + PROC_LOCK(p); + break; + default: #ifdef __HAVE_PTRACE_MACHDEP if (req >= PT_FIRSTMACH) { Modified: stable/8/sys/sys/ptrace.h ============================================================================== --- stable/8/sys/sys/ptrace.h Sat Mar 6 23:01:10 2010 (r204812) +++ stable/8/sys/sys/ptrace.h Sun Mar 7 00:05:44 2010 (r204813) @@ -67,6 +67,10 @@ #define PT_SETFPREGS 36 /* set floating-point registers */ #define PT_GETDBREGS 37 /* get debugging registers */ #define PT_SETDBREGS 38 /* set debugging registers */ + +#define PT_VM_TIMESTAMP 40 /* Get VM version (timestamp) */ +#define PT_VM_ENTRY 41 /* Get VM map (entry) */ + #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ @@ -98,6 +102,20 @@ struct ptrace_lwpinfo { sigset_t pl_siglist; /* LWP pending signal */ }; +/* Argument structure for PT_VM_ENTRY. */ +struct ptrace_vm_entry { + int pve_entry; /* Entry number used for iteration. */ + int pve_timestamp; /* Generation number of VM map. */ + u_long pve_start; /* Start VA of range. */ + u_long pve_end; /* End VA of range (incl). */ + u_long pve_offset; /* Offset in backing object. */ + u_int pve_prot; /* Protection of memory range. */ + u_int pve_pathlen; /* Size of path. */ + long pve_fileid; /* File ID. */ + uint32_t pve_fsid; /* File system ID. */ + char *pve_path; /* Path name of object. */ +}; + #ifdef _KERNEL #define PTRACESTOP_SC(p, td, flag) \ From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 00:07:01 2010 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 50646106566C; Sun, 7 Mar 2010 00:07:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF198FC12; Sun, 7 Mar 2010 00:07:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27071Kw078016; Sun, 7 Mar 2010 00:07:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o270711u078014; Sun, 7 Mar 2010 00:07:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201003070007.o270711u078014@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 7 Mar 2010 00:07:01 +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: r204814 - 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: Sun, 07 Mar 2010 00:07:01 -0000 Author: marcel Date: Sun Mar 7 00:07:00 2010 New Revision: 204814 URL: http://svn.freebsd.org/changeset/base/204814 Log: MFC revs 203696, 203783: Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can obtain the memory map of the traced process. Requested by: kib@ Modified: stable/8/lib/libc/sys/ptrace.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/ptrace.2 ============================================================================== --- stable/8/lib/libc/sys/ptrace.2 Sun Mar 7 00:05:44 2010 (r204813) +++ stable/8/lib/libc/sys/ptrace.2 Sun Mar 7 00:07:00 2010 (r204814) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd March 27, 2009 +.Dd February 11, 2010 .Dt PTRACE 2 .Os .Sh NAME @@ -327,6 +327,68 @@ This request will trace the specified pr .It PT_SYSCALL This request will trace the specified process on each system call entry and exit. +.It PT_VM_TIMESTAMP +This request returns the generation number or timestamp of the memory map of +the traced process as the return value from +.Fn ptrace . +This provides a low-cost way for the tracing process to determine if the +VM map changed since the last time this request was made. +.It PT_VM_ENTRY +This request is used to iterate over the entries of the VM map of the traced +process. +The +.Fa addr +argument specifies a pointer to a +.Vt "struct ptrace_vm_entry" , +which is defined as follows: +.Bd -literal +struct ptrace_vm_entry { + int pve_entry; + int pve_timestamp; + u_long pve_start; + u_long pve_end; + u_long pve_offset; + u_int pve_prot; + u_int pve_pathlen; + long pve_fileid; + uint32_t pve_fsid; + char *pve_path; +}; +.Ed +.Pp +The first entry is returned by setting +.Va pve_entry +to zero. +Subsequent entries are returned by leaving +.Va pve_entry +unmodified from the value returned by previous requests. +The +.Va pve_timestamp +field can be used to detect changes to the VM map while iterating over the +entries. +The tracing process can then take appropriate action, such as restarting. +By setting +.Va pve_pathlen +to a non-zero value on entry, the pathname of the backing object is returned +in the buffer pointed to by +.Va pve_path , +provided the entry is backed by a vnode. +The +.Va pve_pathlen +field is updated with the actual length of the pathname (including the +terminating null character). +The +.Va pve_offset +field is the offset within the backing object at which the range starts. +The range is located in the VM space at +.Va pve_start +and extends up to +.Va pve_end +(inclusive). +.Pp +The +.Fa data +argument is ignored. .El .Pp Additionally, machine-specific requests can exist. @@ -376,6 +438,11 @@ or .Dv PT_SETDBREGS was attempted on a process with no valid register set. (This is normally true only of system processes.) +.It +.Dv PT_VM_ENTRY +was given an invalid value for +.Fa pve_entry . +This can also be caused by changes to the VM map of the process. .El .It Bq Er EBUSY .Bl -bullet -compact @@ -405,6 +472,22 @@ on a process in violation of the require .Dv PT_ATTACH above. .El +.It Bq Er ENOENT +.Bl -bullet -compact +.It +.Dv PT_VM_ENTRY +previously returned the last entry of the memory map. +No more entries exist. +.El +.It Bq Er ENAMETOOLONG +.Bl -bullet -compact +.It +.Dv PT_VM_ENTRY +cannot return the pathname of the backing object because the buffer is not big +enough. +.Fa pve_pathlen +holds the minimum buffer size required on return. +.El .El .Sh SEE ALSO .Xr execve 2 , From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 02:02:07 2010 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 F1075106566B; Sun, 7 Mar 2010 02:02:07 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A78DD8FC18; Sun, 7 Mar 2010 02:02:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27227h2003460; Sun, 7 Mar 2010 02:02:07 GMT (envelope-from gshapiro@svn.freebsd.org) Received: (from gshapiro@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27227nC003458; Sun, 7 Mar 2010 02:02:07 GMT (envelope-from gshapiro@svn.freebsd.org) Message-Id: <201003070202.o27227nC003458@svn.freebsd.org> From: Gregory Neil Shapiro Date: Sun, 7 Mar 2010 02:02:07 +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: r204815 - stable/8/lib/libsm 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: Sun, 07 Mar 2010 02:02:08 -0000 Author: gshapiro Date: Sun Mar 7 02:02:07 2010 New Revision: 204815 URL: http://svn.freebsd.org/changeset/base/204815 Log: MFC: Enable the use of nanosleep() instead of using pause() and signals. This Makefile change can be removed when the next version of sendmail is imported as it will have this built in to the FreeBSD conf.h section. Modified: stable/8/lib/libsm/Makefile Directory Properties: stable/8/lib/libsm/ (props changed) Modified: stable/8/lib/libsm/Makefile ============================================================================== --- stable/8/lib/libsm/Makefile Sun Mar 7 00:07:00 2010 (r204814) +++ stable/8/lib/libsm/Makefile Sun Mar 7 02:02:07 2010 (r204815) @@ -7,6 +7,7 @@ SENDMAIL_DIR=${.CURDIR}/../../contrib/se CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. CFLAGS+=-DNEWDB -DNIS -DMAP_REGEX -DNOT_SENDMAIL +CFLAGS+=-DHAVE_NANOSLEEP .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DNETINET6 From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 09:52:36 2010 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 0B7D6106564A; Sun, 7 Mar 2010 09:52:36 +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 E38518FC1B; Sun, 7 Mar 2010 09:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o279qZpa011067; Sun, 7 Mar 2010 09:52:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o279qZQa011064; Sun, 7 Mar 2010 09:52:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201003070952.o279qZQa011064@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 7 Mar 2010 09:52:35 +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: r204823 - stable/8/sys/net 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: Sun, 07 Mar 2010 09:52:36 -0000 Author: kib Date: Sun Mar 7 09:52:35 2010 New Revision: 204823 URL: http://svn.freebsd.org/changeset/base/204823 Log: MFC r204464: Several fixes for miscellaneous clone handlers in if_tun and if_tap. Modified: stable/8/sys/net/if_tap.c stable/8/sys/net/if_tun.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/net/if_tap.c ============================================================================== --- stable/8/sys/net/if_tap.c Sun Mar 7 09:02:52 2010 (r204822) +++ stable/8/sys/net/if_tap.c Sun Mar 7 09:52:35 2010 (r204823) @@ -192,10 +192,6 @@ tap_clone_create(struct if_clone *ifc, i if (i) { dev = make_dev(&tap_cdevsw, unit | extra, UID_ROOT, GID_WHEEL, 0600, "%s%d", ifc->ifc_name, unit); - if (dev != NULL) { - dev_ref(dev); - dev->si_flags |= SI_CHEAPCLONE; - } } tapcreate(dev); @@ -300,6 +296,7 @@ tapmodevent(module_t mod, int type, void EVENTHANDLER_DEREGISTER(dev_clone, eh_tag); if_clone_detach(&tap_cloner); if_clone_detach(&vmnet_cloner); + drain_dev_clone_events(); mtx_lock(&tapmtx); while ((tp = SLIST_FIRST(&taphead)) != NULL) { @@ -381,12 +378,8 @@ tapclone(void *arg, struct ucred *cred, name = devname; } - *dev = make_dev(&tap_cdevsw, unit | extra, - UID_ROOT, GID_WHEEL, 0600, "%s", name); - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } + *dev = make_dev_credf(MAKEDEV_REF, &tap_cdevsw, unit | extra, + cred, UID_ROOT, GID_WHEEL, 0600, "%s", name); } if_clone_create(name, namelen, NULL); Modified: stable/8/sys/net/if_tun.c ============================================================================== --- stable/8/sys/net/if_tun.c Sun Mar 7 09:02:52 2010 (r204822) +++ stable/8/sys/net/if_tun.c Sun Mar 7 09:52:35 2010 (r204823) @@ -188,10 +188,6 @@ tun_clone_create(struct if_clone *ifc, i /* No preexisting struct cdev *, create one */ dev = make_dev(&tun_cdevsw, unit, UID_UUCP, GID_DIALER, 0600, "%s%d", ifc->ifc_name, unit); - if (dev != NULL) { - dev_ref(dev); - dev->si_flags |= SI_CHEAPCLONE; - } } tuncreate(ifc->ifc_name, dev); @@ -237,12 +233,8 @@ tunclone(void *arg, struct ucred *cred, name = devname; } /* No preexisting struct cdev *, create one */ - *dev = make_dev(&tun_cdevsw, u, + *dev = make_dev_credf(MAKEDEV_REF, &tun_cdevsw, u, cred, UID_UUCP, GID_DIALER, 0600, "%s", name); - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } } if_clone_create(name, namelen, NULL); @@ -303,6 +295,7 @@ tunmodevent(module_t mod, int type, void case MOD_UNLOAD: if_clone_detach(&tun_cloner); EVENTHANDLER_DEREGISTER(dev_clone, tag); + drain_dev_clone_events(); mtx_lock(&tunmtx); while ((tp = TAILQ_FIRST(&tunhead)) != NULL) { From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 12:29:50 2010 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 BF429106564A; Sun, 7 Mar 2010 12:29:50 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9333A8FC19; Sun, 7 Mar 2010 12:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27CToLq047226; Sun, 7 Mar 2010 12:29:50 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27CTosa047224; Sun, 7 Mar 2010 12:29:50 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201003071229.o27CTosa047224@svn.freebsd.org> From: Ivan Voras Date: Sun, 7 Mar 2010 12:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204827 - in stable/8/sys: kern 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: Sun, 07 Mar 2010 12:29:50 -0000 Author: ivoras Date: Sun Mar 7 12:29:50 2010 New Revision: 204827 URL: http://svn.freebsd.org/changeset/base/204827 Log: MFC r204611, r204633: Comment and better sysctl documentation string for VM guest detection variable and sysctl. Modified: stable/8/sys/kern/subr_param.c stable/8/sys/sys/systm.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Sun Mar 7 10:47:47 2010 (r204826) +++ stable/8/sys/kern/subr_param.c Sun Mar 7 12:29:50 2010 (r204827) @@ -124,7 +124,7 @@ SYSCTL_ULONG(_kern, OID_AUTO, sgrowsiz, "Amount to grow stack on a stack fault"); SYSCTL_PROC(_kern, OID_AUTO, vm_guest, CTLFLAG_RD | CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest, "A", - "Virtual machine detected? (none|generic|xen)"); + "Virtual machine guest detected? (none|generic|xen)"); /* * These have to be allocated somewhere; allocating Modified: stable/8/sys/sys/systm.h ============================================================================== --- stable/8/sys/sys/systm.h Sun Mar 7 10:47:47 2010 (r204826) +++ stable/8/sys/sys/systm.h Sun Mar 7 12:29:50 2010 (r204827) @@ -67,6 +67,11 @@ extern int maxusers; /* system tune hin extern int ngroups_max; /* max # of supplemental groups */ extern int vm_guest; /* Running as virtual machine guest? */ +/* + * Detected virtual machine guest types. The intention is to expand + * and/or add to the VM_GUEST_VM type if specific VM functionality is + * ever implemented (e.g. vendor-specific paravirtualization features). + */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN }; #ifdef INVARIANTS /* The option is always available */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 14:29:12 2010 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 7ECB9106566C; Sun, 7 Mar 2010 14:29:12 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 532E78FC1A; Sun, 7 Mar 2010 14:29:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27ETChJ073639; Sun, 7 Mar 2010 14:29:12 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27ETCmL073637; Sun, 7 Mar 2010 14:29:12 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003071429.o27ETCmL073637@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 7 Mar 2010 14:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204831 - 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: Sun, 07 Mar 2010 14:29:12 -0000 Author: luigi Date: Sun Mar 7 14:29:12 2010 New Revision: 204831 URL: http://svn.freebsd.org/changeset/base/204831 Log: MFC r197137 and r200510, which fixes a problem in 8.0 with callouts firing one tick too late. See the logs for the original patch for details. RELENG_7 is not affected by the problem. Modified: stable/8/sys/kern/kern_timeout.c Modified: stable/8/sys/kern/kern_timeout.c ============================================================================== --- stable/8/sys/kern/kern_timeout.c Sun Mar 7 14:23:44 2010 (r204830) +++ stable/8/sys/kern/kern_timeout.c Sun Mar 7 14:29:12 2010 (r204831) @@ -82,6 +82,23 @@ SYSCTL_INT(_debug, OID_AUTO, to_avg_mpca */ int callwheelsize, callwheelbits, callwheelmask; +/* + * There is one struct callout_cpu per cpu, holding all relevant + * state for the callout processing thread on the individual CPU. + * In particular: + * cc_ticks is incremented once per tick in callout_cpu(). + * It tracks the global 'ticks' but in a way that the individual + * threads should not worry about races in the order in which + * hardclock() and hardclock_cpu() run on the various CPUs. + * cc_softclock is advanced in callout_cpu() to point to the + * first entry in cc_callwheel that may need handling. In turn, + * a softclock() is scheduled so it can serve the various entries i + * such that cc_softclock <= i <= cc_ticks . + * XXX maybe cc_softclock and cc_ticks should be volatile ? + * + * cc_ticks is also used in callout_reset_cpu() to determine + * when the callout should be served. + */ struct callout_cpu { struct mtx cc_lock; struct callout *cc_callout; @@ -90,6 +107,7 @@ struct callout_cpu { struct callout *cc_next; struct callout *cc_curr; void *cc_cookie; + int cc_ticks; int cc_softticks; int cc_cancel; int cc_waiting; @@ -244,7 +262,8 @@ callout_tick(void) need_softclock = 0; cc = CC_SELF(); mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET); - for (; (cc->cc_softticks - ticks) < 0; cc->cc_softticks++) { + cc->cc_ticks++; + for (; (cc->cc_softticks - cc->cc_ticks) <= 0; cc->cc_softticks++) { bucket = cc->cc_softticks & callwheelmask; if (!TAILQ_EMPTY(&cc->cc_callwheel[bucket])) { need_softclock = 1; @@ -323,7 +342,7 @@ softclock(void *arg) steps = 0; cc = (struct callout_cpu *)arg; CC_LOCK(cc); - while (cc->cc_softticks != ticks) { + while (cc->cc_softticks - 1 != cc->cc_ticks) { /* * cc_softticks may be modified by hard clock, so cache * it while we work on a given bucket. @@ -622,7 +641,7 @@ retry: c->c_arg = arg; c->c_flags |= (CALLOUT_ACTIVE | CALLOUT_PENDING); c->c_func = ftn; - c->c_time = ticks + to_ticks; + c->c_time = cc->cc_ticks + to_ticks; TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], c, c_links.tqe); CTR5(KTR_CALLOUT, "%sscheduled %p func %p arg %p in %d", From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 15:07:24 2010 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 8DC20106566B; Sun, 7 Mar 2010 15:07:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BAC08FC1C; Sun, 7 Mar 2010 15:07:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27F7Ow1082207; Sun, 7 Mar 2010 15:07:24 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27F7OaZ082202; Sun, 7 Mar 2010 15:07:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003071507.o27F7OaZ082202@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 7 Mar 2010 15:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204835 - in stable/8/release/picobsd: bridge build floppy.tree/etc 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: Sun, 07 Mar 2010 15:07:24 -0000 Author: luigi Date: Sun Mar 7 15:07:24 2010 New Revision: 204835 URL: http://svn.freebsd.org/changeset/base/204835 Log: reduce diffs from HEAD Modified: stable/8/release/picobsd/bridge/PICOBSD stable/8/release/picobsd/bridge/crunch.conf stable/8/release/picobsd/build/mfs.mtree stable/8/release/picobsd/floppy.tree/etc/master.passwd Modified: stable/8/release/picobsd/bridge/PICOBSD ============================================================================== --- stable/8/release/picobsd/bridge/PICOBSD Sun Mar 7 14:58:25 2010 (r204834) +++ stable/8/release/picobsd/bridge/PICOBSD Sun Mar 7 15:07:24 2010 (r204835) @@ -16,8 +16,8 @@ cpu I586_CPU cpu I686_CPU ident PICOBSD -options SMP -device apic +options SMP +device apic options SCHED_4BSD # mandatory to have one scheduler #options MATH_EMULATE #Support for x87 emulation @@ -48,7 +48,7 @@ options DUMMYNET device if_bridge # Running with less than 1000 seems to give poor timing on # qemu, so we set HZ explicitly. -options HZ=1000 +options HZ=1000 device random # used by ssh device pci Modified: stable/8/release/picobsd/bridge/crunch.conf ============================================================================== --- stable/8/release/picobsd/bridge/crunch.conf Sun Mar 7 14:58:25 2010 (r204834) +++ stable/8/release/picobsd/bridge/crunch.conf Sun Mar 7 15:07:24 2010 (r204835) @@ -180,4 +180,4 @@ libs_so -lkvm libs_so -lz libs_so -lbsdxml libs_so -lsbuf -libs_so -ljail # used by ifconfig +libs_so -ljail # used by ifconfig Modified: stable/8/release/picobsd/build/mfs.mtree ============================================================================== --- stable/8/release/picobsd/build/mfs.mtree Sun Mar 7 14:58:25 2010 (r204834) +++ stable/8/release/picobsd/build/mfs.mtree Sun Mar 7 15:07:24 2010 (r204835) @@ -58,6 +58,8 @@ var db .. + empty + .. run .. spool Modified: stable/8/release/picobsd/floppy.tree/etc/master.passwd ============================================================================== --- stable/8/release/picobsd/floppy.tree/etc/master.passwd Sun Mar 7 14:58:25 2010 (r204834) +++ stable/8/release/picobsd/floppy.tree/etc/master.passwd Sun Mar 7 15:07:24 2010 (r204835) @@ -1,3 +1,4 @@ +# $FreeBSD$ root:$1$xOOaGnKU$U9QdsCI40XXcCUMBN.7Az.:0:0::0:0:Charlie &:/root:/bin/sh toor:*:0:0::0:0:Bourne-again Superuser:/root: daemon:*:1:1::0:0:Owner of many system processes:/root:/nonexistent @@ -5,4 +6,5 @@ operator:*:2:20::0:0:System &:/usr/guest bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/nonexistent tty:*:4:65533::0:0:Tty Sandbox:/:/nonexistent nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/nonexistent +_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin user:*:1002:1002:Sample User:0:0:user:/home/user:/bin/sh From owner-svn-src-stable-8@FreeBSD.ORG Sun Mar 7 16:24:33 2010 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 88770106566C; Sun, 7 Mar 2010 16:24:33 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75CE68FC0C; Sun, 7 Mar 2010 16:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o27GOXUV099473; Sun, 7 Mar 2010 16:24:33 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o27GOXve099467; Sun, 7 Mar 2010 16:24:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003071624.o27GOXve099467@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 7 Mar 2010 16:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204839 - stable/8/release/picobsd/qemu 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: Sun, 07 Mar 2010 16:24:33 -0000 Author: luigi Date: Sun Mar 7 16:24:33 2010 New Revision: 204839 URL: http://svn.freebsd.org/changeset/base/204839 Log: MFC qemu configuration Added: stable/8/release/picobsd/qemu/ stable/8/release/picobsd/qemu/PICOBSD (contents, props changed) stable/8/release/picobsd/qemu/PICOBSD.hints (contents, props changed) stable/8/release/picobsd/qemu/config (contents, props changed) stable/8/release/picobsd/qemu/crunch.conf (contents, props changed) stable/8/release/picobsd/qemu/floppy.tree.exclude - copied unchanged from r204836, stable/8/release/picobsd/bridge/floppy.tree.exclude Added: stable/8/release/picobsd/qemu/PICOBSD ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/release/picobsd/qemu/PICOBSD Sun Mar 7 16:24:33 2010 (r204839) @@ -0,0 +1,122 @@ +# +# $FreeBSD$ +# A configuration file to run tests on qemu. +# We disable SMP because it does not work well with qemu, and set HZ=1000 +# to avoid it being overridden. +# +# Line starting with #PicoBSD contains PicoBSD build parameters +#marker def_sz init MFS_inodes floppy_inodes +#PicoBSD 18000 init 8192 32768 +options MD_ROOT_SIZE=18000 # same as def_sz + +hints "PICOBSD.hints" + +# values accessible through getenv() +# env "PICOBSD.env" + +#cpu I486_CPU +cpu I586_CPU +cpu I686_CPU +ident PICOBSD + +#options SMP +#device apic + +options SCHED_4BSD # mandatory to have one scheduler +#options MATH_EMULATE #Support for x87 emulation +options INET #InterNETworking +#options INET6 +options FFS #Berkeley Fast Filesystem +#options BOOTP #Use BOOTP to obtain IP address/hostname +options MD_ROOT #MD is a potential root device + +#options NFS #Network Filesystem +#options NFS_ROOT #NFS usable as root device, NFS required + +#options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options CD9660_ROOT #CD-ROM usable as root, CD9660 required +#options DEVFS #Device Filesystem +#options PROCFS #Process filesystem +options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] + +options KDB +options DDB + +options IPFIREWALL +options IPFIREWALL_DEFAULT_TO_ACCEPT +options IPDIVERT # divert (for natd) + +# Support for bridging and bandwidth limiting +options DUMMYNET +device if_bridge +# Running with less than 1000 seems to give poor timing on +# qemu, so we set HZ explicitly. +options HZ=1000 + +device random # used by ssh +device pci + +# Floppy drives +device fdc + +# ATA and ATAPI devices +#device ata +#device atadisk # ATA disk drives +#device atapicd # ATAPI CDROM drives +#options ATA_STATIC_ID #Static device numbering + +# atkbdc0 controls both the keyboard and the PS/2 mouse +device atkbdc # At keyboard controller +device atkbd +#device psm # do we need the mouse ?? + +device vga # VGA screen + +# syscons is the default console driver, resembling an SCO console +device sc + +# Serial (COM) ports +device uart + +# Audio support +#device pcm + +# PCCARD (PCMCIA) support +#device card # pccard bus +#device pcic # PCMCIA bridge + +# Parallel port +#device ppc +#device ppbus # Parallel port bus (required) +#device lpt # Printer +#device plip # TCP/IP over parallel +#device ppi # Parallel port interface device + +# +# The following Ethernet NICs are all PCI devices. +# +device miibus +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device nfe # nVidia nForce MCP on-board Ethernet +#device xl # 3Com +device rl # RealTek 8129/8139 +device re # RealTek 8139C+/8169/8169S/8110S +device sis # National/SiS +device dc # DEC/Intel 21143 and various workalikes +device ed + +device loop # Network loopback +device ether # Ethernet support +device tun # Packet tunnel. +device pty # Pseudo-ttys (telnet etc) +device md # Memory "disks" +#device gif 4 # IPv6 and IPv4 tunneling +#device faith 1 # IPv6-to-IPv4 relaying (translation) +device tap + +#options DEVICE_POLLING + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +device bpf # Berkeley packet filter Added: stable/8/release/picobsd/qemu/PICOBSD.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/release/picobsd/qemu/PICOBSD.hints Sun Mar 7 16:24:33 2010 (r204839) @@ -0,0 +1,39 @@ +# $FreeBSD$ +hint.fdc.0.at="isa" +hint.fdc.0.port="0x3F0" +hint.fdc.0.irq="6" +hint.fdc.0.drq="2" +hint.fd.0.at="fdc0" +hint.fd.0.drive="0" +hint.ata.0.at="isa" +hint.ata.0.port="0x1F0" +hint.ata.0.irq="14" +hint.ata.1.at="isa" +hint.ata.1.port="0x170" +hint.ata.1.irq="15" +hint.atkbdc.0.at="isa" +hint.atkbdc.0.port="0x060" +hint.atkbd.0.at="atkbdc" +hint.atkbd.0.irq="1" +hint.psm.0.at="atkbdc" +hint.psm.0.irq="12" +hint.vga.0.at="isa" +hint.sc.0.at="isa" +hint.npx.0.at="nexus" +hint.npx.0.port="0x0F0" +hint.npx.0.irq="13" +hint.uart.0.at="isa" +hint.uart.0.port="0x3F8" +hint.uart.0.flags="0x10" +hint.uart.0.irq="4" +hint.uart.1.at="isa" +hint.uart.1.port="0x2F8" +hint.uart.1.irq="3" +hint.ed.0.at="isa" +hint.ed.0.port="0x280" +hint.ed.0.irq="5" +hint.ed.0.maddr="0xd8000" +hint.ed.1.at="isa" +hint.ed.1.port="0x300" +hint.ed.1.irq="5" +hint.ed.1.maddr="0xd0000" Added: stable/8/release/picobsd/qemu/config ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/release/picobsd/qemu/config Sun Mar 7 16:24:33 2010 (r204839) @@ -0,0 +1,26 @@ +# configuration for picobsd build script. +# $FreeBSD$ +# it should only contain variable definitions -- it is sourced +# by the shell much like rc.conf* files + +fd_size="8192" + +# To copy individual files you can use the function do_copyfiles_user +# as below (find_progs locates the programs and their libraries, +# then you manually copy them. +#copy_files=" +#" +do_copyfiles_user() { + local dst=$1 # the destination root + log "--- put the libraries in /usr/lib to avoid conflicts" + mkdir -p ${dst}/usr/lib + log "-- import dropbear from its build directory --" + find_progs -L / -P /usr/ports/security/dropbear/work/dropbear-0.52 \ + dbclient dropbear + cp -p ${u_progs} ${dst}/bin + cp -p ${u_libs} ${dst}/usr/lib + log "--- also import ssh, scp and sshd ---" + find_progs -L / /usr/bin/ssh /usr/bin/scp /usr/sbin/sshd + cp -p ${u_progs} ${dst}/bin + cp -p ${u_libs} ${dst}/usr/lib +} Added: stable/8/release/picobsd/qemu/crunch.conf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/release/picobsd/qemu/crunch.conf Sun Mar 7 16:24:33 2010 (r204839) @@ -0,0 +1,191 @@ +# +# $FreeBSD$ +# +# Configuration file for "qemu" images.. +# +# Depending on your needs, you will almost surely need to +# add/remove/change programs according to your needs. +# Remember that some programs require matching kernel options to +# enable device drivers etc. +# +# To figure out how much space is used by each program, do +# +# size build_dir-bridge/crunch/*lo +# +# Remember that programs require libraries, which add up to the +# total size. The final binary is build_dir-bridge/mfs.tree/stand/crunch +# and you can check which libraries it uses with +# +# ldd build_dir-bridge/mfs.tree/stand/crunch + +# crunchgen configuration to build the crunched binary, see "man crunchgen" +# We need to specify generic build options, the places where to look +# for sources, and the list of program and libraries we want to put +# in the crunched binary. +# +# NOTE: the string "/usr/src" below will be automatically replaced with +# the path set in the 'build' script. + +# Default build options. Basically tell the Makefiles +# that to use the most compact possible version of the code. + +buildopts -DNO_PAM -DRELEASE_CRUNCH -DPPP_NO_NETGRAPH +buildopts -DTRACEROUTE_NO_IPSEC -DNO_INET6 +buildopts -DWITHOUT_IPX + +# Directories where to look for sources of various binaries. +# @__CWD__@ is a magic keyword in the picobsd's (Makefile.conf) +# which is replaced with the directory with the picobsd configuration +# corresponding to your image. This way you can have custom sources +# in that directory overriding system programs. + +srcdirs @__CWD__@/src + +# Some programs are especially written for PicoBSD and reside in +# release/picobsd/tinyware. +# Put this entry near the head of the list to override standard binaries. + +srcdirs /usr/src/release/picobsd/tinyware + +# Other standard locations for sources. +# If a program uses its own source directory, add + +srcdirs /usr/src/bin +srcdirs /usr/src/sbin/i386 +srcdirs /usr/src/sbin +srcdirs /usr/src/usr.bin +srcdirs /usr/src/gnu/usr.bin +srcdirs /usr/src/usr.sbin +srcdirs /usr/src/libexec + +# For programs that reside in different places, the best option +# is to use the command "special XXX srcdir YYY" where XXX is the +# program name and YYY is the directory path. +# "special XXX ..." can be used to specify more options, see again +# the crunchgen manpage. + +#--- Basic configuraton +# init is always necessary (unless you have a replacement, oinit) +progs init + +# fsck is almost always necessary, unless you have everything on the +# image and use 'tar' or something similar to read/write raw blocks +# from the floppy. + +progs fsck + +# ifconfig is needed if you want to configure interfaces. +progs ifconfig + +# You will also need a shell and a bunch of utilities. +# The standard shell is not that large, but you need many +# external programs. In fact most of them do not take much space +# as they merely issue a system call, and print the result. +# For a more compact version of shell and utilities, you could +# try busybox, however most system management commands in busybox +# will not work as they use linux-specific interfaces. + +progs sh +ln sh -sh + +# the small utilities +progs echo +progs pwd mkdir rmdir +progs chmod chown +ln chown chgrp +progs mv ln cp rm ls +progs cat tail tee +progs test +ln test [ + +progs less +ln less more +progs mount +progs minigzip +ln minigzip gzip +progs kill +progs df +progs ps +progs ns # this is the picobsd version +ln ns netstat +progs vm +progs hostname +progs login +progs getty +progs stty +progs w +progs msg +ln msg dmesg +progs reboot + +progs sysctl +progs swapon +progs pwd_mkdb +progs umount +progs du +progs passwd + +progs route + +# If you want to run natd, remember the alias library +progs natd +libs_so -lalias # natd +progs tcpdump +special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump +libs_so -lpcap # used by tcpdump + +# ppp is rather large. Note that as of Jan.01, RELEASE_CRUNCH +# makes ppp not use libalias, so you cannot have aliasing. +#progs ppp + +# You need an editor. ee is relatively small, though there are +# smaller ones. vi is much larger. +# The editor also usually need a curses library. +progs ee + +progs arp + +# these require libgeom +# progs bsdlabel fdisk mdconfig + +progs kldload kldunload kldstat +progs kldxref +progs grep +libs_so -lgnuregex -lbz2 +# dhclient-script requires 'sed' +progs dhclient +progs sed +progs date +progs time +progs ping +#progs routed +progs ipfw +progs traceroute +progs mdmfs +ln mdmfs mount_mfs +# Various filesystem support -- remember to enable the kernel parts +# progs mount_msdosfs +progs mount_nfs +# progs mount_cd9660 +ln mount_nfs nfs +ln mount_cd9660 cd9660 +#progs newfs +#ln newfs mount_mfs +# ln mount_msdosfs msdos + +# For a small ssh client/server use dropbear + +# Now the libraries +libs_so -lc # the C library +libs_so -ll # used by sh (really ?) +libs_so -lufs # used by mount +### ee uses ncurses but as a dependency +#libs_so -lncurses +libs_so -lm +libs_so -ledit -lutil +libs_so -lcrypt +libs_so -lkvm +libs_so -lz +libs_so -lbsdxml +libs_so -lsbuf +libs_so -ljail # used by ifconfig Copied: stable/8/release/picobsd/qemu/floppy.tree.exclude (from r204836, stable/8/release/picobsd/bridge/floppy.tree.exclude) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/release/picobsd/qemu/floppy.tree.exclude Sun Mar 7 16:24:33 2010 (r204839, copy of r204836, stable/8/release/picobsd/bridge/floppy.tree.exclude) @@ -0,0 +1,2 @@ +etc/snmpd.conf +etc/ppp From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 8 07:54:35 2010 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 50AA71065678; Mon, 8 Mar 2010 07:54:35 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 817338FC65; Mon, 8 Mar 2010 07:53:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o287riBV023831; Mon, 8 Mar 2010 07:53:44 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o287riDO023827; Mon, 8 Mar 2010 07:53:44 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201003080753.o287riDO023827@svn.freebsd.org> From: Fabien Thomas Date: Mon, 8 Mar 2010 07:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204859 - stable/8/usr.sbin/pmcstat 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, 08 Mar 2010 07:54:35 -0000 Author: fabient Date: Mon Mar 8 07:53:44 2010 New Revision: 204859 URL: http://svn.freebsd.org/changeset/base/204859 Log: MFC r204783: Bug fixed: - no display on serial terminal in top mode. - display alignment for continuation string. - correct invalid value used for display limit. Modified: stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c stable/8/usr.sbin/pmcstat/pmcpl_calltree.c stable/8/usr.sbin/pmcstat/pmcstat.c Directory Properties: stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c Mon Mar 8 06:00:42 2010 (r204858) +++ stable/8/usr.sbin/pmcstat/pmcpl_callgraph.c Mon Mar 8 07:53:44 2010 (r204859) @@ -550,7 +550,7 @@ pmcstat_cgnode_topprint(struct pmcstat_c len = ns_len + vs_len + 1; if (width - len < 0) { - PMCSTAT_PRINTW("..."); + PMCSTAT_PRINTW(" ..."); break; } width -= len; Modified: stable/8/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Mon Mar 8 06:00:42 2010 (r204858) +++ stable/8/usr.sbin/pmcstat/pmcpl_calltree.c Mon Mar 8 07:53:44 2010 (r204859) @@ -387,7 +387,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct if (ct->pct_narc == 0) { pmcpl_ct_topscreen[x+1][*y] = NULL; if (*y >= PMCPL_CT_MAXLINE || - *y >= pmcstat_displaywidth) + *y >= pmcstat_displayheight) return 1; *y = *y + 1; for (i=0; i < x; i++) Modified: stable/8/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.c Mon Mar 8 06:00:42 2010 (r204858) +++ stable/8/usr.sbin/pmcstat/pmcstat.c Mon Mar 8 07:53:44 2010 (r204859) @@ -1311,6 +1311,9 @@ main(int argc, char **argv) intrflush(stdscr, FALSE); keypad(stdscr, TRUE); clear(); + /* Get terminal width / height with ncurses. */ + getmaxyx(stdscr, pmcstat_displayheight, pmcstat_displaywidth); + pmcstat_displayheight--; pmcstat_displaywidth--; atexit(pmcstat_topexit); } } From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 8 13:37:14 2010 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 5BD1D1065672; Mon, 8 Mar 2010 13:37:14 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 498DB8FC1A; Mon, 8 Mar 2010 13:37:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o28DbEna006863; Mon, 8 Mar 2010 13:37:14 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28DbEFY006860; Mon, 8 Mar 2010 13:37:14 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003081337.o28DbEFY006860@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 8 Mar 2010 13:37:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204868 - in stable/8/release/picobsd: build floppy.tree 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, 08 Mar 2010 13:37:14 -0000 Author: luigi Date: Mon Mar 8 13:37:14 2010 New Revision: 204868 URL: http://svn.freebsd.org/changeset/base/204868 Log: MFC main build script and missing directory Added: stable/8/release/picobsd/floppy.tree/sbin - copied unchanged from r204826, head/release/picobsd/floppy.tree/sbin/dhclient-script Modified: stable/8/release/picobsd/build/picobsd Modified: stable/8/release/picobsd/build/picobsd ============================================================================== --- stable/8/release/picobsd/build/picobsd Mon Mar 8 13:12:35 2010 (r204867) +++ stable/8/release/picobsd/build/picobsd Mon Mar 8 13:37:14 2010 (r204868) @@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt local no log "create_includes_and_libraries2() for ${SRC}" if [ ${OSVERSION} -ge 600000 ] ; then - no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1" + no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi @@ -568,10 +568,17 @@ do_links() { # rootdir varname # find_progs is a helper function to locate the named programs # or libraries in ${o_objdir} or ${_SHLIBDIRPREFIX}, # and return the full pathnames. -# Sets ${u_progs} to the list of programs, and ${u_libs} +# Called as "find_progs [-L libpath] [-P binpath] prog1 prog2 ... " +# On return it sets ${u_progs} to the list of programs, and ${u_libs} # to the list of shared libraries used. +# +# '-L path' can be used to specify a search path for libraries +# (which searches in $path/lib:$path/usr/lib:$path/usr/local/lib +# '-P binpath' can be used to specify a search path for programs +# (which searches in a lot of places in the subtree) +# -L must be the first, followed by -P # -# You can use it e.g. in a local configuration file by writing +# You can use it e.g. in a local confign file by writing # # do_copyfiles_user() { # local dst=$1 @@ -580,41 +587,61 @@ do_links() { # rootdir varname # cp -p ${u_libs} ${dst}/lib # mkdir -p ${dst}/libexec # find_progs ld-elf.so.1 -# cp -p ${u_progs} ${dst}/libexec +# cp -p ${u_progs} ${dst}/libexec # ignore errors # } find_progs() { # programs local i + local oo=${o_objdir:-${_SHLIBDIRPREFIX}} # default objdir + local lp=$oo/lib # default lib.prefix + local o="" # additional objdir + if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path + o=$2; shift; shift + lp="$lp:$o/lib:$o/usr/lib:$o/usr/local/lib" + o="-P $o" + fi + u_libs="" u_progs="`find_progs_helper $*`" - local o=${o_objdir:-${_SHLIBDIRPREFIX}} - log "looking for libs for $u_progs in $_SHLIBDIRPREFIX" + log "looking for libs for <$u_progs> in $lp" [ -z "${u_progs}" ] && return 1 # not found, error - i="`LD_LIBRARY_PATH=$o/lib ldd ${u_progs} | grep -v '^/' | awk '{print $1}' | sort | uniq`" - u_libs="`find_progs_helper $i`" + i="`( LD_LIBRARY_PATH=$lp ldd ${u_progs} ) | \ + grep -v '^/' | awk '{print $1}' | sort | uniq`" + u_libs="`find_progs_helper $o $i`" return 0 } find_progs_helper() { # programs + local dir=${o_objdir:-${_SHLIBDIRPREFIX}/..} + local ldir="" + if [ x"$1" = "x-P" -a -d "$2" ] ; then # set path + ldir=$2; shift; shift + fi local progs="$*" - local i o places names - local subdirs="bin sbin usr.bin usr.sbin libexec lib \ + local subdirs=". local/bin local/sbin local/lib local/libexec \ + bin sbin usr.bin usr.sbin libexec lib \ gnu/usr.bin gnu/lib \ secure/usr.bin secure/usr.sbin secure/libexec secure/lib" - names="" # files to search - o="" + local names="" # files to search + local o="" + local i for i in $progs ; do - # plain programs come out verbatim + # full pathnames are just listed [ -f "$i" ] && echo $i && continue names="${names} ${o} -name $i" o="-o" done [ -z "${names}" ] && return 0 - places="" # places to search - o=${o_objdir:-${_SHLIBDIRPREFIX}/..} + local places="" # places to search for i in $subdirs ; do - [ -d "${o}/${i}" ] && places="${places} ${o}/${i}" + [ -d "${dir}/${i}" ] && places="${places} ${dir}/${i}" done - find ${places} -type f \( ${names} \) + if [ -n "${ldir}" ] ; then + for i in $subdirs ; do + [ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}" + done + fi + # use maxdepth 3 because some libs are way down + find ${places} -maxdepth 3 -type f \( ${names} \) } # Populate the memory filesystem with binaries and non-variable @@ -862,7 +889,7 @@ fill_floppy_image() { if [ ${mfs_start} -gt 0 -a ${mfs_size} -ge ${imgsize} ] ; then mfs_ofs=$((${mfs_start} + 8192)) log "Preload kernel with file ${c_fs} at ${mfs_ofs}" - logverbose "`ls -l ${c_fs}` to fit in ${mfs_size}" + log "`ls -l ${c_fs}` to fit in ${mfs_size}" dd if=${c_fs} ibs=8192 iseek=1 of=kernel obs=${mfs_ofs} \ oseek=1 conv=notrunc # 2> /dev/null else @@ -917,7 +944,7 @@ fill_floppy_image() { ls -l ${c_img} ${c_label} -f `pwd`/${c_img} - logverbose "after disklabel" + log "after disklabel" ) echo "BUILDDIR ${BUILDDIR}" @@ -931,7 +958,7 @@ fill_floppy_image() { dd if=${b2} iseek=1 ibs=276 2> /dev/null | \ dd of=${BUILDDIR}/${c_img} oseek=1 obs=788 conv=notrunc 2>/dev/null - logverbose "done floppy image" + log "done disk image" # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *) rm -rf ${BUILDDIR}/floppy.tree || true # cleanup # df -ik ${dst} | colrm 70 > .build.reply Copied: stable/8/release/picobsd/floppy.tree/sbin (from r204826, head/release/picobsd/floppy.tree/sbin/dhclient-script) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/release/picobsd/floppy.tree/sbin Mon Mar 8 13:37:14 2010 (r204868, copy of r204826, head/release/picobsd/floppy.tree/sbin/dhclient-script) @@ -0,0 +1,384 @@ +#!/bin/sh +# +# $OpenBSD: dhclient-script,v 1.6 2004/05/06 18:22:41 claudio Exp $ +# $FreeBSD$ +# +# Copyright (c) 2003 Kenneth R Westerback +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# + +ARP=/usr/sbin/arp +HOSTNAME=/bin/hostname +IFCONFIG='/sbin/ifconfig -n' + +LOCALHOST=127.0.0.1 + +if [ -x /usr/bin/logger ]; then + LOGGER="/usr/bin/logger -s -p user.notice -t dhclient" +else + LOGGER=echo +fi + +# +# Helper functions that implement common actions. +# + +check_hostname() { + current_hostname=`$HOSTNAME` + if [ -z "$current_hostname" ]; then + $LOGGER "New Hostname ($interface): $new_host_name" + $HOSTNAME $new_host_name + elif [ "$current_hostname" = "$old_host_name" -a \ + "$new_host_name" != "$old_host_name" ]; then + $LOGGER "New Hostname ($interface): $new_host_name" + $HOSTNAME $new_host_name + fi +} + +arp_flush() { + arp -an -i $interface | \ + sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' | \ + sh >/dev/null 2>&1 +} + +delete_old_address() { + eval "$IFCONFIG $interface inet -alias $old_ip_address $medium" +} + +add_new_address() { + eval "$IFCONFIG $interface \ + inet $new_ip_address \ + netmask $new_subnet_mask \ + broadcast $new_broadcast_address \ + $medium" + + $LOGGER "New IP Address ($interface): $new_ip_address" + $LOGGER "New Subnet Mask ($interface): $new_subnet_mask" + $LOGGER "New Broadcast Address ($interface): $new_broadcast_address" + $LOGGER "New Routers ($interface): $new_routers" +} + +delete_old_alias() { + if [ -n "$alias_ip_address" ]; then + $IFCONFIG $interface inet -alias $alias_ip_address > /dev/null 2>&1 + #route delete $alias_ip_address $LOCALHOST > /dev/null 2>&1 + fi +} + +add_new_alias() { + if [ -n "$alias_ip_address" ]; then + $IFCONFIG $interface inet alias $alias_ip_address netmask \ + $alias_subnet_mask + #route add $alias_ip_address $LOCALHOST + fi +} + +fill_classless_routes() { + set $1 + while [ $# -ge 5 ]; do + if [ $1 -eq 0 ]; then + route="default" + elif [ $1 -le 8 ]; then + route="$2.0.0.0/$1" + shift + elif [ $1 -le 16 ]; then + route="$2.$3.0.0/$1" + shift; shift + elif [ $1 -le 24 ]; then + route="$2.$3.$4.0/$1" + shift; shift; shift + else + route="$2.$3.$4.$5/$1" + shift; shift; shift; shift + fi + shift + router="$1.$2.$3.$4" + classless_routes="$classless_routes $route $router" + shift; shift; shift; shift + done +} + +delete_old_routes() { + #route delete "$old_ip_address" $LOCALHOST >/dev/null 2>&1 + if [ -n "$old_classless_routes" ]; then + fill_classless_routes "$old_classless_routes" + set $classless_routes + while [ $# -gt 1 ]; do + route delete "$1" "$2" + shift; shift + done + return 0; + fi + + # If we supported multiple default routes, we'd be removing each + # one here. We don't so just delete the default route if it's + # through our interface. + if is_default_interface; then + route delete default >/dev/null 2>&1 + fi + + if [ -n "$old_static_routes" ]; then + set $old_static_routes + while [ $# -gt 1 ]; do + route delete "$1" "$2" + shift; shift + done + fi + + arp_flush +} + +add_new_routes() { + #route add $new_ip_address $LOCALHOST >/dev/null 2>&1 + + # RFC 3442: If the DHCP server returns both a Classless Static + # Routes option and a Router option, the DHCP client MUST ignore + # the Router option. + # + # DHCP clients that support this option (Classless Static Routes) + # MUST NOT install the routes specified in the Static Routes + # option (option code 33) if both a Static Routes option and the + # Classless Static Routes option are provided. + + if [ -n "$new_classless_routes" ]; then + fill_classless_routes "$new_classless_routes" + $LOGGER "New Classless Static Routes ($interface): $classless_routes" + set $classless_routes + while [ $# -gt 1 ]; do + if [ "0.0.0.0" = "$2" ]; then + route add "$1" -iface "$interface" + else + route add "$1" "$2" + fi + shift; shift + done + return + fi + + for router in $new_routers; do + if is_default_interface; then + + if [ "$new_ip_address" = "$router" ]; then + route add default -iface $router >/dev/null 2>&1 + else + route add default $router >/dev/null 2>&1 + fi + fi + # 2nd and subsequent default routers error out, so explicitly + # stop processing the list after the first one. + break + done + + if [ -n "$new_static_routes" ]; then + $LOGGER "New Static Routes ($interface): $new_static_routes" + set $new_static_routes + while [ $# -gt 1 ]; do + route add $1 $2 + shift; shift + done + fi +} + +add_new_resolv_conf() { + # XXX Old code did not create/update resolv.conf unless both + # $new_domain_name and $new_domain_name_servers were provided. PR + # #3135 reported some ISP's only provide $new_domain_name_servers and + # thus broke the script. This code creates the resolv.conf if either + # are provided. + + local tmpres=/var/run/resolv.conf.${interface} + rm -f $tmpres + + if [ -n "$new_domain_name" ]; then + echo "search $new_domain_name" >>$tmpres + fi + + if [ -n "$new_domain_name_servers" ]; then + for nameserver in $new_domain_name_servers; do + echo "nameserver $nameserver" >>$tmpres + done + fi + + if [ -f $tmpres ]; then + if [ -f /etc/resolv.conf.tail ]; then + cat /etc/resolv.conf.tail >>$tmpres + fi + + # When resolv.conf is not changed actually, we don't + # need to update it. + # If /usr is not mounted yet, we cannot use cmp, then + # the following test fails. In such case, we simply + # ignore an error and do update resolv.conf. + if cmp -s $tmpres /etc/resolv.conf; then + rm -f $tmpres + return 0 + fi 2>/dev/null + + # In case (e.g. during OpenBSD installs) /etc/resolv.conf + # is a symbolic link, take care to preserve the link and write + # the new data in the correct location. + + if [ -f /etc/resolv.conf ]; then + cat /etc/resolv.conf > /etc/resolv.conf.save + fi + cat $tmpres > /etc/resolv.conf + rm -f $tmpres + + # Try to ensure correct ownership and permissions. + chown -RL root:wheel /etc/resolv.conf + chmod -RL 644 /etc/resolv.conf + + return 0 + fi + + return 1 +} + +# Must be used on exit. Invokes the local dhcp client exit hooks, if any. +exit_with_hooks() { + exit_status=$1 + if [ -f /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status +} + +# Get the interface with the current ipv4 default route on it using only +# commands that are available prior to /usr being mounted. +is_default_interface() +{ + routeget="`route -n get -inet default`" + oldifs="$IFS" + IFS=" +" + defif= + for line in $routeget ; do + case $line in + *interface:*) + defif=${line##*: } + ;; + esac + done + IFS=${oldifs} + + if [ -z "$defif" -o "$defif" = "$interface" ]; then + return 0 + else + return 1 + fi +} + +# +# Start of active code. +# + +# Invoke the local dhcp client enter hooks, if they exist. +if [ -f /etc/dhclient-enter-hooks ]; then + exit_status=0 + . /etc/dhclient-enter-hooks + # allow the local script to abort processing of this state + # local script must set exit_status variable to nonzero. + if [ $exit_status -ne 0 ]; then + exit $exit_status + fi +fi + +case $reason in +MEDIUM) + eval "$IFCONFIG $interface $medium" + eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1 + sleep 1 + ;; + +PREINIT) + delete_old_alias + $IFCONFIG $interface inet alias 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up + ;; + +ARPCHECK|ARPSEND) + ;; + +BOUND|RENEW|REBIND|REBOOT) + check_hostname + if [ -n "$old_ip_address" ]; then + if [ "$old_ip_address" != "$alias_ip_address" ]; then + delete_old_alias + fi + if [ "$old_ip_address" != "$new_ip_address" ]; then + delete_old_address + delete_old_routes + fi + fi + if [ "$reason" = BOUND ] || \ + [ "$reason" = REBOOT ] || \ + [ -z "$old_ip_address" ] || \ + [ "$old_ip_address" != "$new_ip_address" ]; then + add_new_address + add_new_routes + fi + if [ "$new_ip_address" != "$alias_ip_address" ]; then + add_new_alias + fi + if is_default_interface; then + add_new_resolv_conf + fi + ;; + +EXPIRE|FAIL) + delete_old_alias + if [ -n "$old_ip_address" ]; then + delete_old_address + delete_old_routes + fi + if [ -x $ARP ]; then + $ARP -d -a -i $interface + fi + # XXX Why add alias we just deleted above? + add_new_alias + if is_default_interface; then + if [ -f /etc/resolv.conf.save ]; then + cat /etc/resolv.conf.save > /etc/resolv.conf + fi + fi + ;; + +TIMEOUT) + delete_old_alias + add_new_address + sleep 1 + if [ -n "$new_routers" ]; then + $LOGGER "New Routers ($interface): $new_routers" + set "$new_routers" + if ping -q -c 1 -t 1 "$1"; then + if [ "$new_ip_address" != "$alias_ip_address" ]; then + add_new_alias + fi + add_new_routes + if ! is_default_interface; then + exit_with_hooks 0 + fi + if add_new_resolv_conf; then + exit_with_hooks 0 + fi + fi + fi + eval "$IFCONFIG $interface inet -alias $new_ip_address $medium" + delete_old_routes + exit_with_hooks 1 + ;; +esac + +exit_with_hooks 0 From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 8 16:53:58 2010 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 B6731106564A; Mon, 8 Mar 2010 16:53:58 +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 A4F418FC08; Mon, 8 Mar 2010 16:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o28GrwF3050434; Mon, 8 Mar 2010 16:53:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28Grwp2050433; Mon, 8 Mar 2010 16:53:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201003081653.o28Grwp2050433@svn.freebsd.org> From: Alexander Motin Date: Mon, 8 Mar 2010 16:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204873 - stable/8/sys/dev/ciss 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, 08 Mar 2010 16:53:58 -0000 Author: mav Date: Mon Mar 8 16:53:58 2010 New Revision: 204873 URL: http://svn.freebsd.org/changeset/base/204873 Log: MFC r204648: Several changes to fix livelock under high load, introduced by r203489: - change the way in which command queue overflow is handled; - do not expose to CAM two command slots, used for driver's internal purposes; - allow driver to use up to 1024 command slots, instead of 256 before. Modified: stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/ciss/cissvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Mon Mar 8 16:23:32 2010 (r204872) +++ stable/8/sys/dev/ciss/ciss.c Mon Mar 8 16:53:58 2010 (r204873) @@ -1353,7 +1353,7 @@ ciss_init_logical(struct ciss_softc *sc) /* sanity-check reply */ ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); - if ((ndrives < 0) || (ndrives >= CISS_MAX_LOGICAL)) { + if ((ndrives < 0) || (ndrives > CISS_MAX_LOGICAL)) { ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", ndrives, CISS_MAX_LOGICAL); error = ENXIO; @@ -2791,7 +2791,7 @@ ciss_cam_init(struct ciss_softc *sc) * Allocate a devq. We can reuse this for the masked physical * devices if we decide to export these as well. */ - if ((sc->ciss_cam_devq = cam_simq_alloc(sc->ciss_max_requests)) == NULL) { + if ((sc->ciss_cam_devq = cam_simq_alloc(sc->ciss_max_requests - 2)) == NULL) { ciss_printf(sc, "can't allocate CAM SIM queue\n"); return(ENOMEM); } @@ -3065,7 +3065,7 @@ ciss_cam_action_io(struct cam_sim *sim, */ if ((error = ciss_get_request(sc, &cr)) != 0) { xpt_freeze_simq(sim, 1); - csio->ccb_h.status |= CAM_RELEASE_SIMQ; + sc->ciss_flags |= CISS_FLAG_BUSY; csio->ccb_h.status |= CAM_REQUEUE_REQ; return(error); } @@ -3275,6 +3275,13 @@ ciss_cam_complete(struct ciss_request *c ciss_cam_complete_fixup(sc, csio); ciss_release_request(cr); + if (sc->ciss_flags & CISS_FLAG_BUSY) { + sc->ciss_flags &= ~CISS_FLAG_BUSY; + if (csio->ccb_h.status & CAM_RELEASE_SIMQ) + xpt_release_simq(xpt_path_sim(csio->ccb_h.path), 0); + else + csio->ccb_h.status |= CAM_RELEASE_SIMQ; + } xpt_done((union ccb *)csio); } Modified: stable/8/sys/dev/ciss/cissvar.h ============================================================================== --- stable/8/sys/dev/ciss/cissvar.h Mon Mar 8 16:23:32 2010 (r204872) +++ stable/8/sys/dev/ciss/cissvar.h Mon Mar 8 16:53:58 2010 (r204873) @@ -41,7 +41,7 @@ typedef STAILQ_HEAD(, ciss_request) cr_q * commands an adapter may claim to support. Cap it at a reasonable * value. */ -#define CISS_MAX_REQUESTS 256 +#define CISS_MAX_REQUESTS 1024 /* * Maximum number of logical drives we support. @@ -251,6 +251,7 @@ struct ciss_softc #define CISS_FLAG_CONTROL_OPEN (1<<1) /* control device is open */ #define CISS_FLAG_ABORTING (1<<2) /* driver is going away */ #define CISS_FLAG_RUNNING (1<<3) /* driver is running (interrupts usable) */ +#define CISS_FLAG_BUSY (1<<4) /* no free commands */ #define CISS_FLAG_FAKE_SYNCH (1<<16) /* needs SYNCHRONISE_CACHE faked */ #define CISS_FLAG_BMIC_ABORT (1<<17) /* use BMIC command to abort Notify on Event */ From owner-svn-src-stable-8@FreeBSD.ORG Mon Mar 8 21:29:01 2010 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 04DCB106566C; Mon, 8 Mar 2010 21:29:01 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E59948FC17; Mon, 8 Mar 2010 21:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o28LT0WO012995; Mon, 8 Mar 2010 21:29:00 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28LT0kg012990; Mon, 8 Mar 2010 21:29:00 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201003082129.o28LT0kg012990@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 8 Mar 2010 21:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204890 - stable/8/share/zoneinfo 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, 08 Mar 2010 21:29:01 -0000 Author: edwin Date: Mon Mar 8 21:29:00 2010 New Revision: 204890 URL: http://svn.freebsd.org/changeset/base/204890 Log: MFC of tzdata2010e, r204887 - Adjust beginning / end of DST in Bangladesh (minimal impact) - Fiji ends DST one month earlier to last Sunday of March - Samoa changes - Chile extends DST until 3 April this year. Modified: stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/southamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Mon Mar 8 21:25:38 2010 (r204889) +++ stable/8/share/zoneinfo/asia Mon Mar 8 21:29:00 2010 (r204890) @@ -1,4 +1,4 @@ -# @(#)asia 8.50 +# @(#)asia 8.55 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -225,11 +225,31 @@ Zone Asia/Bahrain 3:22:20 - LMT 1920 # # until further notice." I take that last sentence as the # establishment of a rule. -# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Dhaka 2009 only - Jun 29 23:00 1 S -Rule Dhaka 2010 only - Jan 1 0:00 - - -Rule Dhaka 2010 max - Mar 31 23:00 1 S -Rule Dhaka 2010 max - Nov 1 0:00 - - +# From Nobutomo Nakano (2010-02-19): +# We received a report from Bangladesh saying that the start/end of +# Bangladesh DST is incorrect. Currently we have only the Bengali version +# of the official mail from BTRC which describes the following: +# +# "From 2010 each year when local standard time is about to reach +# March 31 at 10:59:00 PM clocks are turned forward 1 hour (11:59:00 PM) +# and when local daylight time is about to October 31 at 11:59:00 PM +# clocks are turned backward 1 hour (10:59:00 PM)." +# +# So, DST will start/end 1 minute earlier. + +# From Arthur David Olson (2010-03-03): +# The file +# +# http://www.cabinet.gov/bd/file_upload/news_events/en_169.pdf +# +# is in Bengali; it does contain two "31"s as well as two "11.59"s and a "10.59" +# which is consistent with the information provided by Nobutomo Nakano. + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Dhaka 2009 only - Jun 19 23:00 1:00 S +Rule Dhaka 2009 only - Dec 31 23:59 0 - +Rule Dhaka 2010 max - Mar 31 22:59 1:00 S +Rule Dhaka 2010 max - Oct 31 23:59 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 Modified: stable/8/share/zoneinfo/australasia ============================================================================== --- stable/8/share/zoneinfo/australasia Mon Mar 8 21:25:38 2010 (r204889) +++ stable/8/share/zoneinfo/australasia Mon Mar 8 21:29:00 2010 (r204890) @@ -1,5 +1,5 @@ #
-# @(#)australasia	8.15
+# @(#)australasia	8.16
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -267,11 +267,30 @@ Zone	Indian/Cocos	6:27:40	-	LMT	1900
 # 
 # http://www.fiji.gov.fj/publish/page_16198.shtml
 # 
+
+# From Steffen Thorsen (2010-03-03):
+# The Cabinet in Fiji has decided to end DST about a month early, on
+# 2010-03-28 at 03:00.
+# The plan is to observe DST again, from 2010-10-24 to sometime in March
+# 2011 (last Sunday a good guess?).
+#
+# Official source:
+# 
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
+# 
+#
+# A bit more background info here:
+# 
+# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
+# 
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
 Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
 Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
-Rule	Fiji	2010	only	-	Apr	25	3:00	0	-
+Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0	-
+Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
+Rule	Fiji	2011	only	-	Mar	lastSun 3:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
 			12:00	Fiji	FJ%sT	# Fiji Time
@@ -449,70 +468,30 @@ Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1
 
 # Samoa
 
-# From Alexander Krivenyshev (2008-12-06):
-# The Samoa government (Western Samoa) may implement DST on the first Sunday of 
-# October 2009 (October 4, 2009) until the last Sunday of March 2010 (March 28, 
-# 2010). 
-# 
-# "Selected Committee reports to Cabinet on Daylight Saving Time",
-# Government of Samoa:
-# 
-# http://www.govt.ws/pr_article.cfm?pr_id=560
-# 
-# or
-# 
-# http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
-# 
-
-# From Steffen Thorsen (2009-08-27):
-# Samoa's parliament passed the Daylight Saving Bill 2009, and will start 
-# daylight saving time on the first Sunday of October 2009 and end on the 
-# last Sunday of March 2010. We hope that the full text will be published 
-# soon, but we believe that the bill is only valid for 2009-2010. Samoa's 
-# Daylight Saving Act 2009 will be enforced as soon as the Head of State 
-# executes a proclamation publicizing this Act.
+# From Steffen Thorsen (2009-10-16):
+# We have been in contact with the government of Samoa again, and received
+# the following info:
+#
+# "Cabinet has now approved Daylight Saving to be effected next year
+# commencing from the last Sunday of September 2010 and conclude first
+# Sunday of April 2011."
 #
-# Some background information here, which will be updated once we have 
-# more details:
+# Background info:
 # 
 # http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
 # 
-
-# From Alexander Krivenyshev (2009-10-03):
-# First, my deepest condolences to people of Samoa islands and all families and
-# loved ones around the world who lost their lives in the earthquake and tsunami.
-#
-# Considering the recent devastation on Samoa by earthquake and tsunami and that
-# many government offices/ ministers are closed- not sure if "Daylight Saving
-# Bill 2009" will be implemented in next few days- on October 4, 2009.
-#
-# Here is reply from Consulate-General of Samoa in New Zealand
-# ---------------------------
-# Consul General
-# consulgeneral@samoaconsulate.org.nz
-#
-# Talofa Alexander,
-#
-# Thank you for your sympathy for our country but at this time we have not
-# been informed about the Daylight Savings Time Change.  Most Ministries in
-# Apia are closed or relocating due to weather concerns.
-#
-# When we do find out if they are still proceeding with the time change we
-# will advise you soonest.
-#
-# Kind Regards,
-# Lana
-# for: Consul General
-
-# From Steffen Thorsen (2009-10-05):
-# We have called a hotel in Samoa and asked about local time there - they 
-# are still on standard time.
+#
+# Samoa's Daylight Saving Time Act 2009 is available here, but does not
+# contain any dates:
+# 
+# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
+# 
 
 Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
 			-11:26:56 -	LMT	1911
 			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST	2009 Oct 4
-			-11:00	1:00	WSDT	2010 Mar 28
+			-11:00	-	WST	2010 Oct 24
+			-11:00	1:00	WSDT	2011 Apr 3
 			-11:00	-	WST
 
 # Solomon Is

Modified: stable/8/share/zoneinfo/southamerica
==============================================================================
--- stable/8/share/zoneinfo/southamerica	Mon Mar  8 21:25:38 2010	(r204889)
+++ stable/8/share/zoneinfo/southamerica	Mon Mar  8 21:29:00 2010	(r204890)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.41
+# @(#)southamerica	8.43
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -1121,6 +1121,18 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1
 # http://www.shoa.cl/noticias/2008/04hora/hora.htm
 # .
 
+# From Angel Chiang (2010-03-04):
+# Subject: DST in Chile exceptionally extended to 3 April due to earthquake
+# 
+# http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
+# 
+# (in Spanish, last paragraph).
+#
+# This is breaking news. There should be more information available later.
+
+# From Arthur Daivd Olson (2010-03-06):
+# Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
 Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
@@ -1155,7 +1167,9 @@ Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	
 # N.B.: the end of March 29 in Chile is March 30 in Universal time,
 # which is used below in specifying the transition.
 Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
-Rule	Chile	2009	max	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
+Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
 # IATA SSIM anomalies: (1992-02) says 1992-03-14;
 # (1996-09) says 1998-03-08.  Ignore these.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -1380,7 +1394,7 @@ Rule	Para	2005	2009	-	Mar	Sun>=8	0:00	0	
 # and that on the first Sunday of the month of October, it is to be set
 # forward 60 minutes, in all the territory of the Paraguayan Republic.
 # ...
-Rule	Para	2010	max	-	Oct	Sun<=7	0:00	1:00	S
+Rule	Para	2010	max	-	Oct	Sun>=1	0:00	1:00	S
 Rule	Para	2010	max	-	Apr	Sun>=8	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Mar  8 21:30:12 2010
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 821681065676;
	Mon,  8 Mar 2010 21:30:12 +0000 (UTC)
	(envelope-from qingli@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 70CB88FC36;
	Mon,  8 Mar 2010 21:30:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o28LUCjO013378;
	Mon, 8 Mar 2010 21:30:12 GMT (envelope-from qingli@svn.freebsd.org)
Received: (from qingli@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28LUCdW013376;
	Mon, 8 Mar 2010 21:30:12 GMT (envelope-from qingli@svn.freebsd.org)
Message-Id: <201003082130.o28LUCdW013376@svn.freebsd.org>
From: Qing Li 
Date: Mon, 8 Mar 2010 21:30:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204893 - stable/8/sys/netinet6
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, 08 Mar 2010 21:30:12 -0000

Author: qingli
Date: Mon Mar  8 21:30:12 2010
New Revision: 204893
URL: http://svn.freebsd.org/changeset/base/204893

Log:
  MFC 204402
  
  Use reference counting instead of locking to secure an address while
  that address is being used to generate temporary IPv6 address. This
  approach is sufficient and avoids recursive locking.

Modified:
  stable/8/sys/netinet6/nd6.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/netinet6/nd6.c
==============================================================================
--- stable/8/sys/netinet6/nd6.c	Mon Mar  8 21:29:09 2010	(r204892)
+++ stable/8/sys/netinet6/nd6.c	Mon Mar  8 21:30:12 2010	(r204893)
@@ -759,22 +759,25 @@ regen_tmpaddr(struct in6_ifaddr *ia6)
 		 */
 		if (!IFA6_IS_DEPRECATED(it6))
 		    public_ifa6 = it6;
+
+		if (public_ifa6 != NULL)
+			ifa_ref(&public_ifa6->ia_ifa);
 	}
+	IF_ADDR_UNLOCK(ifp);
 
 	if (public_ifa6 != NULL) {
 		int e;
 
 		if ((e = in6_tmpifadd(public_ifa6, 0, 0)) != 0) {
-			IF_ADDR_UNLOCK(ifp);
+			ifa_free(&public_ifa6->ia_ifa);
 			log(LOG_NOTICE, "regen_tmpaddr: failed to create a new"
 			    " tmp addr,errno=%d\n", e);
 			return (-1);
 		}
-		IF_ADDR_UNLOCK(ifp);
+		ifa_free(&public_ifa6->ia_ifa);
 		return (0);
 	}
 
-	IF_ADDR_UNLOCK(ifp);
 	return (-1);
 }
 

From owner-svn-src-stable-8@FreeBSD.ORG  Mon Mar  8 21:36:21 2010
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 92ABF106564A;
	Mon,  8 Mar 2010 21:36:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 80E5D8FC1B;
	Mon,  8 Mar 2010 21:36:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o28LaLi7014791;
	Mon, 8 Mar 2010 21:36:21 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o28LaLab014788;
	Mon, 8 Mar 2010 21:36:21 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201003082136.o28LaLab014788@svn.freebsd.org>
From: John Baldwin 
Date: Mon, 8 Mar 2010 21:36:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204894 - in stable/8/sys: amd64/amd64 i386/i386
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, 08 Mar 2010 21:36:21 -0000

Author: jhb
Date: Mon Mar  8 21:36:20 2010
New Revision: 204894
URL: http://svn.freebsd.org/changeset/base/204894

Log:
  MFC 204518:
  Print the contents of the miscellaneous (MISC) register to the console if
  it is valid along with the other register values when a machine check is
  encountered.

Modified:
  stable/8/sys/amd64/amd64/mca.c
  stable/8/sys/i386/i386/mca.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/amd64/amd64/mca.c
==============================================================================
--- stable/8/sys/amd64/amd64/mca.c	Mon Mar  8 21:30:12 2010	(r204893)
+++ stable/8/sys/amd64/amd64/mca.c	Mon Mar  8 21:36:20 2010	(r204894)
@@ -288,6 +288,8 @@ mca_log(const struct mca_record *rec)
 	printf("\n");
 	if (rec->mr_status & MC_STATUS_ADDRV)
 		printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr);
+	if (rec->mr_status & MC_STATUS_MISCV)
+		printf("MCA: Misc 0x%llx\n", (long long)rec->mr_misc);
 }
 
 static int __nonnull(2)

Modified: stable/8/sys/i386/i386/mca.c
==============================================================================
--- stable/8/sys/i386/i386/mca.c	Mon Mar  8 21:30:12 2010	(r204893)
+++ stable/8/sys/i386/i386/mca.c	Mon Mar  8 21:36:20 2010	(r204894)
@@ -288,6 +288,8 @@ mca_log(const struct mca_record *rec)
 	printf("\n");
 	if (rec->mr_status & MC_STATUS_ADDRV)
 		printf("MCA: Address 0x%llx\n", (long long)rec->mr_addr);
+	if (rec->mr_status & MC_STATUS_MISCV)
+		printf("MCA: Misc 0x%llx\n", (long long)rec->mr_misc);
 }
 
 static int __nonnull(2)

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  9 09:19:47 2010
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 0D1EB106566C;
	Tue,  9 Mar 2010 09:19:47 +0000 (UTC)
	(envelope-from simon@benji.nitro.dk)
Received: from mx.nitro.dk (unknown [77.75.165.90])
	by mx1.freebsd.org (Postfix) with ESMTP id C2A728FC12;
	Tue,  9 Mar 2010 09:19:46 +0000 (UTC)
Received: from benji.nitro.dk (unknown [192.168.3.39])
	by mx.nitro.dk (Postfix) with ESMTP id B91582D4B61;
	Tue,  9 Mar 2010 09:19:45 +0000 (UTC)
Received: by benji.nitro.dk (Postfix, from userid 2000)
	id C569311229; Tue,  9 Mar 2010 10:20:21 +0100 (CET)
Date: Tue, 9 Mar 2010 10:20:21 +0100
From: "Simon L. Nielsen" 
To: Luigi Rizzo 
Message-ID: <20100309092019.GA1495@zaphod.nitro.dk>
References: <201003081337.o28DbEFY006860@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201003081337.o28DbEFY006860@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
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: r204868 - in stable/8/release/picobsd: build
 floppy.tree
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, 09 Mar 2010 09:19:47 -0000

On 2010.03.08 13:37:14 +0000, Luigi Rizzo wrote:
> Author: luigi
> Date: Mon Mar  8 13:37:14 2010
> New Revision: 204868
> URL: http://svn.freebsd.org/changeset/base/204868
> 
> Log:
>   MFC main build script and missing directory
> 
> Added:
>   stable/8/release/picobsd/floppy.tree/sbin
>      - copied unchanged from r204826, head/release/picobsd/floppy.tree/sbin/dhclient-script
> Modified:
>   stable/8/release/picobsd/build/picobsd

I don't think this is what you want - dhclient-script is now called
'sbin' in stable/8 - and as there is already a directory with the same
name CVS is rather unhappy about this.

I need to hack the exporter to ignore the addition of
stable/8/release/picobsd/floppy.tree/sbin as there is simply no way
represent that in CVS (that I know of at least).

-- 
Simon L. Nielsen

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  9 13:32:51 2010
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 704051065676;
	Tue,  9 Mar 2010 13:32:51 +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 5FD098FC29;
	Tue,  9 Mar 2010 13:32:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o29DWpkf028462;
	Tue, 9 Mar 2010 13:32:51 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o29DWpuR028461;
	Tue, 9 Mar 2010 13:32:51 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201003091332.o29DWpuR028461@svn.freebsd.org>
From: Konstantin Belousov 
Date: Tue, 9 Mar 2010 13:32:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204911 - stable/8/sys/dev/mfi
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, 09 Mar 2010 13:32:51 -0000

Author: kib
Date: Tue Mar  9 13:32:50 2010
New Revision: 204911
URL: http://svn.freebsd.org/changeset/base/204911

Log:
  MFC r204590:
  Correct mfip module dependency on mfi. This allows mfip to be loaded as
  module when mfi is a module itself.

Modified:
  stable/8/sys/dev/mfi/mfi_cam.c
  stable/8/sys/dev/mfi/mfi_pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/dev/mfi/mfi_cam.c
==============================================================================
--- stable/8/sys/dev/mfi/mfi_cam.c	Tue Mar  9 13:08:57 2010	(r204910)
+++ stable/8/sys/dev/mfi/mfi_cam.c	Tue Mar  9 13:32:50 2010	(r204911)
@@ -95,6 +95,7 @@ static driver_t mfip_driver = {
 };
 DRIVER_MODULE(mfip, mfi, mfip_driver, mfip_devclass, 0, 0);
 MODULE_DEPEND(mfip, cam, 1, 1, 1);
+MODULE_DEPEND(mfip, mfi, 1, 1, 1);
 
 #define ccb_mfip_ptr sim_priv.entries[0].ptr
 

Modified: stable/8/sys/dev/mfi/mfi_pci.c
==============================================================================
--- stable/8/sys/dev/mfi/mfi_pci.c	Tue Mar  9 13:08:57 2010	(r204910)
+++ stable/8/sys/dev/mfi/mfi_pci.c	Tue Mar  9 13:32:50 2010	(r204911)
@@ -105,6 +105,7 @@ static driver_t mfi_pci_driver = {
 
 static devclass_t	mfi_devclass;
 DRIVER_MODULE(mfi, pci, mfi_pci_driver, mfi_devclass, 0, 0);
+MODULE_VERSION(mfi, 1);
 
 struct mfi_ident {
 	uint16_t	vendor;

From owner-svn-src-stable-8@FreeBSD.ORG  Tue Mar  9 21:16:36 2010
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 C0416106564A;
	Tue,  9 Mar 2010 21:16:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 93CE58FC14;
	Tue,  9 Mar 2010 21:16:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o29LGa1U032337;
	Tue, 9 Mar 2010 21:16:36 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o29LGaao032336;
	Tue, 9 Mar 2010 21:16:36 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201003092116.o29LGaao032336@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 9 Mar 2010 21:16:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204930 - stable/8/sys/netinet
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, 09 Mar 2010 21:16:36 -0000

Author: jhb
Date: Tue Mar  9 21:16:36 2010
New Revision: 204930
URL: http://svn.freebsd.org/changeset/base/204930

Log:
  Merge mergeinfo for netinet up to sys.

Modified:
Directory Properties:
  stable/8/sys/netinet/   (props changed)

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar 10 13:40:38 2010
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 4C9201065673;
	Wed, 10 Mar 2010 13:40:38 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B6278FC12;
	Wed, 10 Mar 2010 13:40:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2ADecDU052493;
	Wed, 10 Mar 2010 13:40:38 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2ADecY4052490;
	Wed, 10 Mar 2010 13:40:38 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201003101340.o2ADecY4052490@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 10 Mar 2010 13:40:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204951 - stable/8/usr.bin/hexdump
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, 10 Mar 2010 13:40:38 -0000

Author: gavin
Date: Wed Mar 10 13:40:37 2010
New Revision: 204951
URL: http://svn.freebsd.org/changeset/base/204951

Log:
  Merge r204053 from head:
  
    The correct value of DEL is 0x7f, not 0xff.  This is purely a documentation
    issue - od(1) and hexdump(1) behave as expected.
  
  PR:		docs/143869
  Submitted by:	gcooper

Modified:
  stable/8/usr.bin/hexdump/hexdump.1
  stable/8/usr.bin/hexdump/od.1
Directory Properties:
  stable/8/usr.bin/hexdump/   (props changed)

Modified: stable/8/usr.bin/hexdump/hexdump.1
==============================================================================
--- stable/8/usr.bin/hexdump/hexdump.1	Wed Mar 10 13:23:25 2010	(r204950)
+++ stable/8/usr.bin/hexdump/hexdump.1	Wed Mar 10 13:40:37 2010	(r204951)
@@ -32,7 +32,7 @@
 .\"	@(#)hexdump.1	8.2 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd July 10, 2004
+.Dd February 18, 2010
 .Dt HEXDUMP 1
 .Os
 .Sh NAME
@@ -258,7 +258,7 @@ strings.
 .It "\&00C\ FF\t00D\ CR\t00E\ SO\t00F\ SI\t010\ DLE\t011\ DC1
 .It "\&012\ DC2\t013\ DC3\t014\ DC4\t015\ NAK\t016\ SYN\t017\ ETB
 .It "\&018\ CAN\t019\ EM\t01A\ SUB\t01B\ ESC\t01C\ FS\t01D\ GS
-.It "\&01E\ RS\t01F\ US\t0FF\ DEL
+.It "\&01E\ RS\t01F\ US\t07F\ DEL
 .El
 .El
 .Pp

Modified: stable/8/usr.bin/hexdump/od.1
==============================================================================
--- stable/8/usr.bin/hexdump/od.1	Wed Mar 10 13:23:25 2010	(r204950)
+++ stable/8/usr.bin/hexdump/od.1	Wed Mar 10 13:40:37 2010	(r204951)
@@ -32,7 +32,7 @@
 .\"	@(#)od.1	8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd December 24, 2006
+.Dd February 18, 2010
 .Os
 .Dt OD 1
 .Sh NAME
@@ -155,7 +155,7 @@ Control characters are displayed using t
 .It "00c FF	00d CR	00e SO	00f SI	010 DLE	011 DC1"
 .It "012 DC2	013 DC3	014 DC4	015 NAK	016 SYN	017 ETB"
 .It "018 CAN	019 EM	01a SUB	01b ESC	01c FS	01d GS"
-.It "01e RS	01f US	020 SP	0ff DEL"
+.It "01e RS	01f US	020 SP	07f DEL"
 .El
 .It Cm c
 Characters in the default character set.

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar 10 17:58:32 2010
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 C6BC4106564A;
	Wed, 10 Mar 2010 17:58:32 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B53158FC0C;
	Wed, 10 Mar 2010 17:58:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2AHwWkn015378;
	Wed, 10 Mar 2010 17:58:32 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AHwW2o015376;
	Wed, 10 Mar 2010 17:58:32 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201003101758.o2AHwW2o015376@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 10 Mar 2010 17:58:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204963 - stable/8/sys/dev/acpica
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, 10 Mar 2010 17:58:33 -0000

Author: jkim
Date: Wed Mar 10 17:58:32 2010
New Revision: 204963
URL: http://svn.freebsd.org/changeset/base/204963

Log:
  MFC:	r197438, r203810, r203813, r203935, r203936
  
  Sync acpi_video(4) with HEAD.
  
  r197438:
  Uninline an instance of STAILQ_FOREACH_SAFE().
  
  r203810:
  Implement LCD brightness control notify handler.
  
  r203813:
  Make sanity check slightly more useful and tweak an error message.
  
  r203935:
  Add support for `cycle' and `zero' events for LCD brightness control.
  
  r203936:
  Rename some macros to clarify their intentions and fix style nits.

Modified:
  stable/8/sys/dev/acpica/acpi_video.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_video.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_video.c	Wed Mar 10 17:45:58 2010	(r204962)
+++ stable/8/sys/dev/acpica/acpi_video.c	Wed Mar 10 17:58:32 2010	(r204963)
@@ -83,6 +83,7 @@ static struct acpi_video_output *acpi_vi
 static void	acpi_video_vo_bind(struct acpi_video_output *, ACPI_HANDLE);
 static void	acpi_video_vo_destroy(struct acpi_video_output *);
 static int	acpi_video_vo_check_level(struct acpi_video_output *, int);
+static void	acpi_video_vo_notify_handler(ACPI_HANDLE, UINT32, void *);
 static int	acpi_video_vo_active_sysctl(SYSCTL_HANDLER_ARGS);
 static int	acpi_video_vo_bright_sysctl(SYSCTL_HANDLER_ARGS);
 static int	acpi_video_vo_presets_sysctl(SYSCTL_HANDLER_ARGS);
@@ -93,56 +94,61 @@ static void	vid_set_switch_policy(ACPI_H
 static int	vid_enum_outputs(ACPI_HANDLE,
 		    void(*)(ACPI_HANDLE, UINT32, void *), void *);
 static int	vo_get_brightness_levels(ACPI_HANDLE, int **);
+static int	vo_get_brightness(ACPI_HANDLE);
 static void	vo_set_brightness(ACPI_HANDLE, int);
 static UINT32	vo_get_device_status(ACPI_HANDLE);
 static UINT32	vo_get_graphics_state(ACPI_HANDLE);
 static void	vo_set_device_state(ACPI_HANDLE, UINT32);
 
 /* events */
-#define VID_NOTIFY_SWITCHED	0x80
-#define VID_NOTIFY_REPROBE	0x81
+#define	VID_NOTIFY_SWITCHED	0x80
+#define	VID_NOTIFY_REPROBE	0x81
+#define	VID_NOTIFY_CYCLE_BRN	0x85
+#define	VID_NOTIFY_INC_BRN	0x86
+#define	VID_NOTIFY_DEC_BRN	0x87
+#define	VID_NOTIFY_ZERO_BRN	0x88
 
 /* _DOS (Enable/Disable Output Switching) argument bits */
-#define DOS_SWITCH_MASK		3
-#define DOS_SWITCH_BY_OSPM	0
-#define DOS_SWITCH_BY_BIOS	1
-#define DOS_SWITCH_LOCKED	2
-#define DOS_BRIGHTNESS_BY_BIOS	(1 << 2)
+#define	DOS_SWITCH_MASK		3
+#define	DOS_SWITCH_BY_OSPM	0
+#define	DOS_SWITCH_BY_BIOS	1
+#define	DOS_SWITCH_LOCKED	2
+#define	DOS_BRIGHTNESS_BY_OSPM	(1 << 2)
 
 /* _DOD and subdev's _ADR */
-#define DOD_DEVID_MASK		0x0f00
-#define DOD_DEVID_MASK_FULL	0xffff
-#define DOD_DEVID_MASK_DISPIDX	0x000f
-#define DOD_DEVID_MASK_DISPPORT	0x00f0
-#define DOD_DEVID_MONITOR	0x0100
-#define DOD_DEVID_LCD		0x0110
-#define DOD_DEVID_TV		0x0200
-#define DOD_DEVID_EXT		0x0300
-#define DOD_DEVID_INTDFP	0x0400
-#define DOD_BIOS		(1 << 16)
-#define DOD_NONVGA		(1 << 17)
-#define DOD_HEAD_ID_SHIFT	18
-#define DOD_HEAD_ID_BITS	3
-#define DOD_HEAD_ID_MASK \
+#define	DOD_DEVID_MASK		0x0f00
+#define	DOD_DEVID_MASK_FULL	0xffff
+#define	DOD_DEVID_MASK_DISPIDX	0x000f
+#define	DOD_DEVID_MASK_DISPPORT	0x00f0
+#define	DOD_DEVID_MONITOR	0x0100
+#define	DOD_DEVID_LCD		0x0110
+#define	DOD_DEVID_TV		0x0200
+#define	DOD_DEVID_EXT		0x0300
+#define	DOD_DEVID_INTDFP	0x0400
+#define	DOD_BIOS		(1 << 16)
+#define	DOD_NONVGA		(1 << 17)
+#define	DOD_HEAD_ID_SHIFT	18
+#define	DOD_HEAD_ID_BITS	3
+#define	DOD_HEAD_ID_MASK \
 		(((1 << DOD_HEAD_ID_BITS) - 1) << DOD_HEAD_ID_SHIFT)
-#define DOD_DEVID_SCHEME_STD	(1 << 31)
+#define	DOD_DEVID_SCHEME_STD	(1 << 31)
 
 /* _BCL related constants */
-#define BCL_FULLPOWER		0
-#define BCL_ECONOMY		1
+#define	BCL_FULLPOWER		0
+#define	BCL_ECONOMY		1
 
 /* _DCS (Device Currrent Status) value bits and masks. */
-#define DCS_EXISTS		(1 << 0)
-#define DCS_ACTIVE		(1 << 1)
-#define DCS_READY		(1 << 2)
-#define DCS_FUNCTIONAL		(1 << 3)
-#define DCS_ATTACHED		(1 << 4)
+#define	DCS_EXISTS		(1 << 0)
+#define	DCS_ACTIVE		(1 << 1)
+#define	DCS_READY		(1 << 2)
+#define	DCS_FUNCTIONAL		(1 << 3)
+#define	DCS_ATTACHED		(1 << 4)
 
 /* _DSS (Device Set Status) argument bits and masks. */
-#define DSS_INACTIVE		0
-#define DSS_ACTIVE		(1 << 0)
-#define DSS_SETNEXT		(1 << 30)
-#define DSS_COMMIT		(1 << 31)
+#define	DSS_INACTIVE		0
+#define	DSS_ACTIVE		(1 << 0)
+#define	DSS_SETNEXT		(1 << 30)
+#define	DSS_COMMIT		(1 << 31)
 
 static device_method_t acpi_video_methods[] = {
 	DEVMETHOD(device_identify, acpi_video_identify),
@@ -269,7 +275,7 @@ acpi_video_attach(device_t dev)
 	 * brightness levels.
 	 */
 	vid_set_switch_policy(sc->handle, DOS_SWITCH_BY_OSPM |
-	    DOS_BRIGHTNESS_BY_BIOS);
+	    DOS_BRIGHTNESS_BY_OSPM);
 
 	acpi_video_power_profile(sc);
 
@@ -290,8 +296,7 @@ acpi_video_detach(device_t dev)
 				acpi_video_notify_handler);
 
 	ACPI_SERIAL_BEGIN(video);
-	for (vo = STAILQ_FIRST(&sc->vid_outputs); vo != NULL; vo = vn) {
-		vn = STAILQ_NEXT(vo, vo_next);
+	STAILQ_FOREACH_SAFE(vo, &sc->vid_outputs, vo_next, vn) {
 		acpi_video_vo_destroy(vo);
 	}
 	ACPI_SERIAL_END(video);
@@ -578,6 +583,9 @@ acpi_video_vo_bind(struct acpi_video_out
 			/* XXX - see above. */
 			vo->vo_economy = vo->vo_levels[BCL_ECONOMY];
 	}
+	if (vo->vo_levels != NULL)
+	    AcpiInstallNotifyHandler(handle, ACPI_DEVICE_NOTIFY,
+		acpi_video_vo_notify_handler, vo);
 	ACPI_SERIAL_END(video_output);
 }
 
@@ -591,8 +599,11 @@ acpi_video_vo_destroy(struct acpi_video_
 		vo->vo_sysctl_tree = NULL;
 		sysctl_ctx_free(&vo->vo_sysctl_ctx);
 	}
-	if (vo->vo_levels != NULL)
+	if (vo->vo_levels != NULL) {
+		AcpiRemoveNotifyHandler(vo->handle, ACPI_DEVICE_NOTIFY,
+		    acpi_video_vo_notify_handler);
 		AcpiOsFree(vo->vo_levels);
+	}
 
 	switch (vo->adr & DOD_DEVID_MASK) {
 	case DOD_DEVID_MONITOR:
@@ -628,6 +639,79 @@ acpi_video_vo_check_level(struct acpi_vi
 	return (EINVAL);
 }
 
+static void
+acpi_video_vo_notify_handler(ACPI_HANDLE handle, UINT32 notify, void *context)
+{
+	struct acpi_video_output *vo;
+	int i, j, level, new_level;
+
+	vo = context;
+	ACPI_SERIAL_BEGIN(video_output);
+	if (vo->handle != handle)
+		goto out;
+
+	switch (notify) {
+	case VID_NOTIFY_CYCLE_BRN:
+		if (vo->vo_numlevels <= 3)
+			goto out;
+		/* FALLTHROUGH */
+	case VID_NOTIFY_INC_BRN:
+	case VID_NOTIFY_DEC_BRN:
+	case VID_NOTIFY_ZERO_BRN:
+		if (vo->vo_levels == NULL)
+			goto out;
+		level = vo_get_brightness(handle);
+		if (level < 0)
+			goto out;
+		break;
+	default:
+		printf("unknown notify event 0x%x from %s\n",
+		    notify, acpi_name(handle));
+		goto out;
+	}
+
+	new_level = level;
+	switch (notify) {
+	case VID_NOTIFY_CYCLE_BRN:
+		for (i = 2; i < vo->vo_numlevels; i++)
+			if (vo->vo_levels[i] == level) {
+				new_level = vo->vo_numlevels > i + 1 ?
+				     vo->vo_levels[i + 1] : vo->vo_levels[2];
+				break;
+			}
+		break;
+	case VID_NOTIFY_INC_BRN:
+	case VID_NOTIFY_DEC_BRN:
+		for (i = 0; i < vo->vo_numlevels; i++) {
+			j = vo->vo_levels[i];
+			if (notify == VID_NOTIFY_INC_BRN) {
+				if (j > level &&
+				    (j < new_level || level == new_level))
+					new_level = j;
+			} else {
+				if (j < level &&
+				    (j > new_level || level == new_level))
+					new_level = j;
+			}
+		}
+		break;
+	case VID_NOTIFY_ZERO_BRN:
+		for (i = 0; i < vo->vo_numlevels; i++)
+			if (vo->vo_levels[i] == 0) {
+				new_level = 0;
+				break;
+			}
+		break;
+	}
+	if (new_level != level) {
+		vo_set_brightness(handle, new_level);
+		vo->vo_brightness = new_level;
+	}
+
+out:
+	ACPI_SERIAL_END(video_output);
+}
+
 /* ARGSUSED */
 static int
 acpi_video_vo_active_sysctl(SYSCTL_HANDLER_ARGS)
@@ -901,6 +985,25 @@ out:
 	return (num);
 }
 
+static int
+vo_get_brightness(ACPI_HANDLE handle)
+{
+	UINT32 level;
+	ACPI_STATUS status;
+
+	ACPI_SERIAL_ASSERT(video_output);
+	status = acpi_GetInteger(handle, "_BQC", &level);
+	if (ACPI_FAILURE(status)) {
+		printf("can't evaluate %s._BQC - %s\n", acpi_name(handle),
+		    AcpiFormatException(status));
+		return (-1);
+	}
+	if (level > 100)
+		return (-1);
+
+	return (level);
+}
+
 static void
 vo_set_brightness(ACPI_HANDLE handle, int level)
 {

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar 10 19:47:05 2010
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 EFDD11065675;
	Wed, 10 Mar 2010 19:47:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DF60B8FC1E;
	Wed, 10 Mar 2010 19:47:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2AJl584044078;
	Wed, 10 Mar 2010 19:47:05 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AJl5Wf044076;
	Wed, 10 Mar 2010 19:47:05 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201003101947.o2AJl5Wf044076@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 10 Mar 2010 19:47:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r204970 - 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: Wed, 10 Mar 2010 19:47:06 -0000

Author: jhb
Date: Wed Mar 10 19:47:05 2010
New Revision: 204970
URL: http://svn.freebsd.org/changeset/base/204970

Log:
  MFC 204638:
  Allow lseek(SEEK_END) to work on disk devices by using the DIOCGMEDIASIZE
  to determine the media size.

Modified:
  stable/8/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/8/sys/kern/vfs_syscalls.c	Wed Mar 10 19:32:53 2010	(r204969)
+++ stable/8/sys/kern/vfs_syscalls.c	Wed Mar 10 19:47:05 2010	(r204970)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1914,7 +1915,7 @@ lseek(td, uap)
 	struct file *fp;
 	struct vnode *vp;
 	struct vattr vattr;
-	off_t offset;
+	off_t offset, size;
 	int error, noneg;
 	int vfslocked;
 
@@ -1945,6 +1946,15 @@ lseek(td, uap)
 		VOP_UNLOCK(vp, 0);
 		if (error)
 			break;
+
+		/*
+		 * If the file references a disk device, then fetch
+		 * the media size and use that to determine the ending
+		 * offset.
+		 */
+		if (vattr.va_size == 0 && vp->v_type == VCHR &&
+		    fo_ioctl(fp, DIOCGMEDIASIZE, &size, cred, td) == 0)
+			vattr.va_size = size;
 		if (noneg &&
 		    (vattr.va_size > OFF_MAX ||
 		    (offset > 0 && vattr.va_size > OFF_MAX - offset))) {

From owner-svn-src-stable-8@FreeBSD.ORG  Wed Mar 10 22:21:07 2010
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 6EF861065687;
	Wed, 10 Mar 2010 22:21:07 +0000 (UTC)
	(envelope-from yongari@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5DEF78FC26;
	Wed, 10 Mar 2010 22:21:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2AML7Nm079129;
	Wed, 10 Mar 2010 22:21:07 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2AML7mY079127;
	Wed, 10 Mar 2010 22:21:07 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201003102221.o2AML7mY079127@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Wed, 10 Mar 2010 22:21:07 +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: r204985 - stable/8/sys/dev/mii
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, 10 Mar 2010 22:21:07 -0000

Author: yongari
Date: Wed Mar 10 22:21:07 2010
New Revision: 204985
URL: http://svn.freebsd.org/changeset/base/204985

Log:
  MFC r204647:
    Remove programming LED register and enable 25MHz TX clock for
    88E1149 PHY. This will fix intermittent watchdog timeouts as well
    as very slow network performance on 88E8072 Yukon Extreme.
  
    PR:	kern/144148

Modified:
  stable/8/sys/dev/mii/e1000phy.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/mii/e1000phy.c
==============================================================================
--- stable/8/sys/dev/mii/e1000phy.c	Wed Mar 10 22:10:36 2010	(r204984)
+++ stable/8/sys/dev/mii/e1000phy.c	Wed Mar 10 22:21:07 2010	(r204985)
@@ -276,7 +276,6 @@ e1000phy_reset(struct mii_softc *sc)
 	case MII_MODEL_MARVELL_E1118:
 		break;
 	case MII_MODEL_MARVELL_E1116:
-	case MII_MODEL_MARVELL_E1149:
 		page = PHY_READ(sc, E1000_EADR);
 		/* Select page 3, LED control register. */
 		PHY_WRITE(sc, E1000_EADR, 3);

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar 11 07:35:30 2010
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 88E621065677;
	Thu, 11 Mar 2010 07:35:30 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 773908FC24;
	Thu, 11 Mar 2010 07:35:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2B7ZUxg001959;
	Thu, 11 Mar 2010 07:35:30 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B7ZUYv001956;
	Thu, 11 Mar 2010 07:35:30 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201003110735.o2B7ZUYv001956@svn.freebsd.org>
From: Fabien Thomas 
Date: Thu, 11 Mar 2010 07:35: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: r204998 - in stable/8/sys: dev/hwpmc 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, 11 Mar 2010 07:35:30 -0000

Author: fabient
Date: Thu Mar 11 07:35:30 2010
New Revision: 204998
URL: http://svn.freebsd.org/changeset/base/204998

Log:
  MFC r204878:
   Change the way shutdown is handled for log file.
  
   pmc_flush_logfile is now non-blocking and just ask the kernel
   to shutdown the file. From that point, no more data is
   accepted by the log thread and when the last buffer is flushed
   the file is closed.
  
   This will remove a deadlock between pmcstat asking for
   flush while it cannot flush the pipe itself.

Modified:
  stable/8/sys/dev/hwpmc/hwpmc_logging.c
  stable/8/sys/sys/pmc.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/hwpmc/hwpmc_logging.c
==============================================================================
--- stable/8/sys/dev/hwpmc/hwpmc_logging.c	Thu Mar 11 07:17:14 2010	(r204997)
+++ stable/8/sys/dev/hwpmc/hwpmc_logging.c	Thu Mar 11 07:35:30 2010	(r204998)
@@ -237,7 +237,7 @@ pmclog_get_buffer(struct pmc_owner *po)
 static void
 pmclog_loop(void *arg)
 {
-	int error;
+	int error, last_buffer;
 	struct pmc_owner *po;
 	struct pmclog_buffer *lb;
 	struct proc *p;
@@ -252,6 +252,7 @@ pmclog_loop(void *arg)
 	p = po->po_owner;
 	td = curthread;
 	mycred = td->td_ucred;
+	last_buffer = 0;
 
 	PROC_LOCK(p);
 	ownercred = crhold(p->p_ucred);
@@ -284,27 +285,20 @@ pmclog_loop(void *arg)
 			if ((lb = TAILQ_FIRST(&po->po_logbuffers)) == NULL) {
 				mtx_unlock_spin(&po->po_mtx);
 
-				/*
-				 * Wakeup the thread waiting for the
-				 * PMC_OP_FLUSHLOG request to
-				 * complete.
-				 */
-				if (po->po_flags & PMC_PO_IN_FLUSH) {
-					po->po_flags &= ~PMC_PO_IN_FLUSH;
-					wakeup_one(po->po_kthread);
-				}
-
 				(void) msleep(po, &pmc_kthread_mtx, PWAIT,
 				    "pmcloop", 0);
 				continue;
 			}
 
 			TAILQ_REMOVE(&po->po_logbuffers, lb, plb_next);
+			if (po->po_flags & PMC_PO_SHUTDOWN)
+				last_buffer = TAILQ_EMPTY(&po->po_logbuffers);
 			mtx_unlock_spin(&po->po_mtx);
 		}
 
 		mtx_unlock(&pmc_kthread_mtx);
 
+sigpipe_retry:
 		/* process the request */
 		PMCDBG(LOG,WRI,2, "po=%p base=%p ptr=%p", po,
 		    lb->plb_base, lb->plb_ptr);
@@ -328,7 +322,8 @@ pmclog_loop(void *arg)
 
 		if (error) {
 			/* XXX some errors are recoverable */
-			/* XXX also check for SIGPIPE if a socket */
+			if (error == EPIPE)
+				goto sigpipe_retry;
 
 			/* send a SIGIO to the owner and exit */
 			PROC_LOCK(p);
@@ -344,6 +339,14 @@ pmclog_loop(void *arg)
 			break;
 		}
 
+		if (last_buffer) {
+			/*
+			 * Close the file to get PMCLOG_EOF error
+			 * in pmclog(3).
+			 */
+			fo_close(po->po_file, curthread);
+		}
+
 		mtx_lock(&pmc_kthread_mtx);
 
 		/* put the used buffer back into the global pool */
@@ -425,6 +428,12 @@ pmclog_reserve(struct pmc_owner *po, int
 
 	mtx_lock_spin(&po->po_mtx);
 
+	/* No more data when shutdown in progress. */
+	if (po->po_flags & PMC_PO_SHUTDOWN) {
+		mtx_unlock_spin(&po->po_mtx);
+		return (NULL);
+	}
+
 	if (po->po_curbuf == NULL)
 		if (pmclog_get_buffer(po) != 0) {
 			mtx_unlock_spin(&po->po_mtx);
@@ -686,7 +695,7 @@ pmclog_deconfigure_log(struct pmc_owner 
 int
 pmclog_flush(struct pmc_owner *po)
 {
-	int error, has_pending_buffers;
+	int error;
 
 	PMCDBG(LOG,FLS,1, "po=%p", po);
 
@@ -714,16 +723,13 @@ pmclog_flush(struct pmc_owner *po)
 	mtx_lock_spin(&po->po_mtx);
 	if (po->po_curbuf)
 		pmclog_schedule_io(po);
-	has_pending_buffers = !TAILQ_EMPTY(&po->po_logbuffers);
 	mtx_unlock_spin(&po->po_mtx);
 
-	if (has_pending_buffers) {
-		po->po_flags |= PMC_PO_IN_FLUSH; /* ask for a wakeup */
-		error = msleep(po->po_kthread, &pmc_kthread_mtx, PWAIT,
-		    "pmcflush", 0);
-		if (error == 0)
-			error = po->po_error;
-	}
+	/*
+	 * Initiate shutdown: no new data queued,
+	 * thread will close file on last block.
+	 */
+	po->po_flags |= PMC_PO_SHUTDOWN;
 
  error:
 	mtx_unlock(&pmc_kthread_mtx);

Modified: stable/8/sys/sys/pmc.h
==============================================================================
--- stable/8/sys/sys/pmc.h	Thu Mar 11 07:17:14 2010	(r204997)
+++ stable/8/sys/sys/pmc.h	Thu Mar 11 07:35:30 2010	(r204998)
@@ -755,7 +755,7 @@ struct pmc_owner  {
 };
 
 #define	PMC_PO_OWNS_LOGFILE		0x00000001 /* has a log file */
-#define	PMC_PO_IN_FLUSH			0x00000010 /* in the middle of a flush */
+#define	PMC_PO_SHUTDOWN			0x00000010 /* in the process of shutdown */
 #define	PMC_PO_INITIAL_MAPPINGS_DONE	0x00000020
 
 /*

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar 11 07:36:46 2010
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 1F67C1065672;
	Thu, 11 Mar 2010 07:36:46 +0000 (UTC)
	(envelope-from fabient@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E7808FC14;
	Thu, 11 Mar 2010 07:36:46 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2B7ajw3002296;
	Thu, 11 Mar 2010 07:36:45 GMT (envelope-from fabient@svn.freebsd.org)
Received: (from fabient@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B7ajDQ002294;
	Thu, 11 Mar 2010 07:36:45 GMT (envelope-from fabient@svn.freebsd.org)
Message-Id: <201003110736.o2B7ajDQ002294@svn.freebsd.org>
From: Fabien Thomas 
Date: Thu, 11 Mar 2010 07:36: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: r204999 - stable/8/usr.sbin/pmcstat
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, 11 Mar 2010 07:36:46 -0000

Author: fabient
Date: Thu Mar 11 07:36:45 2010
New Revision: 204999
URL: http://svn.freebsd.org/changeset/base/204999

Log:
  MFC r204878:
   Change the way shutdown is handled for log file.
  
   pmc_flush_logfile is now non-blocking and just ask the kernel
   to shutdown the file. From that point, no more data is
   accepted by the log thread and when the last buffer is flushed
   the file is closed.
  
   This will remove a deadlock between pmcstat asking for
   flush while it cannot flush the pipe itself.

Modified:
  stable/8/usr.sbin/pmcstat/pmcstat_log.c
Directory Properties:
  stable/8/usr.sbin/pmcstat/   (props changed)

Modified: stable/8/usr.sbin/pmcstat/pmcstat_log.c
==============================================================================
--- stable/8/usr.sbin/pmcstat/pmcstat_log.c	Thu Mar 11 07:35:30 2010	(r204998)
+++ stable/8/usr.sbin/pmcstat/pmcstat_log.c	Thu Mar 11 07:36:45 2010	(r204999)
@@ -1670,10 +1670,8 @@ pmcstat_print_log(void)
 int
 pmcstat_close_log(void)
 {
-	if (pmc_flush_logfile() < 0 ||
-	    pmc_configure_logfile(-1) < 0)
+	if (pmc_flush_logfile() < 0)
 		err(EX_OSERR, "ERROR: logging failed");
-	args.pa_flags &= ~(FLAG_HAS_OUTPUT_LOGFILE | FLAG_HAS_PIPE);
 	return (args.pa_flags & FLAG_HAS_PIPE ? PMCSTAT_EXITING :
 	    PMCSTAT_FINISHED);
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar 11 08:55:04 2010
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 9EC2C10656E3;
	Thu, 11 Mar 2010 08:55:04 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 67A3E8FC21;
	Thu, 11 Mar 2010 08:55:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2B8t4Ql020467;
	Thu, 11 Mar 2010 08:55:04 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B8t3sE020466;
	Thu, 11 Mar 2010 08:55:03 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201003110855.o2B8t3sE020466@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 11 Mar 2010 08:55:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205006 - stable/8/sys/dev/acpica
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, 11 Mar 2010 08:55:04 -0000

Author: avg
Date: Thu Mar 11 08:55:03 2010
New Revision: 205006
URL: http://svn.freebsd.org/changeset/base/205006

Log:
  MFC r203776: acpi cpu: probe+attach before all other enumerated children
  
  X-MFCto7 after:	1 week

Modified:
  stable/8/sys/dev/acpica/acpi.c
  stable/8/sys/dev/acpica/acpi_cpu.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi.c	Thu Mar 11 08:33:39 2010	(r205005)
+++ stable/8/sys/dev/acpica/acpi.c	Thu Mar 11 08:55:03 2010	(r205006)
@@ -1691,14 +1691,14 @@ acpi_probe_order(ACPI_HANDLE handle, int
      * 100000. CPUs
      */
     AcpiGetType(handle, &type);
-    if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
+    if (type == ACPI_TYPE_PROCESSOR)
 	*order = 1;
-    else if (acpi_MatchHid(handle, "PNP0C09"))
+    else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
 	*order = 2;
-    else if (acpi_MatchHid(handle, "PNP0C0F"))
+    else if (acpi_MatchHid(handle, "PNP0C09"))
 	*order = 3;
-    else if (type == ACPI_TYPE_PROCESSOR)
-	*order = 100000;
+    else if (acpi_MatchHid(handle, "PNP0C0F"))
+	*order = 4;
 }
 
 /*

Modified: stable/8/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_cpu.c	Thu Mar 11 08:33:39 2010	(r205005)
+++ stable/8/sys/dev/acpica/acpi_cpu.c	Thu Mar 11 08:55:03 2010	(r205006)
@@ -384,13 +384,31 @@ acpi_cpu_attach(device_t dev)
     /* Probe for Cx state support. */
     acpi_cpu_cx_probe(sc);
 
-    /* Finally,  call identify and probe/attach for child devices. */
-    bus_generic_probe(dev);
-    bus_generic_attach(dev);
-
     return (0);
 }
 
+static void
+acpi_cpu_postattach(void *unused __unused)
+{
+    device_t *devices;
+    int err;
+    int i, n;
+
+    err = devclass_get_devices(acpi_cpu_devclass, &devices, &n);
+    if (err != 0) {
+	printf("devclass_get_devices(acpi_cpu_devclass) failed\n");
+	return;
+    }
+    for (i = 0; i < n; i++)
+	bus_generic_probe(devices[i]);
+    for (i = 0; i < n; i++)
+	bus_generic_attach(devices[i]);
+    free(devices, M_TEMP);
+}
+
+SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE,
+    acpi_cpu_postattach, NULL);
+
 /*
  * Disable any entry to the idle function during suspend and re-enable it
  * during resume.

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar 11 08:58:13 2010
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 BA4D61065677;
	Thu, 11 Mar 2010 08:58:13 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A991C8FC16;
	Thu, 11 Mar 2010 08:58:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2B8wDkL021235;
	Thu, 11 Mar 2010 08:58:13 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2B8wDng021233;
	Thu, 11 Mar 2010 08:58:13 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201003110858.o2B8wDng021233@svn.freebsd.org>
From: Andriy Gapon 
Date: Thu, 11 Mar 2010 08:58:13 +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: r205007 - stable/8/sys/dev/acpica
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, 11 Mar 2010 08:58:13 -0000

Author: avg
Date: Thu Mar 11 08:58:13 2010
New Revision: 205007
URL: http://svn.freebsd.org/changeset/base/205007

Log:
  MFC r203785: acpi: drop the second bus_generic_attach pass
  
  X-MFCto7 after: 1 week

Modified:
  stable/8/sys/dev/acpica/acpi.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi.c	Thu Mar 11 08:55:03 2010	(r205006)
+++ stable/8/sys/dev/acpica/acpi.c	Thu Mar 11 08:58:13 2010	(r205007)
@@ -1659,14 +1659,7 @@ acpi_probe_children(device_t bus)
     bus_generic_probe(bus);
 
     /* Probe/attach all children, created staticly and from the namespace. */
-    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "first bus_generic_attach\n"));
-    bus_generic_attach(bus);
-
-    /*
-     * Some of these children may have attached others as part of their attach
-     * process (eg. the root PCI bus driver), so rescan.
-     */
-    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "second bus_generic_attach\n"));
+    ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n"));
     bus_generic_attach(bus);
 
     /* Attach wake sysctls. */

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar 11 17:11:08 2010
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 39B5A106566C;
	Thu, 11 Mar 2010 17:11:08 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F3E0C8FC30;
	Thu, 11 Mar 2010 17:11:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2BHB7vB099973;
	Thu, 11 Mar 2010 17:11:07 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BHB7lp099971;
	Thu, 11 Mar 2010 17:11:07 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201003111711.o2BHB7lp099971@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Thu, 11 Mar 2010 17:11:07 +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: r205022 - stable/8/share/man/man9
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, 11 Mar 2010 17:11:08 -0000

Author: bschmidt
Date: Thu Mar 11 17:11:07 2010
New Revision: 205022
URL: http://svn.freebsd.org/changeset/base/205022

Log:
  MFC r204213:
  Fix some typos.
  
  Approved by:	rpaulo (mentor)

Modified:
  stable/8/share/man/man9/ieee80211_scan.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/ieee80211_scan.9
==============================================================================
--- stable/8/share/man/man9/ieee80211_scan.9	Thu Mar 11 17:03:32 2010	(r205021)
+++ stable/8/share/man/man9/ieee80211_scan.9	Thu Mar 11 17:11:07 2010	(r205022)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2009
+.Dd February 20, 2010
 .Dt IEEE80211_SCAN 9
 .Os
 .Sh NAME
@@ -177,8 +177,8 @@ Scanning is not tied to the
 state machine that governs vaps except for linkage to the
 .Dv IEEE80211_S_SCAN
 state.
-One one vap at a time may be scanning; this scheduling policy
-is handle in
+Only one vap at a time may be scanning; this scheduling policy
+is handled in
 .Fn ieee80211_new_state
 and is transparent to scanning code.
 .Pp

From owner-svn-src-stable-8@FreeBSD.ORG  Thu Mar 11 17:15:40 2010
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 9572810656B8;
	Thu, 11 Mar 2010 17:15:40 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6916C8FC15;
	Thu, 11 Mar 2010 17:15:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2BHFeif004552;
	Thu, 11 Mar 2010 17:15:40 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2BHFeDc004549;
	Thu, 11 Mar 2010 17:15:40 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201003111715.o2BHFeDc004549@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Thu, 11 Mar 2010 17:15:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205023 - stable/8/sys/dev/iwn
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, 11 Mar 2010 17:15:40 -0000

Author: bschmidt
Date: Thu Mar 11 17:15:40 2010
New Revision: 205023
URL: http://svn.freebsd.org/changeset/base/205023

Log:
  MFC r203934:
  Fix for the Intel WiFi Link 1000.  The EEPROM image is in the OTPROM block
  before the last block, not in the last block itself.
  
  Approved by:	rpaulo (mentor)
  Obtained from:	OpenBSD

Modified:
  stable/8/sys/dev/iwn/if_iwn.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/iwn/if_iwn.c
==============================================================================
--- stable/8/sys/dev/iwn/if_iwn.c	Thu Mar 11 17:11:07 2010	(r205022)
+++ stable/8/sys/dev/iwn/if_iwn.c	Thu Mar 11 17:15:40 2010	(r205023)
@@ -972,8 +972,7 @@ iwn_eeprom_unlock(struct iwn_softc *sc)
 int
 iwn_init_otprom(struct iwn_softc *sc)
 {
-	uint32_t base;
-	uint16_t next;
+	uint16_t prev, base, next;
 	int count, error;
 
 	/* Wait for clock stabilization before accessing prph. */
@@ -1000,25 +999,26 @@ iwn_init_otprom(struct iwn_softc *sc)
 	    IWN_OTP_GP_ECC_CORR_STTS | IWN_OTP_GP_ECC_UNCORR_STTS);
 
 	/*
-	 * Find last valid OTP block (contains the EEPROM image) for HW
-	 * without OTP shadow RAM.
+	 * Find the block before last block (contains the EEPROM image)
+	 * for HW without OTP shadow RAM.
 	 */
 	if (sc->hw_type == IWN_HW_REV_TYPE_1000) {
 		/* Switch to absolute addressing mode. */
 		IWN_CLRBITS(sc, IWN_OTP_GP, IWN_OTP_GP_RELATIVE_ACCESS);
-		base = 0;
+		base = prev = 0;
 		for (count = 0; count < IWN1000_OTP_NBLOCKS; count++) {
 			error = iwn_read_prom_data(sc, base, &next, 2);
 			if (error != 0)
 				return error;
 			if (next == 0)	/* End of linked-list. */
 				break;
+			prev = base;
 			base = le16toh(next);
 		}
-		if (base == 0 || count == IWN1000_OTP_NBLOCKS)
+		if (count == 0 || count == IWN1000_OTP_NBLOCKS)
 			return EIO;
 		/* Skip "next" word. */
-		sc->prom_base = base + 1;
+		sc->prom_base = prev + 1;
 	}
 	return 0;
 }

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar 12 00:51:13 2010
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 7D90C106564A;
	Fri, 12 Mar 2010 00:51:13 +0000 (UTC)
	(envelope-from delphij@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 505F08FC0A;
	Fri, 12 Mar 2010 00:51:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2C0pDjf040622;
	Fri, 12 Mar 2010 00:51:13 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C0pDQH040619;
	Fri, 12 Mar 2010 00:51:13 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201003120051.o2C0pDQH040619@svn.freebsd.org>
From: Xin LI 
Date: Fri, 12 Mar 2010 00:51:13 +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: r205056 - stable/8/games/grdc
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: Fri, 12 Mar 2010 00:51:13 -0000

Author: delphij
Date: Fri Mar 12 00:51:13 2010
New Revision: 205056
URL: http://svn.freebsd.org/changeset/base/205056

Log:
  MFC r203760: Improve time precision for grdc(6):
  
  Traditionally, grdc would obtain time through time(3) which in turn gets
  only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
  each screen refresh.
  
  This approach would have two problems.  First, we are not guaranteed to
  be waken up at the beginning of a whole second, which will typically
  exhibit as a "lag" on second number.  Second, because we sleep for whole
  second, and the refresh process would take some time, the error would
  accumulate from time to time, making the lag variable.
  
  Make grdc(6) to use time(3) to get time only at the beginning, and sample
  time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
  nanosecond part to caculate how much time we want to sleep.
  
  PR:		bin/120813

Modified:
  stable/8/games/grdc/grdc.c
Directory Properties:
  stable/8/games/grdc/   (props changed)

Modified: stable/8/games/grdc/grdc.c
==============================================================================
--- stable/8/games/grdc/grdc.c	Fri Mar 12 00:25:04 2010	(r205055)
+++ stable/8/games/grdc/grdc.c	Fri Mar 12 00:51:13 2010	(r205056)
@@ -59,6 +59,7 @@ main(argc, argv)
 int argc;
 char **argv;
 {
+struct timespec ts;
 long t, a;
 int i, j, s, k;
 int n;
@@ -136,9 +137,9 @@ int t12;
 
 		attrset(COLOR_PAIR(2));
 	}
+	time(&now);
 	do {
 		mask = 0;
-		time(&now);
 		tm = localtime(&now);
 		set(tm->tm_sec%10, 0);
 		set(tm->tm_sec/10, 4);
@@ -193,7 +194,19 @@ int t12;
 		}
 		movto(6, 0);
 		refresh();
-		sleep(1);
+		clock_gettime(CLOCK_REALTIME_FAST, &ts);
+		if (ts.tv_sec == now) {
+			if (ts.tv_nsec > 0) {
+				ts.tv_sec = 0;
+				ts.tv_nsec = 1000000000 - ts.tv_nsec;
+			} else {
+				ts.tv_sec = 1;
+				ts.tv_nsec = 0;
+			}
+			nanosleep(&ts, NULL);
+			now = ts.tv_sec + 1;
+		} else
+			now = ts.tv_sec;
 		if (sigtermed) {
 			standend();
 			clear();

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar 12 05:16:24 2010
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 591551065672;
	Fri, 12 Mar 2010 05:16:24 +0000 (UTC)
	(envelope-from joerg@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 494D98FC08;
	Fri, 12 Mar 2010 05:16:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2C5GOKK000620;
	Fri, 12 Mar 2010 05:16:24 GMT (envelope-from joerg@svn.freebsd.org)
Received: (from joerg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C5GONc000618;
	Fri, 12 Mar 2010 05:16:24 GMT (envelope-from joerg@svn.freebsd.org)
Message-Id: <201003120516.o2C5GONc000618@svn.freebsd.org>
From: Joerg Wunsch 
Date: Fri, 12 Mar 2010 05:16:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205068 - stable/8/usr.bin/perror
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: Fri, 12 Mar 2010 05:16:24 -0000

Author: joerg
Date: Fri Mar 12 05:16:24 2010
New Revision: 205068
URL: http://svn.freebsd.org/changeset/base/205068

Log:
  (r205011) The "number" argument is everything but optional.

Modified:
  stable/8/usr.bin/perror/perror.1
Directory Properties:
  stable/8/usr.bin/perror/   (props changed)

Modified: stable/8/usr.bin/perror/perror.1
==============================================================================
--- stable/8/usr.bin/perror/perror.1	Fri Mar 12 05:08:05 2010	(r205067)
+++ stable/8/usr.bin/perror/perror.1	Fri Mar 12 05:16:24 2010	(r205068)
@@ -34,7 +34,7 @@
 .Nd "print an error number as a string"
 .Sh SYNOPSIS
 .Nm
-.Op Ar number
+.Ar number
 .Sh DESCRIPTION
 The
 .Nm

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar 12 06:56:52 2010
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 3092C106566C;
	Fri, 12 Mar 2010 06:56:52 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 217488FC08;
	Fri, 12 Mar 2010 06:56:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2C6uqNr022869;
	Fri, 12 Mar 2010 06:56:52 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2C6uqQD022867;
	Fri, 12 Mar 2010 06:56:52 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201003120656.o2C6uqQD022867@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Fri, 12 Mar 2010 06:56:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r205070 - stable/8/lib/libc/stdio
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: Fri, 12 Mar 2010 06:56:52 -0000

Author: jh
Date: Fri Mar 12 06:56:51 2010
New Revision: 205070
URL: http://svn.freebsd.org/changeset/base/205070

Log:
  MFC r204447:
  
  In _gettemp(), check that the length of the path doesn't exceed
  MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
  carrybuf causing a buffer overflow.
  
  PR:		bin/140228

Modified:
  stable/8/lib/libc/stdio/mktemp.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/stdio/mktemp.c
==============================================================================
--- stable/8/lib/libc/stdio/mktemp.c	Fri Mar 12 06:31:19 2010	(r205069)
+++ stable/8/lib/libc/stdio/mktemp.c	Fri Mar 12 06:56:51 2010	(r205070)
@@ -116,6 +116,10 @@ _gettemp(path, doopen, domkdir, slen)
 
 	for (trv = path; *trv != '\0'; ++trv)
 		;
+	if (trv - path >= MAXPATHLEN) {
+		errno = ENAMETOOLONG;
+		return (0);
+	}
 	trv -= slen;
 	suffp = trv;
 	--trv;

From owner-svn-src-stable-8@FreeBSD.ORG  Fri Mar 12 13:56:06 2010
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 88E9D106564A;
	Fri, 12 Mar 2010 13:56:06 +0000 (UTC)
	(envelope-from oliver.pntr@gmail.com)
Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com
	[209.85.218.216])
	by mx1.freebsd.org (Postfix) with ESMTP id 69AB08FC20;
	Fri, 12 Mar 2010 13:56:05 +0000 (UTC)
Received: by bwz8 with SMTP id 8so1046272bwz.3
	for ; Fri, 12 Mar 2010 05:56:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:in-reply-to:references
	:date:message-id:subject:from:to:cc:content-type;
	bh=Y3ETfVT6fqT607Y8chRsoLImJo4yjBum+BpIsrHJhb8=;
	b=w8xfhdlYKsKtd9xa0k7YTqleUXIvKuHMEU9xUjThQihLQIxpG3SL2Od9mY0b5GQqtM
	rU5OoLaYAlFBq4REcgrdiYvlRf40KAYxZaBMHd2pyAn4KNPY44YoTX5IexUBez4YzuGW
	HAKgjvoCS92siAJjCgLj2Pmmw579CE5DTLwE0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=J2eqDo0D+Y+c02KxLRRltjKtrrq38OhDomNv30B20lcczROD7NwLog+jUNJVMJv0Qt
	XdFC2kGKiFy1ICiEuoea7xW/rZqubi4JgX+L8LZUP9A+leFb92kAa314tPsH3b9rgxhz
	C/BKtbfZ18OaXOfHc/34TAWNj6Qzo+5v45QPI=
MIME-Version: 1.0
Received: by 10.204.129.218 with SMTP id p26mr291659bks.145.1268402164052; 
	Fri, 12 Mar 2010 05:56:04 -0800 (PST)
In-Reply-To: <201003120656.o2C6uqQD022867@svn.freebsd.org>
References: <201003120656.o2C6uqQD022867@svn.freebsd.org>
Date: Fri, 12 Mar 2010 14:56:03 +0100
Message-ID: <6101e8c41003120556x64c73cfav9e2fc48c89de7490@mail.gmail.com>
From: Oliver Pinter 
To: Jaakko Heinonen 
Content-Type: text/plain; charset=ISO-8859-1
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r205070 - stable/8/lib/libc/stdio
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: Fri, 12 Mar 2010 13:56:06 -0000

this commit for 7-STABLE?

On 3/12/10, Jaakko Heinonen  wrote:
> Author: jh
> Date: Fri Mar 12 06:56:51 2010
> New Revision: 205070
> URL: http://svn.freebsd.org/changeset/base/205070
>
> Log:
>   MFC r204447:
>
>   In _gettemp(), check that the length of the path doesn't exceed
>   MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
>   carrybuf causing a buffer overflow.
>
>   PR:		bin/140228
>
> Modified:
>   stable/8/lib/libc/stdio/mktemp.c
> Directory Properties:
>   stable/8/lib/libc/   (props changed)
>   stable/8/lib/libc/stdtime/   (props changed)
>
> Modified: stable/8/lib/libc/stdio/mktemp.c
> ==============================================================================
> --- stable/8/lib/libc/stdio/mktemp.c	Fri Mar 12 06:31:19 2010	(r205069)
> +++ stable/8/lib/libc/stdio/mktemp.c	Fri Mar 12 06:56:51 2010	(r205070)
> @@ -116,6 +116,10 @@ _gettemp(path, doopen, domkdir, slen)
>
>  	for (trv = path; *trv != '\0'; ++trv)
>  		;
> +	if (trv - path >= MAXPATHLEN) {
> +		errno = ENAMETOOLONG;
> +		return (0);
> +	}
>  	trv -= slen;
>  	suffp = trv;
>  	--trv;
> _______________________________________________
> svn-src-stable@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-stable
> To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org"
>

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar 13 07:40:03 2010
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 23B5F1065674;
	Sat, 13 Mar 2010 07:40:03 +0000 (UTC) (envelope-from jh@FreeBSD.org)
Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi
	[195.197.172.111])
	by mx1.freebsd.org (Postfix) with ESMTP id D7A2D8FC1B;
	Sat, 13 Mar 2010 07:40:02 +0000 (UTC)
Received: from a91-153-117-195.elisa-laajakaista.fi
	(a91-153-117-195.elisa-laajakaista.fi [91.153.117.195])
	by gw03.mail.saunalahti.fi (Postfix) with SMTP id ACD3A21654C;
	Sat, 13 Mar 2010 09:24:41 +0200 (EET)
Date: Sat, 13 Mar 2010 09:24:41 +0200
From: Jaakko Heinonen 
To: Oliver Pinter 
Message-ID: <20100313072441.GA966@a91-153-117-195.elisa-laajakaista.fi>
References: <201003120656.o2C6uqQD022867@svn.freebsd.org>
	<6101e8c41003120556x64c73cfav9e2fc48c89de7490@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <6101e8c41003120556x64c73cfav9e2fc48c89de7490@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
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: r205070 - stable/8/lib/libc/stdio
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, 13 Mar 2010 07:40:03 -0000

On 2010-03-12, Oliver Pinter wrote:
> this commit for 7-STABLE?

I will commit it to stable/7 sooner or later.

-- 
Jaakko

From owner-svn-src-stable-8@FreeBSD.ORG  Sat Mar 13 16:37:18 2010
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 137691065670;
	Sat, 13 Mar 2010 16:37:18 +0000 (UTC)
	(envelope-from ticso@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 031138FC13;
	Sat, 13 Mar 2010 16:37:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2DGbHQX073762;
	Sat, 13 Mar 2010 16:37:17 GMT (envelope-from ticso@svn.freebsd.org)
Received: (from ticso@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2DGbHU0073760;
	Sat, 13 Mar 2010 16:37:17 GMT (envelope-from ticso@svn.freebsd.org)
Message-Id: <201003131637.o2DGbHU0073760@svn.freebsd.org>
From: Bernd Walter 
Date: Sat, 13 Mar 2010 16:37: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: r205124 - stable/8/sys/arm/at91
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, 13 Mar 2010 16:37:18 -0000

Author: ticso
Date: Sat Mar 13 16:37:17 2010
New Revision: 205124
URL: http://svn.freebsd.org/changeset/base/205124

Log:
  MFC 204462,204463,204476: fix multicast hashes

Modified:
  stable/8/sys/arm/at91/if_ate.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/arm/at91/if_ate.c
==============================================================================
--- stable/8/sys/arm/at91/if_ate.c	Sat Mar 13 16:15:15 2010	(r205123)
+++ stable/8/sys/arm/at91/if_ate.c	Sat Mar 13 16:37:17 2010	(r205124)
@@ -383,6 +383,16 @@ ate_load_rx_buf(void *arg, bus_dma_segme
 	bus_dmamap_sync(sc->rxtag, sc->rx_map[i], BUS_DMASYNC_PREREAD);
 }
 
+static uint32_t
+ate_mac_hash(const uint8_t *buf)
+{
+	uint32_t index = 0;
+	for (int i = 0; i < 48; i++) {
+		index ^= ((buf[i >> 3] >> (i & 7)) & 1) << (i % 6);
+	}
+	return (index);
+}
+
 /*
  * Compute the multicast filter for this device using the standard
  * algorithm.  I wonder why this isn't in ether somewhere as a lot
@@ -417,8 +427,8 @@ ate_setmcast(struct ate_softc *sc)
 	TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 		if (ifma->ifma_addr->sa_family != AF_LINK)
 			continue;
-		index = ether_crc32_be(LLADDR((struct sockaddr_dl *)
-		    ifma->ifma_addr), ETHER_ADDR_LEN) >> 26;
+		index = ate_mac_hash(LLADDR((struct sockaddr_dl *)
+		    ifma->ifma_addr));
 		af[index >> 3] |= 1 << (index & 7);
 	}
 	if_maddr_runlock(ifp);