svn commit: r210913 - head/sys/mips/sibyte
Author: neel Date: Fri Aug 6 07:03:22 2010 New Revision: 210913 URL: http://svn.freebsd.org/changeset/base/210913 Log: Remove redundant declaration of 'pcib_driver' class from sb_zbpci.c. This causes a compilation error. The declaration is provided by sys/dev/pci/pcib_private.h starting from r210864. Modified: head/sys/mips/sibyte/sb_zbpci.c Modified: head/sys/mips/sibyte/sb_zbpci.c == --- head/sys/mips/sibyte/sb_zbpci.c Fri Aug 6 06:04:27 2010 (r210912) +++ head/sys/mips/sibyte/sb_zbpci.c Fri Aug 6 07:03:22 2010 (r210913) @@ -457,7 +457,6 @@ static device_method_t zbpci_methods[] = * consider drivers belonging to the "pcib" when probing children of * "zbpci". */ -DECLARE_CLASS(pcib_driver); DEFINE_CLASS_1(zbpci, zbpci_driver, zbpci_methods, 0, pcib_driver); static devclass_t zbpci_devclass; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210914 - in head/sys/mips: include mips
Author: jchandra Date: Fri Aug 6 07:32:33 2010 New Revision: 210914 URL: http://svn.freebsd.org/changeset/base/210914 Log: Fix the issue reported by alc: pmap_page_wired_mappings() counts the number of pv entries for the specified page that have the pv entry wired flag set to TRUE. pmap_enter() correctly initializes this flag. However, pmap_change_wiring() doesn't update the corresponding pv entry flag, only the PTE. So, the count returned by pmap_page_wired_mappings() will sometimes be wrong. In the short term, the best fix would be to eliminate the pv entry flag and use only the PTE. That flag is wasting non-trivial memory. Remove pv_wired flag, and use PTE flag to count the wired mappings. Reviewed by: alc Modified: head/sys/mips/include/pmap.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/pmap.h == --- head/sys/mips/include/pmap.hFri Aug 6 07:03:22 2010 (r210913) +++ head/sys/mips/include/pmap.hFri Aug 6 07:32:33 2010 (r210914) @@ -124,7 +124,6 @@ typedef struct pv_entry { TAILQ_ENTRY(pv_entry) pv_list; TAILQ_ENTRY(pv_entry) pv_plist; vm_page_t pv_ptem; /* VM page for pte */ - boolean_t pv_wired; /* whether this entry is wired */ } *pv_entry_t; Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Fri Aug 6 07:03:22 2010(r210913) +++ head/sys/mips/mips/pmap.c Fri Aug 6 07:32:33 2010(r210914) @@ -1473,7 +1473,6 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm pv->pv_va = va; pv->pv_pmap = pmap; pv->pv_ptem = mpte; - pv->pv_wired = FALSE; TAILQ_INSERT_TAIL(&pmap->pm_pvlist, pv, pv_plist); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); m->md.pv_list_count++; @@ -1897,7 +1896,6 @@ pmap_enter(pmap_t pmap, vm_offset_t va, pv->pv_va = va; pv->pv_pmap = pmap; pv->pv_ptem = mpte; - pv->pv_wired = wired; TAILQ_INSERT_TAIL(&pmap->pm_pvlist, pv, pv_plist); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); m->md.pv_list_count++; @@ -2655,15 +2653,22 @@ int pmap_page_wired_mappings(vm_page_t m) { pv_entry_t pv; + pmap_t pmap; + pt_entry_t *pte; int count; count = 0; if ((m->flags & PG_FICTITIOUS) != 0) return (count); vm_page_lock_queues(); - TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) - if (pv->pv_wired) - count++; + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + pmap = pv->pv_pmap; + PMAP_LOCK(pmap); + pte = pmap_pte(pmap, pv->pv_va); + if (pte_test(pte, PTE_W)) + count++; + PMAP_UNLOCK(pmap); + } vm_page_unlock_queues(); return (count); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210918 - head/sys/fs/devfs
Author: kib Date: Fri Aug 6 09:06:55 2010 New Revision: 210918 URL: http://svn.freebsd.org/changeset/base/210918 Log: Initialize VV_ISTTY vnode flag on the devfs vnode creation instead of doing it on each open. In collaboration with:pho MFC after:1 month Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c == --- head/sys/fs/devfs/devfs_vnops.c Fri Aug 6 08:59:54 2010 (r210917) +++ head/sys/fs/devfs/devfs_vnops.c Fri Aug 6 09:06:55 2010 (r210918) @@ -337,6 +337,7 @@ devfs_allocv(struct devfs_dirent *de, st struct vnode *vp; struct cdev *dev; struct devfs_mount *dmp; + struct cdevsw *dsw; dmp = VFSTODEVFS(mp); if (de->de_flags & DE_DOOMED) { @@ -393,6 +394,10 @@ devfs_allocv(struct devfs_dirent *de, st KASSERT(vp->v_usecount == 1, ("%s %d (%d)\n", __func__, __LINE__, vp->v_usecount)); dev->si_usecount += vp->v_usecount; + /* Special casing of ttys for deadfs. Probably redundant. */ + dsw = dev->si_devsw; + if (dsw != NULL && (dsw->d_flags & D_TTY) != 0) + vp->v_vflag |= VV_ISTTY; dev_unlock(); VI_UNLOCK(vp); vp->v_op = &devfs_specops; @@ -972,10 +977,6 @@ devfs_open(struct vop_open_args *ap) if (dsw == NULL) return (ENXIO); - /* XXX: Special casing of ttys for deadfs. Probably redundant. */ - if (dsw->d_flags & D_TTY) - vp->v_vflag |= VV_ISTTY; - VOP_UNLOCK(vp, 0); fpop = td->td_fpop; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210921 - head/sys/fs/devfs
Author: kib Date: Fri Aug 6 09:23:47 2010 New Revision: 210921 URL: http://svn.freebsd.org/changeset/base/210921 Log: Enable shared locks for the devfs vnodes. Honor the locking mode requested by lookup(). This should be a nop at the moment. In collaboration with:pho MFC after:1 month Modified: head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_vfsops.c head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs.h == --- head/sys/fs/devfs/devfs.h Fri Aug 6 09:21:07 2010(r210920) +++ head/sys/fs/devfs/devfs.h Fri Aug 6 09:23:47 2010(r210921) @@ -172,7 +172,7 @@ extern unsigned devfs_rule_depth; void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de); void devfs_rules_cleanup (struct devfs_mount *dm); int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td); -int devfs_allocv (struct devfs_dirent *de, struct mount *mp, +int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, struct vnode **vpp); void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int vp_locked); void devfs_dirent_free(struct devfs_dirent *de); Modified: head/sys/fs/devfs/devfs_vfsops.c == --- head/sys/fs/devfs/devfs_vfsops.cFri Aug 6 09:21:07 2010 (r210920) +++ head/sys/fs/devfs/devfs_vfsops.cFri Aug 6 09:23:47 2010 (r210921) @@ -155,7 +155,7 @@ devfs_root(struct mount *mp, int flags, dmp = VFSTODEVFS(mp); sx_xlock(&dmp->dm_lock); - error = devfs_allocv(dmp->dm_rootdir, mp, &vp); + error = devfs_allocv(dmp->dm_rootdir, mp, LK_EXCLUSIVE, &vp); if (error) return (error); vp->v_vflag |= VV_ROOT; Modified: head/sys/fs/devfs/devfs_vnops.c == --- head/sys/fs/devfs/devfs_vnops.c Fri Aug 6 09:21:07 2010 (r210920) +++ head/sys/fs/devfs/devfs_vnops.c Fri Aug 6 09:23:47 2010 (r210921) @@ -331,7 +331,8 @@ devfs_insmntque_dtr(struct vnode *vp, vo * it on return. */ int -devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp) +devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, +struct vnode **vpp) { int error; struct vnode *vp; @@ -352,7 +353,7 @@ devfs_allocv(struct devfs_dirent *de, st VI_LOCK(vp); mtx_unlock(&devfs_de_interlock); sx_xunlock(&dmp->dm_lock); - error = vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, curthread); + error = vget(vp, lockmode | LK_INTERLOCK, curthread); sx_xlock(&dmp->dm_lock); if (devfs_allocv_drop_refs(0, dmp, de)) { if (error == 0) @@ -408,6 +409,7 @@ devfs_allocv(struct devfs_dirent *de, st } else { vp->v_type = VBAD; } + VN_LOCK_ASHARE(vp); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY | LK_NOWITNESS); mtx_lock(&devfs_de_interlock); vp->v_data = de; @@ -758,7 +760,7 @@ devfs_lookupx(struct vop_lookup_args *ap struct devfs_dirent **dde; struct devfs_mount *dmp; struct cdev *cdev; - int error, flags, nameiop; + int error, flags, nameiop, dvplocked; char specname[SPECNAMELEN + 1], *pname; cnp = ap->a_cnp; @@ -799,10 +801,12 @@ devfs_lookupx(struct vop_lookup_args *ap de = devfs_parent_dirent(dd); if (de == NULL) return (ENOENT); + dvplocked = VOP_ISLOCKED(dvp); VOP_UNLOCK(dvp, 0); - error = devfs_allocv(de, dvp->v_mount, vpp); + error = devfs_allocv(de, dvp->v_mount, + cnp->cn_lkflags & LK_TYPE_MASK, vpp); *dm_unlock = 0; - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); + vn_lock(dvp, dvplocked | LK_RETRY); return (error); } @@ -886,7 +890,8 @@ devfs_lookupx(struct vop_lookup_args *ap return (0); } } - error = devfs_allocv(de, dvp->v_mount, vpp); + error = devfs_allocv(de, dvp->v_mount, cnp->cn_lkflags & LK_TYPE_MASK, + vpp); *dm_unlock = 0; return (error); } @@ -944,7 +949,7 @@ devfs_mknod(struct vop_mknod_args *ap) if (de == NULL) goto notfound; de->de_flags &= ~DE_WHITEOUT; - error = devfs_allocv(de, dvp->v_mount, vpp); + error = devfs_allocv(de, dvp->v_mount, LK_EXCLUSIVE, vpp); return (error); notfound: sx_xunlock(&dmp->dm_lock); @@ -959,7 +964,7 @@ devfs_open(struct vop_open_args *ap) struct vnode *vp = ap->a_vp; struct cdev *dev = vp->v_rdev; struct file *fp = ap->a_fp; - in
svn commit: r210922 - head/sys/mips/mips
Author: jchandra Date: Fri Aug 6 09:25:42 2010 New Revision: 210922 URL: http://svn.freebsd.org/changeset/base/210922 Log: Fix issue reported by alc : MIPS doesn't really need to use atomic_cmpset_int() in situations like this because the software dirty bit emulation in trap.c acquires the pmap lock. Atomics like this appear to be a carryover from i386 where the hardware-managed TLB might concurrently set the modified bit. Reviewed by: alc Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Fri Aug 6 09:23:47 2010(r210921) +++ head/sys/mips/mips/pmap.c Fri Aug 6 09:25:42 2010(r210922) @@ -1716,7 +1716,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv vm_page_lock_queues(); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { - pt_entry_t pbits, obits; + pt_entry_t pbits; vm_page_t m; vm_paddr_t pa; @@ -1745,8 +1745,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv /* Skip invalid PTEs */ if (!pte_test(pte, PTE_V)) continue; -retry: - obits = pbits = *pte; + pbits = *pte; pa = TLBLO_PTE_TO_PA(pbits); if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { m = PHYS_TO_VM_PAGE(pa); @@ -1757,8 +1756,7 @@ retry: pte_set(&pbits, PTE_RO); if (pbits != *pte) { - if (!atomic_cmpset_int((u_int *)pte, obits, pbits)) - goto retry; + *pte = pbits; pmap_update_page(pmap, sva, pbits); } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210923 - in head/sys: fs/devfs kern sys vm
Author: kib Date: Fri Aug 6 09:42:15 2010 New Revision: 210923 URL: http://svn.freebsd.org/changeset/base/210923 Log: Add new make_dev_p(9) flag MAKEDEV_ETERNAL to inform devfs that created cdev will never be destroyed. Propagate the flag to devfs vnodes as VV_ETERNVALDEV. Use the flags to avoid acquiring devmtx and taking a thread reference on such nodes. In collaboration with:pho MFC after:1 month Modified: head/sys/fs/devfs/devfs_rule.c head/sys/fs/devfs/devfs_vnops.c head/sys/kern/kern_conf.c head/sys/kern/tty.c head/sys/kern/vfs_bio.c head/sys/sys/conf.h head/sys/sys/vnode.h head/sys/vm/device_pager.c head/sys/vm/vm_mmap.c Modified: head/sys/fs/devfs/devfs_rule.c == --- head/sys/fs/devfs/devfs_rule.c Fri Aug 6 09:25:42 2010 (r210922) +++ head/sys/fs/devfs/devfs_rule.c Fri Aug 6 09:42:15 2010 (r210923) @@ -528,6 +528,7 @@ devfs_rule_match(struct devfs_krule *dk, struct devfs_rule *dr = &dk->dk_rule; struct cdev *dev; struct cdevsw *dsw; + int ref; dev = devfs_rule_getdev(de); /* @@ -545,14 +546,14 @@ devfs_rule_match(struct devfs_krule *dk, if (dr->dr_icond & DRC_DSWFLAGS) { if (dev == NULL) return (0); - dsw = dev_refthread(dev); + dsw = dev_refthread(dev, &ref); if (dsw == NULL) return (0); if ((dsw->d_flags & dr->dr_dswflags) == 0) { - dev_relthread(dev); + dev_relthread(dev, ref); return (0); } - dev_relthread(dev); + dev_relthread(dev, ref); } if (dr->dr_icond & DRC_PATHPTRN) if (!devfs_rule_matchpath(dk, de)) Modified: head/sys/fs/devfs/devfs_vnops.c == --- head/sys/fs/devfs/devfs_vnops.c Fri Aug 6 09:25:42 2010 (r210922) +++ head/sys/fs/devfs/devfs_vnops.c Fri Aug 6 09:42:15 2010 (r210923) @@ -82,13 +82,14 @@ struct mtx cdevpriv_mtx; MTX_SYSINIT(cdevpriv_mtx, &cdevpriv_mtx, "cdevpriv lock", MTX_DEF); static int -devfs_fp_check(struct file *fp, struct cdev **devp, struct cdevsw **dswp) +devfs_fp_check(struct file *fp, struct cdev **devp, struct cdevsw **dswp, +int *ref) { - *dswp = devvn_refthread(fp->f_vnode, devp); + *dswp = devvn_refthread(fp->f_vnode, devp, ref); if (*devp != fp->f_data) { if (*dswp != NULL) - dev_relthread(*devp); + dev_relthread(*devp, *ref); return (ENXIO); } KASSERT((*devp)->si_refcount > 0, @@ -401,6 +402,8 @@ devfs_allocv(struct devfs_dirent *de, st vp->v_vflag |= VV_ISTTY; dev_unlock(); VI_UNLOCK(vp); + if ((dev->si_flags & SI_ETERNAL) != 0) + vp->v_vflag |= VV_ETERNALDEV; vp->v_op = &devfs_specops; } else if (de->de_dirent->d_type == DT_DIR) { vp->v_type = VDIR; @@ -465,7 +468,7 @@ devfs_close(struct vop_close_args *ap) struct thread *td = ap->a_td; struct cdev *dev = vp->v_rdev; struct cdevsw *dsw; - int vp_locked, error; + int vp_locked, error, ref; /* * XXX: Don't call d_close() if we were called because of @@ -508,7 +511,7 @@ devfs_close(struct vop_close_args *ap) * sum of the reference counts on all the aliased * vnodes descends to one, we are on last close. */ - dsw = dev_refthread(dev); + dsw = dev_refthread(dev, &ref); if (dsw == NULL) return (ENXIO); VI_LOCK(vp); @@ -518,7 +521,7 @@ devfs_close(struct vop_close_args *ap) /* Keep device updated on status. */ } else if (count_dev(dev) > 1) { VI_UNLOCK(vp); - dev_relthread(dev); + dev_relthread(dev, ref); return (0); } vholdl(vp); @@ -528,7 +531,7 @@ devfs_close(struct vop_close_args *ap) KASSERT(dev->si_refcount > 0, ("devfs_close() on un-referenced struct cdev *(%s)", devtoname(dev))); error = dsw->d_close(dev, ap->a_fflag, S_IFCHR, td); - dev_relthread(dev); + dev_relthread(dev, ref); vn_lock(vp, vp_locked | LK_RETRY); vdrop(vp); return (error); @@ -646,20 +649,20 @@ devfs_ioctl_f(struct file *fp, u_long co struct cdevsw *dsw; struct vnode *vp; struct vnode *vpold; - int error, i; + int error, i, ref; const char *p; struct fiodgname_arg *fgn; struct file *fpop; fpop = td->td_fpop; - error = devfs_fp_check(fp, &dev, &dsw); +
svn commit: r210924 - head/sys/kern
Author: kib Date: Fri Aug 6 09:44:01 2010 New Revision: 210924 URL: http://svn.freebsd.org/changeset/base/210924 Log: Add "show cdev" ddb command. In collaboration with:pho MFC after:1 month Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c == --- head/sys/kern/kern_conf.c Fri Aug 6 09:42:15 2010(r210923) +++ head/sys/kern/kern_conf.c Fri Aug 6 09:44:01 2010(r210924) @@ -1229,3 +1229,71 @@ devdtr_init(void *dummy __unused) } SYSINIT(devdtr, SI_SUB_DEVFS, SI_ORDER_SECOND, devdtr_init, NULL); + +#include "opt_ddb.h" +#ifdef DDB +#include + +#include + +DB_SHOW_COMMAND(cdev, db_show_cdev) +{ + struct cdev_priv *cdp; + struct cdev *dev; + u_int flags; + char buf[512]; + + if (!have_addr) { + TAILQ_FOREACH(cdp, &cdevp_list, cdp_list) { + dev = &cdp->cdp_c; + db_printf("%s %p\n", dev->si_name, dev); + if (db_pager_quit) + break; + } + return; + } + + dev = (struct cdev *)addr; + cdp = cdev2priv(dev); + db_printf("dev %s ref %d use %ld thr %ld inuse %u fdpriv %p\n", + dev->si_name, dev->si_refcount, dev->si_usecount, + dev->si_threadcount, cdp->cdp_inuse, cdp->cdp_fdpriv.lh_first); + db_printf("devsw %p si_drv0 %d si_drv1 %p si_drv2 %p\n", + dev->si_devsw, dev->si_drv0, dev->si_drv1, dev->si_drv2); + flags = dev->si_flags; +#defineSI_FLAG(flag) do { \ + if (flags & (flag)) { \ + if (buf[0] != '\0') \ + strlcat(buf, ", ", sizeof(buf));\ + strlcat(buf, (#flag) + 3, sizeof(buf)); \ + flags &= ~(flag); \ + } \ +} while (0) + buf[0] = '\0'; + SI_FLAG(SI_ETERNAL); + SI_FLAG(SI_ALIAS); + SI_FLAG(SI_NAMED); + SI_FLAG(SI_CHEAPCLONE); + SI_FLAG(SI_CHILD); + SI_FLAG(SI_DEVOPEN); + SI_FLAG(SI_CONSOPEN); + SI_FLAG(SI_DUMPDEV); + SI_FLAG(SI_CANDELETE); + SI_FLAG(SI_CLONELIST); + db_printf("si_flags %s\n", buf); + + flags = cdp->cdp_flags; +#defineCDP_FLAG(flag) do { \ + if (flags & (flag)) { \ + if (buf[0] != '\0') \ + strlcat(buf, ", ", sizeof(buf));\ + strlcat(buf, (#flag) + 4, sizeof(buf)); \ + flags &= ~(flag); \ + } \ +} while (0) + buf[0] = '\0'; + CDP_FLAG(CDP_ACTIVE); + CDP_FLAG(CDP_SCHED_DTR); + db_printf("cdp_flags %s\n", buf); +} +#endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210925 - head/sys/fs/devfs
Author: kib Date: Fri Aug 6 09:46:53 2010 New Revision: 210925 URL: http://svn.freebsd.org/changeset/base/210925 Log: Enable shared lookups and externed shared ops for devfs. In collaboration with:pho MFC after:1 month Modified: head/sys/fs/devfs/devfs_vfsops.c Modified: head/sys/fs/devfs/devfs_vfsops.c == --- head/sys/fs/devfs/devfs_vfsops.cFri Aug 6 09:44:01 2010 (r210924) +++ head/sys/fs/devfs/devfs_vfsops.cFri Aug 6 09:46:53 2010 (r210925) @@ -81,7 +81,8 @@ devfs_mount(struct mount *mp) MNT_ILOCK(mp); mp->mnt_flag |= MNT_LOCAL; - mp->mnt_kern_flag |= MNTK_MPSAFE; + mp->mnt_kern_flag |= MNTK_MPSAFE | MNTK_LOOKUP_SHARED | + MNTK_EXTENDED_SHARED; #ifdef MAC mp->mnt_flag |= MNT_MULTILABEL; #endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210926 - head/sys/dev/null
Author: kib Date: Fri Aug 6 09:47:48 2010 New Revision: 210926 URL: http://svn.freebsd.org/changeset/base/210926 Log: Mark /dev/zero and /dev/null as eternal. In collaboration with:pho MFC after:1 month Modified: head/sys/dev/null/null.c Modified: head/sys/dev/null/null.c == --- head/sys/dev/null/null.cFri Aug 6 09:46:53 2010(r210925) +++ head/sys/dev/null/null.cFri Aug 6 09:47:48 2010(r210926) @@ -112,10 +112,10 @@ null_modevent(module_t mod __unused, int if (bootverbose) printf("null: \n"); zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); - null_dev = make_dev(&null_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0666, "null"); - zero_dev = make_dev(&zero_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0666, "zero"); + null_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &null_cdevsw, 0, + NULL, UID_ROOT, GID_WHEEL, 0666, "null"); + zero_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &zero_cdevsw, 0, + NULL, UID_ROOT, GID_WHEEL, 0666, "zero"); break; case MOD_UNLOAD: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210927 - head/usr.bin/grep/nls
Author: gabor Date: Fri Aug 6 10:34:48 2010 New Revision: 210927 URL: http://svn.freebsd.org/changeset/base/210927 Log: - Some fixes to Ukranian catalog Submitted by: avg, Alex Kozlov Modified: head/usr.bin/grep/nls/uk_UA.UTF-8.msg Modified: head/usr.bin/grep/nls/uk_UA.UTF-8.msg == --- head/usr.bin/grep/nls/uk_UA.UTF-8.msg Fri Aug 6 09:47:48 2010 (r210926) +++ head/usr.bin/grep/nls/uk_UA.UTF-8.msg Fri Aug 6 10:34:48 2010 (r210927) @@ -1,8 +1,8 @@ $ $FreeBSD$ $set 1 $quote " -1 "(стандартний ввод)" -2 "не можу прочитати стислий bzip2 файл" +1 "(стандартний ввід)" +2 "не можу прочитати стиснутий bzip2 файл" 3 "невiдома опція %s" 4 "використання: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A чис] [-B чис] [-C[чис]]\n" 5 "\t[-e шаблон] [-f файл] [--binary-files=значення] [--color=коли]\n" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210926 - head/sys/dev/null
On Fri, Aug 06, 2010 at 09:47:48AM +, Konstantin Belousov wrote: > Author: kib > Date: Fri Aug 6 09:47:48 2010 > New Revision: 210926 > URL: http://svn.freebsd.org/changeset/base/210926 > > Log: > Mark /dev/zero and /dev/null as eternal. > > In collaboration with: pho > MFC after: 1 month > > Modified: > head/sys/dev/null/null.c > > Modified: head/sys/dev/null/null.c > == > --- head/sys/dev/null/null.c Fri Aug 6 09:46:53 2010(r210925) > +++ head/sys/dev/null/null.c Fri Aug 6 09:47:48 2010(r210926) > @@ -112,10 +112,10 @@ null_modevent(module_t mod __unused, int > if (bootverbose) > printf("null: \n"); > zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); > - null_dev = make_dev(&null_cdevsw, 0, UID_ROOT, GID_WHEEL, > - 0666, "null"); > - zero_dev = make_dev(&zero_cdevsw, 0, UID_ROOT, GID_WHEEL, > - 0666, "zero"); > + null_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &null_cdevsw, 0, > + NULL, UID_ROOT, GID_WHEEL, 0666, "null"); > + zero_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &zero_cdevsw, 0, > + NULL, UID_ROOT, GID_WHEEL, 0666, "zero"); > break; > > case MOD_UNLOAD: The micro-benchmarks for this was was: 1: open/read/close and open/write/close in a loop 2: read and write in a loop 3: open/read/close in a loop Profileng of scenario #1 shows this: $ ministat -w 72 devmtx1.r210851.20100805092611.log devmtx1.r210851M.20100805103753.log x devmtx1.r210851.20100805092611.log + devmtx1.r210851M.20100805103753.log ++ |+x | |+ ++ + | | |_AM_| |MA|| ++ N Min MaxMedian AvgStddev x 5 74.54 75.22 74.8974.9260.25938389 + 5 60.93 62.15 61.73 61.6 0.450 Difference at 95.0% confidence -13.326 +/- 0.535747 -17.7855% +/- 0.715035% (Student's t, pooled s = 0.367342) Profileng of scenario #2 shows this: $ ministat -w 72 devmtx2.r210851.20100805092611.log devmtx2.r210851M.20100805103753.log x devmtx2.r210851.20100805092611.log + devmtx2.r210851M.20100805103753.log ++ |+ x| |+ x| |+ x| |+ x| |+ x| |A A| ++ N Min MaxMedian AvgStddev x 5 64.97 65.31 65.0165.0620.14131525 + 5 9.75 9.97 9.82 9.84 0.087464278 Difference at 95.0% confidence -55.222 +/- 0.17139 -84.876% +/- 0.263426% (Student's t, pooled s = 0.117516) Profileng of scenario #3 shows this: $ ministat -w 72 devmtx3.r210851.20100805092611.log devmtx3.r210851M.20100805103753.log x devmtx3.r210851.20100805092611.log + devmtx3.r210851M.20100805103753.log ++ |+ + x | |+ + + x xx x| ||_A_||__A_| | ++ N Min MaxMedian AvgStddev x 5 73.27 75.57 74.5 74.32 0.9681942 + 5 49.19 51.03 49.8249.8160.75145193 Difference at 95.0% confidence -24.504 +/- 1.26392 -32.9709% +/- 1.70065% (Student's t, pooled s = 0.866626) $ Details at http://people.freebsd.org/~pho/devmtx/ - Peter ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210930 - head/usr.sbin/fifolog/lib
Author: uqs Date: Fri Aug 6 12:38:30 2010 New Revision: 210930 URL: http://svn.freebsd.org/changeset/base/210930 Log: Typo fixes PR: docs/149314 Submitted by: olgeni MFC after:3 days Modified: head/usr.sbin/fifolog/lib/fifolog.h Modified: head/usr.sbin/fifolog/lib/fifolog.h == --- head/usr.sbin/fifolog/lib/fifolog.h Fri Aug 6 11:58:27 2010 (r210929) +++ head/usr.sbin/fifolog/lib/fifolog.h Fri Aug 6 12:38:30 2010 (r210930) @@ -33,15 +33,15 @@ * Definitions for fifolog "protocol": the on-media layout. * * The fifolog on-media record has three layers: - * The outher timestamping and synchronization layer. - * The zlib implemented data compression + * The outer timestamping and synchronization layer. + * The zlib implemented data compression. * The inner sequencing and identification layer. * - * All three layers are synchronized at a subset of the outher layer + * All three layers are synchronized at a subset of the outer layer * record boundaries, from where reading can be initiated. * * - * The outher layer: + * The outer layer: * - * The first record in a fifolog contains a magic string and version * information along with a 32be encoded recordsize for all records @@ -55,7 +55,7 @@ * 0 32besequence_number * The sequence number is randomly chosen for the * fifolog and increments once for each record written. - * It's precense allow quick identification of the next + * It's presence allow quick identification of the next * record to be written using a binary search for the * first place where a discontinuity in the sequence * numbers occur. @@ -89,14 +89,14 @@ * In most cases, the timer will expire before zlib has filled an entire * record in which case Z_SYNC_FLUSH will be used to force as much as * possible into the buffer before it is written. This is not marked - * in outher layer (apart from a natural correlation with padding) since + * in outer layer (apart from a natural correlation with padding) since * zlibs data stream handles this without help. * * * The inner layer: * - * The inner layer contains data indentification and to the second - * timestamping (the timestamp in the outherlayer only marks the + * The inner layer contains data identification and to the second + * timestamping (the timestamp in the outer layer only marks the * first possible timestamp for content in the SYNC record). * * offset typecontents @@ -113,7 +113,7 @@ * 4 32betime_t containing POSIX's understanding of UTC. * * Then follows the content, either as a NUL terminated string or as - * a lenght encoded binary sequence: + * a length encoded binary sequence: * * If (ident & FIFOLOG_LENGTH) the record is prefixed by: * {0|4} 8 length of binary data ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210930 - head/usr.sbin/fifolog/lib
On Fri, 06.08.2010 at 12:38:30 +, Ulrich Spörlein wrote: > Author: uqs > Date: Fri Aug 6 12:38:30 2010 > New Revision: 210930 > URL: http://svn.freebsd.org/changeset/base/210930 > > Log: > Typo fixes > > PR: docs/149314 > Submitted by:olgeni > MFC after: 3 days Forgot to add: Approved by:phk ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210931 - head/sys/dev/usb/quirk
Author: kib Date: Fri Aug 6 13:45:16 2010 New Revision: 210931 URL: http://svn.freebsd.org/changeset/base/210931 Log: Disable sync cache for the Transcend Jetflash V90. It is more specific quirk over the general one for transcend sticks. Submitted by: Mykola Dzham MFC after:1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c == --- head/sys/dev/usb/quirk/usb_quirk.c Fri Aug 6 12:38:30 2010 (r210930) +++ head/sys/dev/usb/quirk/usb_quirk.c Fri Aug 6 13:45:16 2010 (r210931) @@ -159,6 +159,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(ALCOR, AU6390, 0x, 0x, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, UMCR_9361, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ALCOR, TRANSCEND, 0x0142, 0x0142, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, TRANSCEND, 0x, 0x, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), USB_QUIRK(APACER, HT202, 0x, 0x, UQ_MSC_NO_TEST_UNIT_READY, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210926 - head/sys/dev/null
* Konstantin Belousov wrote: > Log: > Mark /dev/zero and /dev/null as eternal. So `eternal' means that these device nodes can never ever disappear? Maybe we can also mark /dev/ctty (tty_tty.c) like this as well? Greetings, -- Ed Schouten WWW: http://80386.nl/ pgp1Gf0zf2KAX.pgp Description: PGP signature
Re: svn commit: r210926 - head/sys/dev/null
On Fri, Aug 06, 2010 at 04:21:48PM +0200, Ed Schouten wrote: > * Konstantin Belousov wrote: > > Log: > > Mark /dev/zero and /dev/null as eternal. > > So `eternal' means that these device nodes can never ever disappear? > Maybe we can also mark /dev/ctty (tty_tty.c) like this as well? Yes, the plan is to mark all eligible devices eventually. But I want to wait some time, before making the sweep over the drivers, to make sure that I did not missed something serious in the design. This is why only /dev/null and /dev/zero are converted for now. pgpDqnhAfZvjM.pgp Description: PGP signature
svn commit: r210933 - in head: lib/libc/net lib/libc/stdlib lib/libc/sys lib/libcam lib/libgpib lib/libpmc lib/libusb lib/libutil libexec/ypxfr sbin/fsck sbin/fsck_ffs sbin/geom/class/part sbin/geo...
Author: joel (doc committer) Date: Fri Aug 6 14:33:42 2010 New Revision: 210933 URL: http://svn.freebsd.org/changeset/base/210933 Log: Fix typos and spelling mistakes. Modified: head/lib/libc/net/sctp_recvmsg.3 head/lib/libc/net/sctp_sendmsg.3 head/lib/libc/stdlib/malloc.3 head/lib/libc/sys/kqueue.2 head/lib/libc/sys/ptrace.2 head/lib/libcam/cam.3 head/lib/libgpib/gpib.3 head/lib/libpmc/pmc.corei7.3 head/lib/libpmc/pmc.mips.3 head/lib/libpmc/pmc.westmere.3 head/lib/libpmc/pmc.westmereuc.3 head/lib/libusb/libusb.3 head/lib/libutil/property.3 head/libexec/ypxfr/ypxfr.8 head/sbin/fsck/fsck.8 head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/geom/class/part/gpart.8 head/sbin/geom/core/geom.8 head/sbin/ifconfig/ifconfig.8 head/sbin/ping6/ping6.8 head/sbin/sunlabel/sunlabel.8 head/share/man/man4/cmx.4 head/share/man/man4/dc.4 head/share/man/man4/gre.4 head/share/man/man4/meteor.4 head/share/man/man4/net80211.4 head/share/man/man4/ng_car.4 head/share/man/man4/pcii.4 head/share/man/man4/pcm.4 head/share/man/man4/sctp.4 head/share/man/man9/BUS_NEW_PASS.9 head/share/man/man9/ieee80211_vap.9 head/share/man/man9/rman.9 head/usr.bin/du/du.1 head/usr.bin/fstat/fstat.1 head/usr.bin/rwall/rwall.1 head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 head/usr.sbin/lpr/lpr/printcap.5 head/usr.sbin/makefs/makefs.8 head/usr.sbin/mfiutil/mfiutil.8 head/usr.sbin/nfsd/stablerestart.5 head/usr.sbin/nfsuserd/nfsuserd.8 head/usr.sbin/ntp/doc/ntp.conf.5 head/usr.sbin/ntp/doc/ntpq.8 Modified: head/lib/libc/net/sctp_recvmsg.3 == --- head/lib/libc/net/sctp_recvmsg.3Fri Aug 6 14:18:37 2010 (r210932) +++ head/lib/libc/net/sctp_recvmsg.3Fri Aug 6 14:33:42 2010 (r210933) @@ -88,7 +88,7 @@ will hold the address of the peer and .Fa fromlen will hold the length of that address. Note that -the address is bounded by the inital value of +the address is bounded by the initial value of .Fa fromlen which is used as an in/out variable. .Pp Modified: head/lib/libc/net/sctp_sendmsg.3 == --- head/lib/libc/net/sctp_sendmsg.3Fri Aug 6 14:18:37 2010 (r210932) +++ head/lib/libc/net/sctp_sendmsg.3Fri Aug 6 14:33:42 2010 (r210933) @@ -72,7 +72,7 @@ Data sent in such an instance will resul the data being sent on the third leg of the SCTP four-way handshake. Note that if the socket is a one-to-one type (SOCK_STREAM) socket then an association must -be in existance (by use of the +be in existence (by use of the .Xr connect 2 system call). Calling Modified: head/lib/libc/stdlib/malloc.3 == --- head/lib/libc/stdlib/malloc.3 Fri Aug 6 14:18:37 2010 (r210932) +++ head/lib/libc/stdlib/malloc.3 Fri Aug 6 14:33:42 2010 (r210933) @@ -415,7 +415,7 @@ Allocation requests that are more than h minimum cacheline-multiple size class (see the .Dq Q option) are rounded up to the nearest multiple of the quantum. -Allocation requests that are more than the minumum cacheline-multiple size +Allocation requests that are more than the minimum cacheline-multiple size class, but no more than the minimum subpage-multiple size class (see the .Dq C option) are rounded up to the nearest multiple of the cacheline size (64). Modified: head/lib/libc/sys/kqueue.2 == --- head/lib/libc/sys/kqueue.2 Fri Aug 6 14:18:37 2010(r210932) +++ head/lib/libc/sys/kqueue.2 Fri Aug 6 14:33:42 2010(r210933) @@ -445,7 +445,7 @@ contains the events which triggered the .It Dv EVFILT_USER Establishes a user event identified by .Va ident -which is not assosicated with any kernel mechanism but is triggered by +which is not associated with any kernel mechanism but is triggered by user level code. The lower 24 bits of the .Va fflags Modified: head/lib/libc/sys/ptrace.2 == --- head/lib/libc/sys/ptrace.2 Fri Aug 6 14:18:37 2010(r210932) +++ head/lib/libc/sys/ptrace.2 Fri Aug 6 14:33:42 2010(r210933) @@ -335,7 +335,7 @@ and/or memory. When .Dv PL_FLAG_SCX is set, this flag may be additionally specified to inform that the -program being executed by debuggee process has been changed by succesful +program being executed by debuggee process has been changed by successful execution of a system call from the .Fn execve 2 family. Modified: head/lib/libcam/cam.3 == --- head/lib/libcam/cam.3 Fri Aug 6 14:18:37 2010(r210932) +++ head/lib/libcam/cam.3 Fri Aug 6 14:
svn commit: r210934 - head/sys/compat/x86bios
Author: jkim Date: Fri Aug 6 15:04:01 2010 New Revision: 210934 URL: http://svn.freebsd.org/changeset/base/210934 Log: Fix allocation of multiple pages, which forgot to increase page number. Particularly, it caused "vm86_addpage: overlap" panics under VirtualBox. Add a safety check before freeing memory while I am here. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c == --- head/sys/compat/x86bios/x86bios.c Fri Aug 6 14:33:42 2010 (r210933) +++ head/sys/compat/x86bios/x86bios.c Fri Aug 6 15:04:01 2010 (r210934) @@ -121,7 +121,7 @@ x86bios_alloc(uint32_t *offset, size_t s *offset = vtophys(addr); mtx_lock(&x86bios_lock); for (i = 0; i < howmany(size, PAGE_SIZE); i++) - vm86_addpage(&x86bios_vmc, atop(*offset), + vm86_addpage(&x86bios_vmc, atop(*offset) + i, addr + i * PAGE_SIZE); mtx_unlock(&x86bios_lock); } @@ -142,6 +142,10 @@ x86bios_free(void *addr, size_t size) sizeof(x86bios_vmc.pmap[i])); last = i; } + if (last < 0) { + mtx_unlock(&x86bios_lock); + return; + } if (last == x86bios_vmc.npages - 1) { x86bios_vmc.npages -= howmany(size, PAGE_SIZE); for (i = x86bios_vmc.npages - 1; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210935 - head/sys/kern
Author: csjp Date: Fri Aug 6 15:04:40 2010 New Revision: 210935 URL: http://svn.freebsd.org/changeset/base/210935 Log: Add Xen to the list of virtual vendors. In the non PV (HVM) case this fixes the virtualization detection successfully disabling the clflush instruction. This fixes insta-panics for XEN hvm users when the hw.clflush_disable tunable is -1 or 0 (-1 by default). Discussed with: jhb Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c == --- head/sys/kern/subr_param.c Fri Aug 6 15:04:01 2010(r210934) +++ head/sys/kern/subr_param.c Fri Aug 6 15:04:40 2010(r210935) @@ -149,6 +149,7 @@ static const char *const vm_bnames[] = { "QEMU", /* QEMU */ "Plex86", /* Plex86 */ "Bochs",/* Bochs */ + "Xen", /* Xen */ NULL }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210936 - in head: contrib/bsnmp/snmp_mibII sbin/ifconfig usr.sbin/ndp usr.sbin/ppp
Author: jhb Date: Fri Aug 6 15:09:21 2010 New Revision: 210936 URL: http://svn.freebsd.org/changeset/base/210936 Log: Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but use a different interface type (IFT_L2VLAN vs IFT_ETHER). Treat IFT_L2VLAN interfaces like IFT_ETHER interfaces when handling link layer addresses. Reviewed by: syrinx (bsnmpd) MFC after:1 week Modified: head/contrib/bsnmp/snmp_mibII/mibII.c head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifconfig.c head/usr.sbin/ndp/ndp.c head/usr.sbin/ppp/ipv6cp.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c == --- head/contrib/bsnmp/snmp_mibII/mibII.c Fri Aug 6 15:04:40 2010 (r210935) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Fri Aug 6 15:09:21 2010 (r210936) @@ -843,6 +843,7 @@ check_llbcast(struct mibif *ifp) case IFT_ETHER: case IFT_FDDI: case IFT_ISO88025: + case IFI_L2VLAN: if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) rcv->flags |= MIBRCVADDR_BCAST; Modified: head/sbin/ifconfig/af_link.c == --- head/sbin/ifconfig/af_link.cFri Aug 6 15:04:40 2010 (r210935) +++ head/sbin/ifconfig/af_link.cFri Aug 6 15:09:21 2010 (r210936) @@ -58,7 +58,9 @@ link_status(int s __unused, const struct struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr; if (sdl != NULL && sdl->sdl_alen > 0) { - if (sdl->sdl_type == IFT_ETHER && + if ((sdl->sdl_type == IFT_ETHER || + sdl->sdl_type == IFT_L2VLAN || + sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) printf("\tether %s\n", ether_ntoa((struct ether_addr *)LLADDR(sdl))); Modified: head/sbin/ifconfig/ifconfig.c == --- head/sbin/ifconfig/ifconfig.c Fri Aug 6 15:04:40 2010 (r210935) +++ head/sbin/ifconfig/ifconfig.c Fri Aug 6 15:09:21 2010 (r210936) @@ -319,7 +319,9 @@ main(int argc, char *argv[]) /* special case for "ether" address family */ if (!strcmp(afp->af_name, "ether")) { if (sdl == NULL || - sdl->sdl_type != IFT_ETHER || + (sdl->sdl_type != IFT_ETHER && + sdl->sdl_type != IFT_L2VLAN && + sdl->sdl_type != IFT_BRIDGE) || sdl->sdl_alen != ETHER_ADDR_LEN) continue; } else { Modified: head/usr.sbin/ndp/ndp.c == --- head/usr.sbin/ndp/ndp.c Fri Aug 6 15:04:40 2010(r210935) +++ head/usr.sbin/ndp/ndp.c Fri Aug 6 15:09:21 2010(r210936) @@ -437,6 +437,7 @@ set(argc, argv) switch (sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: case IFT_ISO88024: case IFT_ISO88025: + case IFT_L2VLAN: case IFT_BRIDGE: goto overwrite; } } Modified: head/usr.sbin/ppp/ipv6cp.c == --- head/usr.sbin/ppp/ipv6cp.c Fri Aug 6 15:04:40 2010(r210935) +++ head/usr.sbin/ppp/ipv6cp.c Fri Aug 6 15:09:21 2010(r210936) @@ -148,6 +148,7 @@ SetInterfaceID(u_char *ifid, int userand switch(sdl->sdl_type) { case IFT_ETHER: case IFT_FDDI: +case IFT_L2VLAN: /* XXX need more cases? */ break; default: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210937 - head/sys/net
Author: jhb Date: Fri Aug 6 15:15:26 2010 New Revision: 210937 URL: http://svn.freebsd.org/changeset/base/210937 Log: Adjust the interface type in the link layer socket address for vlan(4) interfaces to be a vlan (IFT_L2VLAN) rather than an Ethernet interface (IFT_ETHER). The code already fixed if_type in the ifnet causing some places to report the interface as a vlan (e.g. arp -a output) and other places to report the interface as Ethernet (getifaddrs(3)). Now they should all report IFT_L2VLAN. Reviewed by: brooks MFC after:1 month Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c == --- head/sys/net/if_vlan.c Fri Aug 6 15:09:21 2010(r210936) +++ head/sys/net/if_vlan.c Fri Aug 6 15:15:26 2010(r210937) @@ -688,6 +688,8 @@ vlan_clone_create(struct if_clone *ifc, struct ifvlan *ifv; struct ifnet *ifp; struct ifnet *p; + struct ifaddr *ifa; + struct sockaddr_dl *sdl; struct vlanreq vlr; static const u_char eaddr[ETHER_ADDR_LEN]; /* 00:00:00:00:00:00 */ @@ -786,6 +788,9 @@ vlan_clone_create(struct if_clone *ifc, ifp->if_baudrate = 0; ifp->if_type = IFT_L2VLAN; ifp->if_hdrlen = ETHER_VLAN_ENCAP_LEN; + ifa = ifp->if_addr; + sdl = (struct sockaddr_dl *)ifa->ifa_addr; + sdl->sdl_type = IFT_L2VLAN; if (ethertag) { error = vlan_config(ifv, p, tag); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210938 - head/sys/compat/x86bios
Author: jkim Date: Fri Aug 6 15:24:37 2010 New Revision: 210938 URL: http://svn.freebsd.org/changeset/base/210938 Log: Consistently use architecture specific macros. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c == --- head/sys/compat/x86bios/x86bios.c Fri Aug 6 15:15:26 2010 (r210937) +++ head/sys/compat/x86bios/x86bios.c Fri Aug 6 15:24:37 2010 (r210938) @@ -120,9 +120,9 @@ x86bios_alloc(uint32_t *offset, size_t s if (addr != 0) { *offset = vtophys(addr); mtx_lock(&x86bios_lock); - for (i = 0; i < howmany(size, PAGE_SIZE); i++) + for (i = 0; i < atop(round_page(size)); i++) vm86_addpage(&x86bios_vmc, atop(*offset) + i, - addr + i * PAGE_SIZE); + addr + ptoa(i)); mtx_unlock(&x86bios_lock); } @@ -147,7 +147,7 @@ x86bios_free(void *addr, size_t size) return; } if (last == x86bios_vmc.npages - 1) { - x86bios_vmc.npages -= howmany(size, PAGE_SIZE); + x86bios_vmc.npages -= atop(round_page(size)); for (i = x86bios_vmc.npages - 1; i >= 0 && x86bios_vmc.pmap[i].kva == 0; i--) x86bios_vmc.npages--; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210939 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/include i386/xen ia64/ia64 ia64/include kern mips/include mips/mips powerpc/include powerpc/powerpc sparc64/include sun4v...
Author: jhb Date: Fri Aug 6 15:36:59 2010 New Revision: 210939 URL: http://svn.freebsd.org/changeset/base/210939 Log: Add a new ipi_cpu() function to the MI IPI API that can be used to send an IPI to a specific CPU by its cpuid. Replace calls to ipi_selected() that constructed a mask for a single CPU with calls to ipi_cpu() instead. This will matter more in the future when we transition from cpumask_t to cpuset_t for CPU masks in which case building a CPU mask is more expensive. Submitted by: peter, sbruno Reviewed by: rookie Obtained from:Yahoo! (x86) MFC after:1 month Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/smp.h head/sys/i386/i386/mp_machdep.c head/sys/i386/include/smp.h head/sys/i386/xen/mp_machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/include/smp.h head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c head/sys/kern/subr_smp.c head/sys/mips/include/smp.h head/sys/mips/mips/mp_machdep.c head/sys/powerpc/include/smp.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/sparc64/include/smp.h head/sys/sun4v/include/smp.h head/sys/sun4v/sun4v/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c == --- head/sys/amd64/amd64/mp_machdep.c Fri Aug 6 15:24:37 2010 (r210938) +++ head/sys/amd64/amd64/mp_machdep.c Fri Aug 6 15:36:59 2010 (r210939) @@ -1239,15 +1239,51 @@ ipi_selected(cpumask_t cpus, u_int ipi) do { old_pending = cpu_ipi_pending[cpu]; new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending)); - + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); if (old_pending) continue; } - lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } +} + +/* + * send an IPI to a specific CPU. + */ +void +ipi_cpu(int cpu, u_int ipi) +{ + u_int bitmap = 0; + u_int old_pending; + u_int new_pending; + + if (IPI_IS_BITMAPED(ipi)) { + bitmap = 1 << ipi; + ipi = IPI_BITMAP_VECTOR; + } + /* +* IPI_STOP_HARD maps to a NMI and the trap handler needs a bit +* of help in order to understand what is the source. +* Set the mask of receiving CPUs for this purpose. +*/ + if (ipi == IPI_STOP_HARD) + atomic_set_int(&ipi_nmi_pending, 1 << cpu); + + CTR3(KTR_SMP, "%s: cpu: %d ipi: %x", __func__, cpu, ipi); + KASSERT(cpu_apic_ids[cpu] != -1, ("IPI to non-existent CPU %d", cpu)); + + if (bitmap) { + do { + old_pending = cpu_ipi_pending[cpu]; + new_pending = old_pending | bitmap; + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); + if (old_pending) + return; + } + lapic_ipi_vectored(ipi, cpu_apic_ids[cpu]); } /* Modified: head/sys/amd64/include/smp.h == --- head/sys/amd64/include/smp.hFri Aug 6 15:24:37 2010 (r210938) +++ head/sys/amd64/include/smp.hFri Aug 6 15:36:59 2010 (r210939) @@ -60,10 +60,11 @@ voidcpu_add(u_int apic_id, char boot_cp void cpustop_handler(void); void cpususpend_handler(void); void init_secondary(void); -intipi_nmi_handler(void); -void ipi_selected(cpumask_t cpus, u_int ipi); void ipi_all_but_self(u_int ipi); void ipi_bitmap_handler(struct trapframe frame); +void ipi_cpu(int cpu, u_int ipi); +intipi_nmi_handler(void); +void ipi_selected(cpumask_t cpus, u_int ipi); u_int mp_bootaddress(u_int); intmp_grab_cpu_hlt(void); void smp_cache_flush(void); Modified: head/sys/i386/i386/mp_machdep.c == --- head/sys/i386/i386/mp_machdep.c Fri Aug 6 15:24:37 2010 (r210938) +++ head/sys/i386/i386/mp_machdep.c Fri Aug 6 15:36:59 2010 (r210939) @@ -1327,15 +1327,51 @@ ipi_selected(cpumask_t cpus, u_int ipi) do { old_pending = cpu_ipi_pending[cpu]; new_pending = old_pending | bitmap; - } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu],old_pending, new_pending)); - + } while (!atomic_cmpset_int(&cpu_ipi_pending[cpu], + old_pending, new_pending)); if (old_pending) continue; } - lapic_ipi_vectore
Re: svn commit: r210923 - in head/sys: fs/devfs kern sys vm
On Fri, 2010-08-06 at 09:42 +, Konstantin Belousov wrote: > Author: kib > Date: Fri Aug 6 09:42:15 2010 > New Revision: 210923 > URL: http://svn.freebsd.org/changeset/base/210923 > > Log: > Add new make_dev_p(9) flag MAKEDEV_ETERNAL to inform devfs that created > cdev will never be destroyed. Propagate the flag to devfs vnodes as > VV_ETERNVALDEV. Use the flags to avoid acquiring devmtx and taking a > thread reference on such nodes. Does this flag have any effect on unmounting a devfs mount? Thanks, Gavin -- Gavin Atkinson FreeBSD committer and bugmeister ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210940 - head/sys/amd64/acpica
Author: jkim Date: Fri Aug 6 15:59:00 2010 New Revision: 210940 URL: http://svn.freebsd.org/changeset/base/210940 Log: Correct argument order of acpi_restorecpu(), which was forgotten in r210804. Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c == --- head/sys/amd64/acpica/acpi_wakeup.c Fri Aug 6 15:36:59 2010 (r210939) +++ head/sys/amd64/acpica/acpi_wakeup.c Fri Aug 6 15:59:00 2010 (r210940) @@ -71,7 +71,7 @@ extern struct pcb **susppcbs; static struct pcb **susppcbs; #endif -intacpi_restorecpu(struct pcb *, vm_offset_t); +intacpi_restorecpu(vm_offset_t, struct pcb *); static void*acpi_alloc_wakeup_handler(void); static voidacpi_stop_beep(void *); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210941 - head/share/man/man9
Author: stefanf Date: Fri Aug 6 16:50:48 2010 New Revision: 210941 URL: http://svn.freebsd.org/changeset/base/210941 Log: Add links for destroy_dev_drain, destroy_dev_sched, destroy_dev_sched_cb, make_dev_cred and make_dev_credf. Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile == --- head/share/man/man9/MakefileFri Aug 6 15:59:00 2010 (r210940) +++ head/share/man/man9/MakefileFri Aug 6 16:50:48 2010 (r210941) @@ -769,8 +769,13 @@ MLINKS+=lock.9 lockdestroy.9 \ lock.9 lockstatus.9 MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9 MLINKS+=make_dev.9 destroy_dev.9 \ + make_dev.9 destroy_dev_drain.9 \ + make_dev.9 destroy_dev_sched.9 \ + make_dev.9 destroy_dev_sched_cb.9 \ make_dev.9 dev_depends.9 \ - make_dev.9 make_dev_alias.9 + make_dev.9 make_dev_alias.9 \ + make_dev.9 make_dev_cred.9 \ + make_dev.9 make_dev_credf.9 MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210942 - head/sys/amd64/acpica
Author: jkim Date: Fri Aug 6 17:21:32 2010 New Revision: 210942 URL: http://svn.freebsd.org/changeset/base/210942 Log: Remove unnecessary casting and simplify code. We are not there yet. ;-) Modified: head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_wakeup.c == --- head/sys/amd64/acpica/acpi_wakeup.c Fri Aug 6 16:50:48 2010 (r210941) +++ head/sys/amd64/acpica/acpi_wakeup.c Fri Aug 6 17:21:32 2010 (r210942) @@ -176,7 +176,6 @@ static void acpi_wakeup_cpus(struct acpi_softc *sc, cpumask_t wakeup_cpus) { uint32_tmpbioswarmvec; - cpumask_t map; int cpu; u_char mpbiosreason; @@ -193,8 +192,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc, /* Wake up each AP. */ for (cpu = 1; cpu < mp_ncpus; cpu++) { - map = 1ul << cpu; - if ((wakeup_cpus & map) != map) + if ((wakeup_cpus & (1 << cpu)) == 0) continue; if (acpi_wakeup_ap(sc, cpu) == 0) { /* restore the warmstart vector */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210943 - head/sys/dev/mpt
Author: mjacob Date: Fri Aug 6 17:27:00 2010 New Revision: 210943 URL: http://svn.freebsd.org/changeset/base/210943 Log: Figure which is the IO and MEM bars- do not assume that they are in a fixed order. PR: 149220 Obtained from:John Baldwin MFC after:1 month Modified: head/sys/dev/mpt/mpt_pci.c Modified: head/sys/dev/mpt/mpt_pci.c == --- head/sys/dev/mpt/mpt_pci.c Fri Aug 6 17:21:32 2010(r210942) +++ head/sys/dev/mpt/mpt_pci.c Fri Aug 6 17:27:00 2010(r210943) @@ -194,8 +194,6 @@ __FBSDID("$FreeBSD$"); #endif -#defineMPT_IO_BAR 0 -#defineMPT_MEM_BAR 1 static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); @@ -420,6 +418,7 @@ mpt_pci_attach(device_t dev) struct mpt_softc *mpt; int iqd; uint32_t data, cmd; + int mpt_io_bar, mpt_mem_bar; /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); @@ -505,11 +504,25 @@ mpt_pci_attach(device_t dev) } /* +* Figure out which are the I/O and MEM Bars +*/ + data = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(data)) { + /* BAR0 is IO, BAR1 is memory */ + mpt_io_bar = 0; + mpt_mem_bar = 1; + } else { + /* BAR0 is memory, BAR1 is IO */ + mpt_mem_bar = 0; + mpt_io_bar = 1; + } + + /* * Set up register access. PIO mode is required for * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); + mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &mpt->pci_pio_rid, 0, ~0, 0, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { @@ -520,7 +533,7 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); + mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource(dev, SYS_RES_MEMORY, &mpt->pci_mem_rid, 0, ~0, 0, RF_ACTIVE); if (mpt->pci_reg == NULL) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210946 - head/contrib/bsnmp/snmp_mibII
Author: yongari Date: Fri Aug 6 18:44:07 2010 New Revision: 210946 URL: http://svn.freebsd.org/changeset/base/210946 Log: Fix a typo introduced in r210936 which broke build. Modified: head/contrib/bsnmp/snmp_mibII/mibII.c Modified: head/contrib/bsnmp/snmp_mibII/mibII.c == --- head/contrib/bsnmp/snmp_mibII/mibII.c Fri Aug 6 17:29:54 2010 (r210945) +++ head/contrib/bsnmp/snmp_mibII/mibII.c Fri Aug 6 18:44:07 2010 (r210946) @@ -843,7 +843,7 @@ check_llbcast(struct mibif *ifp) case IFT_ETHER: case IFT_FDDI: case IFT_ISO88025: - case IFI_L2VLAN: + case IFT_L2VLAN: if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) rcv->flags |= MIBRCVADDR_BCAST; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210947 - in head/sys: amd64/conf i386/conf
Author: bschmidt Date: Fri Aug 6 18:46:27 2010 New Revision: 210947 URL: http://svn.freebsd.org/changeset/base/210947 Log: Fix whitespace nits. PR: conf/148989 Submitted by: pluknet MFC after:3 days Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Fri Aug 6 18:44:07 2010(r210946) +++ head/sys/amd64/conf/GENERIC Fri Aug 6 18:46:27 2010(r210947) @@ -62,7 +62,7 @@ options KBD_INSTALL_CDEV# install a CD optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) optionsAUDIT # Security event auditing optionsMAC # TrustedBSD MAC Framework -optionsFLOWTABLE # per-cpu routing cache +optionsFLOWTABLE # per-cpu routing cache #options KDTRACE_FRAME # Ensure frames are compiled in #options KDTRACE_HOOKS # Kernel DTrace hooks optionsINCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/i386/conf/GENERIC == --- head/sys/i386/conf/GENERIC Fri Aug 6 18:44:07 2010(r210946) +++ head/sys/i386/conf/GENERIC Fri Aug 6 18:46:27 2010(r210947) @@ -63,7 +63,7 @@ options KBD_INSTALL_CDEV# install a CD optionsHWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) optionsAUDIT # Security event auditing optionsMAC # TrustedBSD MAC Framework -optionsFLOWTABLE # per-cpu routing cache +optionsFLOWTABLE # per-cpu routing cache #options KDTRACE_HOOKS # Kernel DTrace hooks optionsINCLUDE_CONFIG_FILE # Include this file in kernel ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210923 - in head/sys: fs/devfs kern sys vm
On Fri, Aug 06, 2010 at 04:39:36PM +0100, Gavin Atkinson wrote: > On Fri, 2010-08-06 at 09:42 +, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Aug 6 09:42:15 2010 > > New Revision: 210923 > > URL: http://svn.freebsd.org/changeset/base/210923 > > > > Log: > > Add new make_dev_p(9) flag MAKEDEV_ETERNAL to inform devfs that created > > cdev will never be destroyed. Propagate the flag to devfs vnodes as > > VV_ETERNVALDEV. Use the flags to avoid acquiring devmtx and taking a > > thread reference on such nodes. > > Does this flag have any effect on unmounting a devfs mount? It should not. The flag turns off some safety measures that are used to make sure that cdev is not destroyed while cdevsw method is active. Do you experience some trouble after the change ? pgpWmSpchvWFU.pgp Description: PGP signature
Re: svn commit: r210946 - head/contrib/bsnmp/snmp_mibII
On Friday, August 06, 2010 2:44:07 pm Pyun YongHyeon wrote: > Author: yongari > Date: Fri Aug 6 18:44:07 2010 > New Revision: 210946 > URL: http://svn.freebsd.org/changeset/base/210946 > > Log: > Fix a typo introduced in r210936 which broke build. > > Modified: > head/contrib/bsnmp/snmp_mibII/mibII.c > > Modified: head/contrib/bsnmp/snmp_mibII/mibII.c > == > --- head/contrib/bsnmp/snmp_mibII/mibII.c Fri Aug 6 17:29:54 2010 > (r210945) > +++ head/contrib/bsnmp/snmp_mibII/mibII.c Fri Aug 6 18:44:07 2010 > (r210946) > @@ -843,7 +843,7 @@ check_llbcast(struct mibif *ifp) > case IFT_ETHER: > case IFT_FDDI: > case IFT_ISO88025: > - case IFI_L2VLAN: > + case IFT_L2VLAN: > if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && > (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) > rcv->flags |= MIBRCVADDR_BCAST; Argh, sorry. :( -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210951 - head/tools/regression/fstest
Author: pjd Date: Fri Aug 6 19:16:20 2010 New Revision: 210951 URL: http://svn.freebsd.org/changeset/base/210951 Log: Implement two new syscalls: bind(2) and connect(2) for operating on UNIX domain sockets. Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c == --- head/tools/regression/fstest/fstest.c Fri Aug 6 18:57:09 2010 (r210950) +++ head/tools/regression/fstest/fstest.c Fri Aug 6 19:16:20 2010 (r210951) @@ -28,6 +28,8 @@ #include #include +#include +#include #include #include #include @@ -63,6 +65,8 @@ enum action { ACTION_SYMLINK, ACTION_RENAME, ACTION_MKFIFO, + ACTION_BIND, + ACTION_CONNECT, ACTION_CHMOD, #ifdef HAS_LCHMOD ACTION_LCHMOD, @@ -110,6 +114,8 @@ static struct syscall_desc syscalls[] = { "symlink", ACTION_SYMLINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "rename", ACTION_RENAME, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "mkfifo", ACTION_MKFIFO, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } }, + { "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } }, { "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, #ifdef HAS_LCHMOD { "lchmod", ACTION_LCHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, @@ -496,6 +502,32 @@ call_syscall(struct syscall_desc *scall, case ACTION_MKFIFO: rval = mkfifo(STR(0), (mode_t)NUM(1)); break; + case ACTION_BIND: + { + struct sockaddr_un sun; + + sun.sun_family = AF_UNIX; + strlcpy(sun.sun_path, STR(0), sizeof(sun.sun_path)); + sun.sun_len = SUN_LEN(&sun); + rval = socket(AF_UNIX, SOCK_STREAM, 0); + if (rval < 0) + break; + rval = bind(rval, (struct sockaddr *)&sun, sizeof(sun)); + break; + } + case ACTION_CONNECT: + { + struct sockaddr_un sun; + + sun.sun_family = AF_UNIX; + strlcpy(sun.sun_path, STR(0), sizeof(sun.sun_path)); + sun.sun_len = SUN_LEN(&sun); + rval = socket(AF_UNIX, SOCK_STREAM, 0); + if (rval < 0) + break; + rval = connect(rval, (struct sockaddr *)&sun, sizeof(sun)); + break; + } case ACTION_CHMOD: rval = chmod(STR(0), (mode_t)NUM(1)); break; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210952 - head/tools/regression/fstest
Author: pjd Date: Fri Aug 6 19:16:48 2010 New Revision: 210952 URL: http://svn.freebsd.org/changeset/base/210952 Log: Add missing -U argument to usage. Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c == --- head/tools/regression/fstest/fstest.c Fri Aug 6 19:16:20 2010 (r210951) +++ head/tools/regression/fstest/fstest.c Fri Aug 6 19:16:48 2010 (r210952) @@ -257,7 +257,7 @@ static void usage(void) { - fprintf(stderr, "usage: fstest [-u uid] [-g gid1[,gid2[...]]] syscall args ...\n"); + fprintf(stderr, "usage: fstest [-U umask] [-u uid] [-g gid1[,gid2[...]]] syscall args ...\n"); exit(1); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210953 - head/tools/regression/fstest/tests/open
Author: pjd Date: Fri Aug 6 19:18:19 2010 New Revision: 210953 URL: http://svn.freebsd.org/changeset/base/210953 Log: Make description readable. Modified: head/tools/regression/fstest/tests/open/13.t Modified: head/tools/regression/fstest/tests/open/13.t == --- head/tools/regression/fstest/tests/open/13.tFri Aug 6 19:16:48 2010(r210952) +++ head/tools/regression/fstest/tests/open/13.tFri Aug 6 19:18:19 2010(r210953) @@ -1,7 +1,7 @@ #!/bin/sh # $FreeBSD$ -desc="open returns EISDIR when he named file is a directory, and the arguments specify it is to be modified" +desc="open returns EISDIR when trying to open a directory for writing" dir=`dirname $0` . ${dir}/../misc.sh ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210954 - head/tools/regression/fstest/tests/open
Author: pjd Date: Fri Aug 6 19:19:14 2010 New Revision: 210954 URL: http://svn.freebsd.org/changeset/base/210954 Log: Test O_RDONLY|O_RDWR flags as potentially invalid. Modified: head/tools/regression/fstest/tests/open/23.t Modified: head/tools/regression/fstest/tests/open/23.t == --- head/tools/regression/fstest/tests/open/23.tFri Aug 6 19:18:19 2010(r210953) +++ head/tools/regression/fstest/tests/open/23.tFri Aug 6 19:19:14 2010(r210954) @@ -6,11 +6,12 @@ desc="open may return EINVAL when an att dir=`dirname $0` . ${dir}/../misc.sh -echo "1..4" +echo "1..5" n0=`namegen` expect 0 create ${n0} 0644 +expect "0|EINVAL" open ${n0} O_RDONLY,O_RDWR expect "0|EINVAL" open ${n0} O_WRONLY,O_RDWR expect "0|EINVAL" open ${n0} O_RDONLY,O_WRONLY,O_RDWR expect 0 unlink ${n0} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210955 - head/tools/regression/fstest/tests/open
Author: pjd Date: Fri Aug 6 19:20:35 2010 New Revision: 210955 URL: http://svn.freebsd.org/changeset/base/210955 Log: Test for EACCES also when opening FIFO or directory. Modified: head/tools/regression/fstest/tests/open/06.t Modified: head/tools/regression/fstest/tests/open/06.t == --- head/tools/regression/fstest/tests/open/06.tFri Aug 6 19:19:14 2010(r210954) +++ head/tools/regression/fstest/tests/open/06.tFri Aug 6 19:20:35 2010(r210955) @@ -6,7 +6,7 @@ desc="open returns EACCES when the requi dir=`dirname $0` . ${dir}/../misc.sh -echo "1..65" +echo "1..144" n0=`namegen` n1=`namegen` @@ -16,47 +16,104 @@ expect 0 chown ${n0} 65534 65534 cdir=`pwd` cd ${n0} +# Regular file. + expect 0 -u 65534 -g 65534 create ${n1} 0644 expect 0 -u 65534 -g 65534 chmod ${n1} 0600 -expect 0 -u 65534 -g 65534 open ${n1} O_RDONLY -expect 0 -u 65534 -g 65534 open ${n1} O_WRONLY -expect 0 -u 65534 -g 65534 open ${n1} O_RDWR +expect 0 -u 65534 -g 65534 open ${n1} O_RDONLY, +expect 0 -u 65534 -g 65534 open ${n1} O_WRONLY, +expect 0 -u 65534 -g 65534 open ${n1} O_RDWR, expect 0 -u 65534 -g 65534 chmod ${n1} 0060 -expect 0 -u 65533 -g 65534 open ${n1} O_RDONLY -expect 0 -u 65533 -g 65534 open ${n1} O_WRONLY -expect 0 -u 65533 -g 65534 open ${n1} O_RDWR +expect 0 -u 65533 -g 65534 open ${n1} O_RDONLY, +expect 0 -u 65533 -g 65534 open ${n1} O_WRONLY, +expect 0 -u 65533 -g 65534 open ${n1} O_RDWR, expect 0 -u 65534 -g 65534 chmod ${n1} 0006 -expect 0 -u 65533 -g 65533 open ${n1} O_RDONLY -expect 0 -u 65533 -g 65533 open ${n1} O_WRONLY -expect 0 -u 65533 -g 65533 open ${n1} O_RDWR +expect 0 -u 65533 -g 65533 open ${n1} O_RDONLY, +expect 0 -u 65533 -g 65533 open ${n1} O_WRONLY, +expect 0 -u 65533 -g 65533 open ${n1} O_RDWR, expect 0 -u 65534 -g 65534 chmod ${n1} 0477 -expect 0 -u 65534 -g 65534 open ${n1} O_RDONLY +expect 0 -u 65534 -g 65534 open ${n1} O_RDONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0747 +expect 0 -u 65533 -g 65534 open ${n1} O_RDONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0774 +expect 0 -u 65533 -g 65533 open ${n1} O_RDONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_RDWR, + +expect 0 -u 65534 -g 65534 chmod ${n1} 0277 +expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY, +expect 0 -u 65534 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0727 +expect EACCES -u 65533 -g 65534 open ${n1} O_RDONLY, +expect 0 -u 65533 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0772 +expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY, +expect 0 -u 65533 -g 65533 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_RDWR, + +expect 0 -u 65534 -g 65534 chmod ${n1} 0177 +expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0717 +expect EACCES -u 65533 -g 65534 open ${n1} O_RDONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0771 +expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_RDWR, + +expect 0 -u 65534 -g 65534 chmod ${n1} 0077 +expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65534 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0707 +expect EACCES -u 65533 -g 65534 open ${n1} O_RDONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65534 open ${n1} O_RDWR, +expect 0 -u 65534 -g 65534 chmod ${n1} 0770 +expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_WRONLY, +expect EACCES -u 65533 -g 65533 open ${n1} O_RDWR, + +expect 0 -u 65534 -g 65534 unlink ${n1} + +# FIFO. + +expect 0 -u 65534 -g 65534 mkfifo ${n1} 0644 + +expect 0 -u 65534 -g 65534 chmod ${n1} 0600 +expect 0 -u 65534 -g 65534 open ${n1} O_RDONLY,O_NONBLOCK +expect 0 -u 65534 -g 65534 open ${n1} O_RDWR,O_NONBLOCK +expect 0 -u 65534 -g 65534 chmod ${n1} 0060 +expect 0 -u 65533 -g 65534 open ${n1} O_RDONLY,O_NONBLOCK +expect 0 -u 65533 -g 65534 open ${n1} O_RDWR,O_NONBLOCK +expect 0 -u 65534 -g 65534 chmod ${n1} 0006 +expect 0 -u 65533 -g 65533 open ${n1} O_RDONLY,O_NONBLOCK +expect 0 -u 65533 -g 65533 open ${n1} O_RDWR,O_NONBLOCK + +expect 0 -u 65534 -g 65534 chmod ${n1} 0477 +expect 0 -u 65
svn commit: r210956 - head/tools/regression/fstest/tests/open
Author: pjd Date: Fri Aug 6 19:22:42 2010 New Revision: 210956 URL: http://svn.freebsd.org/changeset/base/210956 Log: open(2) returns EOPNOTSUPP when trying to open a socket. Added: head/tools/regression/fstest/tests/open/24.t (contents, props changed) Added: head/tools/regression/fstest/tests/open/24.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/fstest/tests/open/24.tFri Aug 6 19:22:42 2010(r210956) @@ -0,0 +1,17 @@ +#!/bin/sh +# $FreeBSD$ + +desc="open returns EOPNOTSUPP when trying to open UNIX domain socket" + +dir=`dirname $0` +. ${dir}/../misc.sh + +echo "1..5" + +n0=`namegen` + +expect 0 bind ${n0} +expect "EOPNOTSUPP" open ${n0} O_RDONLY +expect "EOPNOTSUPP" open ${n0} O_WRONLY +expect "EOPNOTSUPP" open ${n0} O_RDWR +expect 0 unlink ${n0} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210957 - head/include
Author: ed Date: Fri Aug 6 19:35:40 2010 New Revision: 210957 URL: http://svn.freebsd.org/changeset/base/210957 Log: Remove stale reference to UT_NAMESIZE from . Spotted by: bde@ Modified: head/include/stdio.h Modified: head/include/stdio.h == --- head/include/stdio.hFri Aug 6 19:22:42 2010(r210956) +++ head/include/stdio.hFri Aug 6 19:35:40 2010(r210957) @@ -285,8 +285,7 @@ int vsscanf(const char * __restrict, co * Functions defined in all versions of POSIX 1003.1. */ #if __BSD_VISIBLE || __POSIX_VISIBLE <= 199506 -/* size for cuserid(3); UT_NAMESIZE + 1, see */ -#defineL_cuserid 17 /* legacy */ +#defineL_cuserid 17 /* size for cuserid(3); MAXLOGNAME, legacy */ #endif #if __POSIX_VISIBLE ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210958 - in head: . lib/libcompat lib/libcompat/4.1 lib/libcompat/4.3
Author: ed Date: Fri Aug 6 20:13:36 2010 New Revision: 210958 URL: http://svn.freebsd.org/changeset/base/210958 Log: Remove unneeded functions from libcompat. Erwin fired up a ports build a couple of weeks ago and it seems the following functions are not used by any of the 20k ports we have, which makes me believe they don't have any purpose. Just remove them. Deleted: head/lib/libcompat/4.1/ascftime.c head/lib/libcompat/4.1/cftime.3 head/lib/libcompat/4.1/cftime.c head/lib/libcompat/4.1/getpw.3 head/lib/libcompat/4.1/getpw.c head/lib/libcompat/4.3/cfree.3 head/lib/libcompat/4.3/cfree.c Modified: head/ObsoleteFiles.inc head/lib/libcompat/Makefile Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Fri Aug 6 19:35:40 2010(r210957) +++ head/ObsoleteFiles.inc Fri Aug 6 20:13:36 2010(r210958) @@ -14,6 +14,11 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100806: removal of unused libcompat routines +OLD_FILES+=usr/share/man/man3/ascftime.3.gz +OLD_FILES+=usr/share/man/man3/cfree.3.gz +OLD_FILES+=usr/share/man/man3/cftime.3.gz +OLD_FILES+=usr/share/man/man3/getpw.3.gz # 20100725: acpi_aiboost(4) removal. OLD_FILES+=usr/share/man/man4/acpi_aiboost.4.gz # 20100720: new clang import which bumps version from 2.0 to 2.8 Modified: head/lib/libcompat/Makefile == --- head/lib/libcompat/Makefile Fri Aug 6 19:35:40 2010(r210957) +++ head/lib/libcompat/Makefile Fri Aug 6 20:13:36 2010(r210958) @@ -10,17 +10,14 @@ WARNS?= 0 .PATH: ${.CURDIR}/4.1 ${.CURDIR}/4.3 ${.CURDIR}/4.4 # compat 4.1 sources -SRCS+= ascftime.c cftime.c ftime.c getpw.c +SRCS+= ftime.c -MAN+= 4.1/ftime.3 4.1/getpw.3 -MAN+= 4.1/cftime.3 - -MLINKS+=cftime.3 ascftime.3 +MAN+= 4.1/ftime.3 # compat 4.3 sources -SRCS+= cfree.c re_comp.c rexec.c +SRCS+= re_comp.c rexec.c -MAN+= 4.3/cfree.3 4.3/re_comp.3 4.3/rexec.3 +MAN+= 4.3/re_comp.3 4.3/rexec.3 MLINKS+=re_comp.3 re_exec.3 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210959 - head/share/man/man4
Author: bschmidt Date: Fri Aug 6 20:18:16 2010 New Revision: 210959 URL: http://svn.freebsd.org/changeset/base/210959 Log: Obviously the option is known as COMPAT_LINUX32 on amd64. PR: docs/149182 Pointed out by: Fernando MFC after:3 days Modified: head/share/man/man4/linux.4 Modified: head/share/man/man4/linux.4 == --- head/share/man/man4/linux.4 Fri Aug 6 20:13:36 2010(r210958) +++ head/share/man/man4/linux.4 Fri Aug 6 20:18:16 2010(r210959) @@ -31,13 +31,18 @@ .Nm linux .Nd Linux ABI support .Sh SYNOPSIS -To compile support for this ABI into the kernel, +To compile support for this ABI into an i386 kernel place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_LINUX" .Ed .Pp +for an amd64 kernel use: +.Bd -ragged -offset indent +.Cd "options COMPAT_LINUX32" +.Ed +.Pp Alternatively, to load the ABI as a module at boot time, place the following line in .Xr loader.conf 5 : ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210964 - head/tools/regression/fstest
Author: pjd Date: Fri Aug 6 20:46:26 2010 New Revision: 210964 URL: http://svn.freebsd.org/changeset/base/210964 Log: Sort includes. Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c == --- head/tools/regression/fstest/fstest.c Fri Aug 6 20:46:06 2010 (r210963) +++ head/tools/regression/fstest/fstest.c Fri Aug 6 20:46:26 2010 (r210964) @@ -30,15 +30,16 @@ #include #include #include -#include -#include -#include + +#include +#include +#include #include #include +#include +#include #include -#include -#include -#include +#include #ifndef HAS_TRUNCATE64 #definetruncate64 truncate ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210965 - head/tools/regression/fstest
Author: pjd Date: Fri Aug 6 20:48:10 2010 New Revision: 210965 URL: http://svn.freebsd.org/changeset/base/210965 Log: Add mknod(2) support. Submitted by: Jan Senolt Submitted by: Milan Cermak Modified: head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/fstest.c == --- head/tools/regression/fstest/fstest.c Fri Aug 6 20:46:26 2010 (r210964) +++ head/tools/regression/fstest/fstest.c Fri Aug 6 20:48:10 2010 (r210965) @@ -27,9 +27,13 @@ */ #include +#include #include #include #include +#ifndef makedev +#include +#endif #include #include @@ -66,6 +70,7 @@ enum action { ACTION_SYMLINK, ACTION_RENAME, ACTION_MKFIFO, + ACTION_MKNOD, ACTION_BIND, ACTION_CONNECT, ACTION_CHMOD, @@ -115,6 +120,7 @@ static struct syscall_desc syscalls[] = { "symlink", ACTION_SYMLINK, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "rename", ACTION_RENAME, { TYPE_STRING, TYPE_STRING, TYPE_NONE } }, { "mkfifo", ACTION_MKFIFO, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, + { "mknod", ACTION_MKNOD, { TYPE_STRING, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER, TYPE_NUMBER, TYPE_NONE} }, { "bind", ACTION_BIND, { TYPE_STRING, TYPE_NONE } }, { "connect", ACTION_CONNECT, { TYPE_STRING, TYPE_NONE } }, { "chmod", ACTION_CHMOD, { TYPE_STRING, TYPE_NUMBER, TYPE_NONE } }, @@ -359,6 +365,10 @@ show_stat(struct stat64 *sp, const char else if (strcmp(what, "flags") == 0) printf("%s", flags2str(chflags_flags, (long long)sp->st_flags)); #endif + else if (strcmp(what, "major") == 0) + printf("%u", (unsigned int)major(sp->st_rdev)); + else if (strcmp(what, "minor") == 0) + printf("%u", (unsigned int)minor(sp->st_rdev)); else if (strcmp(what, "type") == 0) { switch (sp->st_mode & S_IFMT) { case S_IFIFO: @@ -503,6 +513,29 @@ call_syscall(struct syscall_desc *scall, case ACTION_MKFIFO: rval = mkfifo(STR(0), (mode_t)NUM(1)); break; + case ACTION_MKNOD: + { + mode_t ntype; + dev_t dev; + + dev = makedev(NUM(3), NUM(4)); + if (strcmp(STR(1), "c") == 0) /* character device */ + ntype = S_IFCHR; + else if (strcmp(STR(1), "b") == 0) /* block device */ + ntype = S_IFBLK; + else if (strcmp(STR(1), "f") == 0) /* fifo special */ + ntype = S_IFIFO; + else if (strcmp(STR(1), "d") == 0) /* directory */ + ntype = S_IFDIR; + else if (strcmp(STR(1), "o") == 0) /* regular file */ + ntype = S_IFREG; + else { + fprintf(stderr, "wrong argument 1\n"); + exit(1); + } + rval = mknod(STR(0), ntype | NUM(2), dev); + break; + } case ACTION_BIND: { struct sockaddr_un sun; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210967 - head/tools/regression/fstest/tests/mknod
Author: pjd Date: Fri Aug 6 20:51:39 2010 New Revision: 210967 URL: http://svn.freebsd.org/changeset/base/210967 Log: Add tests for mknod(2). Submitted by: Jan Senolt Submitted by: Milan Cermak Polished by: pjd Added: head/tools/regression/fstest/tests/mknod/ head/tools/regression/fstest/tests/mknod/00.t (contents, props changed) head/tools/regression/fstest/tests/mknod/01.t (contents, props changed) head/tools/regression/fstest/tests/mknod/02.t (contents, props changed) head/tools/regression/fstest/tests/mknod/03.t (contents, props changed) head/tools/regression/fstest/tests/mknod/04.t (contents, props changed) head/tools/regression/fstest/tests/mknod/05.t (contents, props changed) head/tools/regression/fstest/tests/mknod/06.t (contents, props changed) head/tools/regression/fstest/tests/mknod/07.t (contents, props changed) head/tools/regression/fstest/tests/mknod/08.t (contents, props changed) head/tools/regression/fstest/tests/mknod/09.t (contents, props changed) head/tools/regression/fstest/tests/mknod/10.t (contents, props changed) head/tools/regression/fstest/tests/mknod/11.t (contents, props changed) Added: head/tools/regression/fstest/tests/mknod/00.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/fstest/tests/mknod/00.t Fri Aug 6 20:51:39 2010(r210967) @@ -0,0 +1,73 @@ +#!/bin/sh +# $FreeBSD$ + +desc="mknod creates fifo files" + +dir=`dirname $0` +. ${dir}/../misc.sh + +echo "1..36" + +n0=`namegen` +n1=`namegen` + +expect 0 mkdir ${n1} 0755 +cdir=`pwd` +cd ${n1} + +# POSIX: The file permission bits of the new FIFO shall be initialized from +# mode. The file permission bits of the mode argument shall be modified by the +# process' file creation mask. +expect 0 mknod ${n0} f 0755 0 0 +expect fifo,0755 lstat ${n0} type,mode +expect 0 unlink ${n0} +expect 0 mknod ${n0} f 0151 0 0 +expect fifo,0151 lstat ${n0} type,mode +expect 0 unlink ${n0} +expect 0 -U 077 mknod ${n0} f 0151 0 0 +expect fifo,0100 lstat ${n0} type,mode +expect 0 unlink ${n0} +expect 0 -U 070 mknod ${n0} f 0345 0 0 +expect fifo,0305 lstat ${n0} type,mode +expect 0 unlink ${n0} +expect 0 -U 0501 mknod ${n0} f 0345 0 0 +expect fifo,0244 lstat ${n0} type,mode +expect 0 unlink ${n0} + +# POSIX: The FIFO's user ID shall be set to the process' effective user ID. +# The FIFO's group ID shall be set to the group ID of the parent directory or to +# the effective group ID of the process. +expect 0 chown . 65535 65535 +expect 0 -u 65535 -g 65535 mknod ${n0} f 0755 0 0 +expect 65535,65535 lstat ${n0} uid,gid +expect 0 unlink ${n0} +expect 0 -u 65535 -g 65534 mknod ${n0} f 0755 0 0 +expect "65535,6553[45]" lstat ${n0} uid,gid +expect 0 unlink ${n0} +expect 0 chmod . 0777 +expect 0 -u 65534 -g 65533 mknod ${n0} f 0755 0 0 +expect "65534,6553[35]" lstat ${n0} uid,gid +expect 0 unlink ${n0} + +# POSIX: Upon successful completion, mkfifo() shall mark for update the +# st_atime, st_ctime, and st_mtime fields of the file. Also, the st_ctime and +# st_mtime fields of the directory that contains the new entry shall be marked +# for update. +expect 0 chown . 0 0 +time=`${fstest} stat . ctime` +sleep 1 +expect 0 mknod ${n0} f 0755 0 0 +atime=`${fstest} stat ${n0} atime` +test_check $time -lt $atime +mtime=`${fstest} stat ${n0} mtime` +test_check $time -lt $mtime +ctime=`${fstest} stat ${n0} ctime` +test_check $time -lt $ctime +mtime=`${fstest} stat . mtime` +test_check $time -lt $mtime +ctime=`${fstest} stat . ctime` +test_check $time -lt $ctime +expect 0 unlink ${n0} + +cd ${cdir} +expect 0 rmdir ${n1} Added: head/tools/regression/fstest/tests/mknod/01.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/fstest/tests/mknod/01.t Fri Aug 6 20:51:39 2010(r210967) @@ -0,0 +1,18 @@ +#!/bin/sh +# $FreeBSD$ + +desc="mknod returns ENOTDIR if a component of the path prefix is not a directory" + +dir=`dirname $0` +. ${dir}/../misc.sh + +echo "1..5" + +n0=`namegen` +n1=`namegen` + +expect 0 mkdir ${n0} 0755 +expect 0 create ${n0}/${n1} 0644 +expect ENOTDIR mknod ${n0}/${n1}/test f 0644 0 0 +expect 0 unlink ${n0}/${n1} +expect 0 rmdir ${n0} Added: head/tools/regression/fstest/tests/mknod/02.t == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/fstest/tests/mknod/02.t Fri Aug 6 20:51:39 2010(r210967) @@ -0,0 +1,13 @@ +#!/bin/sh +# $FreeBSD$ + +desc="mknod returns ENAMETOOLONG if a component of a pathname exceeded 255 characters" + +dir=`dirname $0` +. ${dir}/../misc.sh + +echo "1..3" + +expect 0 mknod ${name255} f 0644 0 0 +expect 0 unlink ${name255} +expect ENAMETOOLONG mknod ${name256
svn commit: r210968 - head/sys/dev/e1000
Author: jfv Date: Fri Aug 6 20:55:49 2010 New Revision: 210968 URL: http://svn.freebsd.org/changeset/base/210968 Log: Put the early setting of the MAC type back, its removal resulted in broken code in MSIX setup. Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c == --- head/sys/dev/e1000/if_igb.c Fri Aug 6 20:51:39 2010(r210967) +++ head/sys/dev/e1000/if_igb.c Fri Aug 6 20:55:49 2010(r210968) @@ -2070,6 +2070,9 @@ igb_identify_hardware(struct adapter *ad pci_read_config(dev, PCIR_SUBVEND_0, 2); adapter->hw.subsystem_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); + + /* Set MAC type early for PCI setup */ + e1000_set_mac_type(&adapter->hw); } static int ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210969 - head/tools/regression/fstest/tests
Author: pjd Date: Fri Aug 6 21:02:53 2010 New Revision: 210969 URL: http://svn.freebsd.org/changeset/base/210969 Log: Convert file system type to upper case. Modified: head/tools/regression/fstest/tests/conf Modified: head/tools/regression/fstest/tests/conf == --- head/tools/regression/fstest/tests/conf Fri Aug 6 20:55:49 2010 (r210968) +++ head/tools/regression/fstest/tests/conf Fri Aug 6 21:02:53 2010 (r210969) @@ -9,7 +9,7 @@ FreeBSD|Darwin) GREP=grep #fs=`df -T . | tail -1 | awk '{print $2}'` pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" - fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}'` + fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}' | tr '[:lower:]' '[:upper:]'` ;; Solaris|SunOS) GREP=ggrep @@ -19,7 +19,7 @@ Solaris|SunOS) ;; Linux) GREP=grep - fs=`df -PT . | tail -1 | awk '{print $2}'` + fs=`df -PT . | tail -1 | awk '{print $2}' | tr '[:lower:]' '[:upper:]'` ;; *) echo "Unsupported operating system ${os}." >/dev/stderr ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210969 - head/tools/regression/fstest/tests
Hi Pawel, * Pawel Jakub Dawidek wrote: > + fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}' | tr > '[:lower:]' '[:upper:]'` > ... > + fs=`df -PT . | tail -1 | awk '{print $2}' | tr '[:lower:]' '[:upper:]'` Maybe this can be solved using '{ print toupper($2) }'? -- Ed Schouten WWW: http://80386.nl/ pgpSUcN1kp50T.pgp Description: PGP signature
svn commit: r210970 - head/tools/regression/fstest/tests
Author: pjd Date: Fri Aug 6 21:53:50 2010 New Revision: 210970 URL: http://svn.freebsd.org/changeset/base/210970 Log: For FreeBSD and Linux use awk's toupper() function. Suggested by: ed Modified: head/tools/regression/fstest/tests/conf Modified: head/tools/regression/fstest/tests/conf == --- head/tools/regression/fstest/tests/conf Fri Aug 6 21:02:53 2010 (r210969) +++ head/tools/regression/fstest/tests/conf Fri Aug 6 21:53:50 2010 (r210970) @@ -9,7 +9,7 @@ FreeBSD|Darwin) GREP=grep #fs=`df -T . | tail -1 | awk '{print $2}'` pattern="`df . | tail -1 | awk '{printf("%s on %s \n", $1, $6)}'`" - fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}' | tr '[:lower:]' '[:upper:]'` + fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print toupper($2)}'` ;; Solaris|SunOS) GREP=ggrep @@ -19,7 +19,7 @@ Solaris|SunOS) ;; Linux) GREP=grep - fs=`df -PT . | tail -1 | awk '{print $2}' | tr '[:lower:]' '[:upper:]'` + fs=`df -PT . | tail -1 | awk '{print toupper($2)}'` ;; *) echo "Unsupported operating system ${os}." >/dev/stderr ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210971 - head/tools/regression/fstest/tests
Author: pjd Date: Fri Aug 6 21:56:32 2010 New Revision: 210971 URL: http://svn.freebsd.org/changeset/base/210971 Log: Check first todo() argument against operating system name and operating system name plus file system name. Modified: head/tools/regression/fstest/tests/misc.sh Modified: head/tools/regression/fstest/tests/misc.sh == --- head/tools/regression/fstest/tests/misc.sh Fri Aug 6 21:53:50 2010 (r210970) +++ head/tools/regression/fstest/tests/misc.sh Fri Aug 6 21:56:32 2010 (r210971) @@ -87,8 +87,7 @@ test_check() todo() { - echo "${os}" | $GREP -iq "${1}" - if [ $? -eq 0 ]; then + if [ "${os}" = "${1}" -o "${os}:${fs}" = "${1}" ]; then todomsg="${2}" fi } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210972 - head/tools/regression/fstest/tests
Author: pjd Date: Fri Aug 6 21:57:11 2010 New Revision: 210972 URL: http://svn.freebsd.org/changeset/base/210972 Log: Don't use egrep directly - use ${GREP}. Modified: head/tools/regression/fstest/tests/misc.sh Modified: head/tools/regression/fstest/tests/misc.sh == --- head/tools/regression/fstest/tests/misc.sh Fri Aug 6 21:56:32 2010 (r210971) +++ head/tools/regression/fstest/tests/misc.sh Fri Aug 6 21:57:11 2010 (r210972) @@ -9,7 +9,7 @@ path1021="${name255}/${name255}/${name25 path1023="${path1021}/x" path1024="${path1023}x" -echo ${dir} | egrep '^/' >/dev/null 2>&1 +echo ${dir} | ${GREP} -E '^/' >/dev/null 2>&1 if [ $? -eq 0 ]; then maindir="${dir}/../.." else @@ -23,7 +23,7 @@ expect() e="${1}" shift r=`${fstest} $* 2>/dev/null | tail -1` - echo "${r}" | egrep '^'${e}'$' >/dev/null 2>&1 + echo "${r}" | ${GREP} -E '^'${e}'$' >/dev/null 2>&1 if [ $? -eq 0 ]; then if [ -z "${todomsg}" ]; then echo "ok ${ntest}" @@ -48,7 +48,7 @@ jexpect() e="${3}" shift 3 r=`jail -s ${s} / fstest 127.0.0.1 /bin/sh -c "cd ${d} && ${fstest} $* 2>/dev/null" | tail -1` - echo "${r}" | egrep '^'${e}'$' >/dev/null 2>&1 + echo "${r}" | ${GREP} -E '^'${e}'$' >/dev/null 2>&1 if [ $? -eq 0 ]; then if [ -z "${todomsg}" ]; then echo "ok ${ntest}" ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210973 - head/tools/regression/fstest/tests
Author: pjd Date: Fri Aug 6 21:58:53 2010 New Revision: 210973 URL: http://svn.freebsd.org/changeset/base/210973 Log: ${GREP} can only be used after loading 'conf'. Modified: head/tools/regression/fstest/tests/misc.sh Modified: head/tools/regression/fstest/tests/misc.sh == --- head/tools/regression/fstest/tests/misc.sh Fri Aug 6 21:57:11 2010 (r210972) +++ head/tools/regression/fstest/tests/misc.sh Fri Aug 6 21:58:53 2010 (r210973) @@ -9,7 +9,7 @@ path1021="${name255}/${name255}/${name25 path1023="${path1021}/x" path1024="${path1023}x" -echo ${dir} | ${GREP} -E '^/' >/dev/null 2>&1 +echo ${dir} | grep '^/' >/dev/null 2>&1 if [ $? -eq 0 ]; then maindir="${dir}/../.." else ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210974 - head/sys/kern
Author: jamie Date: Fri Aug 6 22:04:18 2010 New Revision: 210974 URL: http://svn.freebsd.org/changeset/base/210974 Log: Implicitly make a new jail persistent if it's set not to attach. MFC after:3 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c == --- head/sys/kern/kern_jail.c Fri Aug 6 21:58:53 2010(r210973) +++ head/sys/kern/kern_jail.c Fri Aug 6 22:04:18 2010(r210974) @@ -599,6 +599,8 @@ kern_jail_set(struct thread *td, struct vfs_flagopt(opts, pr_flag_names[fi], &pr_flags, 1 << fi); vfs_flagopt(opts, pr_flag_nonames[fi], &ch_flags, 1 << fi); } + if ((flags & (JAIL_CREATE | JAIL_UPDATE | JAIL_ATTACH)) == JAIL_CREATE) + pr_flags |= PR_PERSIST; ch_flags |= pr_flags; for (fi = 0; fi < sizeof(pr_flag_jailsys) / sizeof(pr_flag_jailsys[0]); fi++) { @@ -628,12 +630,6 @@ kern_jail_set(struct thread *td, struct ch_flags |= pr_flag_jailsys[fi].new | pr_flag_jailsys[fi].disable; } - if ((flags & (JAIL_CREATE | JAIL_UPDATE | JAIL_ATTACH)) == JAIL_CREATE - && !(pr_flags & PR_PERSIST)) { - error = EINVAL; - vfs_opterror(opts, "new jail must persist or attach"); - goto done_errmsg; - } #ifdef VIMAGE if ((flags & JAIL_UPDATE) && (ch_flags & PR_VNET)) { error = EINVAL; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210975 - head/usr.sbin/jail
Author: jamie Date: Fri Aug 6 22:06:12 2010 New Revision: 210975 URL: http://svn.freebsd.org/changeset/base/210975 Log: Note that a jail without a command parameter will be persistent, instead of explicitly requiring one of "command" or "persist". MFC after:3 days Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 == --- head/usr.sbin/jail/jail.8 Fri Aug 6 22:04:18 2010(r210974) +++ head/usr.sbin/jail/jail.8 Fri Aug 6 22:06:12 2010(r210975) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd August 6, 2010 .Dt JAIL 8 .Os .Sh NAME @@ -333,11 +333,11 @@ where the jail's chroot directory is loc Setting this boolean parameter allows a jail to exist without any processes. Normally, a jail is destroyed as its last process exits. -A new jail must have either the -.Va persist -parameter or +A new jail created without processes (i.e. the .Va command -pseudo-parameter set. +pseudo-parameter) will automatically have +.Va persist +set. .It Va cpuset.id The ID of the cpuset associated with this jail (read-only). .It Va dying ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r210969 - head/tools/regression/fstest/tests
On Fri, Aug 06, 2010 at 11:06:04PM +0200, Ed Schouten wrote: > Hi Pawel, > > * Pawel Jakub Dawidek wrote: > > + fs=`mount | egrep "^${pattern}" | awk -F '[(,]' '{print $2}' | tr > > '[:lower:]' '[:upper:]'` > > ... > > + fs=`df -PT . | tail -1 | awk '{print $2}' | tr '[:lower:]' '[:upper:]'` > > Maybe this can be solved using '{ print toupper($2) }'? Indeed, thanks. -- Pawel Jakub Dawidek http://www.wheelsystems.com p...@freebsd.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! pgpkgHP1ynfKa.pgp Description: PGP signature
svn commit: r210976 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/events sys/contri...
Author: jkim Date: Fri Aug 6 23:11:19 2010 New Revision: 210976 URL: http://svn.freebsd.org/changeset/base/210976 Log: Merge ACPICA 20100806. Added: head/sys/contrib/dev/acpica/utilities/utosi.c - copied, changed from r210945, vendor-sys/acpica/dist/utilities/utosi.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbinput.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/executer/exfldio.c head/sys/contrib/dev/acpica/executer/exprep.c head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/osunixxf.c head/sys/contrib/dev/acpica/utilities/uteval.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/utinit.c head/sys/contrib/dev/acpica/utilities/utmutex.c head/sys/contrib/dev/acpica/utilities/utxface.c head/sys/dev/acpica/Osd/OsdHardware.c head/sys/dev/acpica/Osd/OsdMemory.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files == --- head/sys/conf/files Fri Aug 6 22:06:12 2010(r210975) +++ head/sys/conf/files Fri Aug 6 23:11:19 2010(r210976) @@ -285,6 +285,7 @@ contrib/dev/acpica/utilities/utmath.c o contrib/dev/acpica/utilities/utmisc.c optional acpi contrib/dev/acpica/utilities/utmutex.c optional acpi contrib/dev/acpica/utilities/utobject.coptional acpi +contrib/dev/acpica/utilities/utosi.c optional acpi contrib/dev/acpica/utilities/utresrc.c optional acpi contrib/dev/acpica/utilities/utstate.c optional acpi contrib/dev/acpica/utilities/utxface.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt == --- head/sys/contrib/dev/acpica/changes.txt Fri Aug 6 22:06:12 2010 (r210975) +++ head/sys/contrib/dev/acpica/changes.txt Fri Aug 6 23:11:19 2010 (r210976) @@ -1,7 +1,68 @@ -02 July 2010. Summary of changes for version 20100702: +06 August 2010. Summary of changes for version 20100806: + +1) ACPI CA Core Subsystem: + +Designed and implemented a new host interface to the _OSI support code. This +will allow the host to dynamically add or remove multiple _OSI strings, as +well as install an optional handler that is called for each _OSI invocation. +Also added a new AML debugger command, 'osi' to display and modify the global +_OSI string table, and test support in the AcpiExec utility. See the ACPICA +reference manual for full details. Lin Ming, Bob Moore. ACPICA BZ 836. +New Functions: +AcpiInstallInterface - Add an _OSI string. +AcpiRemoveInterface - Delete an _OSI string. +AcpiInstallInterfaceHandler - Install optional _OSI handler. +Obsolete Functions: +AcpiOsValidateInterface - no longer used. +New Files: +source/components/utilities/utosi.c + +Re-introduced the support to enable multi-byte transfers for Embedded +Controller (EC) operation regions. A reported problem was found to be a bug +in the host OS, not in the multi-byte support. Previously, the maximum data +size passed to the EC operation region handler was a single byte. There are +often EC Fields larger than one byte that need to be transferred, and it is +useful for the EC driver to lock these as a single transaction. This change +enables single transfers larger than 8 bits. This effectively changes the +access to the EC space from ByteAcc to AnyAcc, and will probably require +changes to the host OS Embedded Controller driver to enable 16/32/64/256-bit +transfers in addition to 8-bit transfers. Alexey Starikovskiy, Lin Ming. + +Fixed a problem with the prototype for AcpiOsReadPciConfiguration. The +prototype in acpiosxf.h had the output value pointer as a (void *). +It should be a (UINT64 *). This may affect some host OSL code. + +Fixed a couple problems with the recently modified Linux makefiles for iASL +and AcpiE
svn commit: r210977 - head/sys/dev/acpica
Author: jkim Date: Fri Aug 6 23:35:33 2010 New Revision: 210977 URL: http://svn.freebsd.org/changeset/base/210977 Log: When EC burst mode is activated and multiple bytes are accessed, do not disable and enable repeatedly, just do it once per call. It also reduces code duplication. Check all parameters early and fail immediately. Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c == --- head/sys/dev/acpica/acpi_ec.c Fri Aug 6 23:11:19 2010 (r210976) +++ head/sys/dev/acpica/acpi_ec.c Fri Aug 6 23:35:33 2010 (r210977) @@ -720,24 +720,19 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY UINT64 *Value, void *Context, void *RegionContext) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; -ACPI_STATUSStatus; +ACPI_PHYSICAL_ADDRESS EcAddr; UINT8 *EcData; -UINT8 EcAddr; -intbytes, i; +ACPI_STATUSStatus; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address); +if (Function != ACPI_READ && Function != ACPI_WRITE) + return_ACPI_STATUS (AE_BAD_PARAMETER); if (Width % 8 != 0 || Value == NULL || Context == NULL) return_ACPI_STATUS (AE_BAD_PARAMETER); -bytes = Width / 8; -if (Address + bytes - 1 > 0xFF) +if (Address + Width / 8 > 256) return_ACPI_STATUS (AE_BAD_ADDRESS); -if (Function == ACPI_READ) - *Value = 0; -EcAddr = Address; -EcData = (UINT8 *)Value; - /* * If booting, check if we need to run the query handler. If so, we * we call it directly here since our thread taskq is not active yet. @@ -754,8 +749,21 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY if (ACPI_FAILURE(Status)) return_ACPI_STATUS (Status); +/* If we can't start burst mode, continue anyway. */ +Status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); +if (ACPI_SUCCESS(Status)) { + if (EC_GET_DATA(sc) == EC_BURST_ACK) { + CTR0(KTR_ACPI, "ec burst enabled"); + sc->ec_burstactive = TRUE; + } +} + /* Perform the transaction(s), based on Width. */ -for (i = 0; i < bytes; i++, EcAddr++, EcData++) { +EcAddr = Address; +EcData = (UINT8 *)Value; +if (Function == ACPI_READ) + *Value = 0; +do { switch (Function) { case ACPI_READ: Status = EcRead(sc, EcAddr, EcData); @@ -763,14 +771,17 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY case ACPI_WRITE: Status = EcWrite(sc, EcAddr, *EcData); break; - default: - device_printf(sc->ec_dev, "invalid EcSpaceHandler function %d\n", - Function); - Status = AE_BAD_PARAMETER; - break; } if (ACPI_FAILURE(Status)) break; + EcAddr++; + EcData++; +} while (EcAddr < Address + Width / 8); + +if (sc->ec_burstactive) { + sc->ec_burstactive = FALSE; + if (ACPI_SUCCESS(EcCommand(sc, EC_COMMAND_BURST_DISABLE))) + CTR0(KTR_ACPI, "ec disabled burst ok"); } EcUnlock(sc); @@ -943,22 +954,11 @@ static ACPI_STATUS EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data) { ACPI_STATUSstatus; -UINT8 data; u_int gen_count; ACPI_SERIAL_ASSERT(ec); CTR1(KTR_ACPI, "ec read from %#x", Address); -/* If we can't start burst mode, continue anyway. */ -status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); -if (status == AE_OK) { - data = EC_GET_DATA(sc); - if (data == EC_BURST_ACK) { - CTR0(KTR_ACPI, "ec burst enabled"); - sc->ec_burstactive = TRUE; - } -} - status = EcCommand(sc, EC_COMMAND_READ); if (ACPI_FAILURE(status)) return (status); @@ -972,14 +972,6 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A } *Data = EC_GET_DATA(sc); -if (sc->ec_burstactive) { - sc->ec_burstactive = FALSE; - status = EcCommand(sc, EC_COMMAND_BURST_DISABLE); - if (ACPI_FAILURE(status)) - return (status); - CTR0(KTR_ACPI, "ec disabled burst ok"); -} - return (AE_OK); } @@ -987,22 +979,11 @@ static ACPI_STATUS EcWrite(struct acpi_ec_softc *sc, UINT8 Address, UINT8 Data) { ACPI_STATUSstatus; -UINT8 data; u_int gen_count; ACPI_SERIAL_ASSERT(ec); CTR2(KTR_ACPI, "ec write to %#x, data %#x", Address, Data); -/* If we can't start burst mode, continue anyway. */ -status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); -if (status == AE_OK) { - data = EC_GET_DATA(sc); - if (data == EC_BURST_ACK) { - CTR0(KTR_ACPI, "ec burst enabled"); - sc->ec_burstactive = TRUE; - } -} - status = EcCommand(sc, EC_COMMAND_WRITE); if (A
svn commit: r210984 - in head/tools/regression/fstest/tests: chmod chown granular link mkdir mkfifo open rename rmdir symlink truncate unlink
Author: pjd Date: Fri Aug 6 23:58:54 2010 New Revision: 210984 URL: http://svn.freebsd.org/changeset/base/210984 Log: Various cleanups, mostly to make the test work on FreeBSD/ZFS. Modified: head/tools/regression/fstest/tests/chmod/08.t head/tools/regression/fstest/tests/chmod/09.t head/tools/regression/fstest/tests/chown/08.t head/tools/regression/fstest/tests/chown/09.t head/tools/regression/fstest/tests/granular/00.t head/tools/regression/fstest/tests/granular/01.t head/tools/regression/fstest/tests/granular/02.t head/tools/regression/fstest/tests/granular/03.t head/tools/regression/fstest/tests/granular/04.t head/tools/regression/fstest/tests/granular/05.t head/tools/regression/fstest/tests/link/05.t head/tools/regression/fstest/tests/link/12.t head/tools/regression/fstest/tests/link/13.t head/tools/regression/fstest/tests/link/14.t head/tools/regression/fstest/tests/link/15.t head/tools/regression/fstest/tests/link/16.t head/tools/regression/fstest/tests/mkdir/08.t head/tools/regression/fstest/tests/mkdir/09.t head/tools/regression/fstest/tests/mkdir/11.t head/tools/regression/fstest/tests/mkfifo/08.t head/tools/regression/fstest/tests/mkfifo/10.t head/tools/regression/fstest/tests/mkfifo/11.t head/tools/regression/fstest/tests/open/09.t head/tools/regression/fstest/tests/open/10.t head/tools/regression/fstest/tests/open/11.t head/tools/regression/fstest/tests/open/14.t head/tools/regression/fstest/tests/open/15.t head/tools/regression/fstest/tests/open/18.t head/tools/regression/fstest/tests/open/19.t head/tools/regression/fstest/tests/open/20.t head/tools/regression/fstest/tests/rename/06.t head/tools/regression/fstest/tests/rename/07.t head/tools/regression/fstest/tests/rename/08.t head/tools/regression/fstest/tests/rename/15.t head/tools/regression/fstest/tests/rename/16.t head/tools/regression/fstest/tests/rmdir/09.t head/tools/regression/fstest/tests/rmdir/10.t head/tools/regression/fstest/tests/rmdir/13.t head/tools/regression/fstest/tests/rmdir/14.t head/tools/regression/fstest/tests/symlink/09.t head/tools/regression/fstest/tests/symlink/10.t head/tools/regression/fstest/tests/symlink/11.t head/tools/regression/fstest/tests/truncate/08.t head/tools/regression/fstest/tests/truncate/10.t head/tools/regression/fstest/tests/truncate/11.t head/tools/regression/fstest/tests/unlink/09.t head/tools/regression/fstest/tests/unlink/10.t head/tools/regression/fstest/tests/unlink/12.t Modified: head/tools/regression/fstest/tests/chmod/08.t == --- head/tools/regression/fstest/tests/chmod/08.t Fri Aug 6 23:52:16 2010(r210983) +++ head/tools/regression/fstest/tests/chmod/08.t Fri Aug 6 23:58:54 2010(r210984) @@ -8,7 +8,16 @@ dir=`dirname $0` require chflags -echo "1..40" +case "${os}:${fs}" in +FreeBSD:ZFS) + echo "1..22" + ;; +FreeBSD:UFS) + echo "1..44" + ;; +*) + quick_exit +esac n0=`namegen` @@ -18,30 +27,7 @@ expect EPERM chmod ${n0} 0600 expect 0644 stat ${n0} mode expect 0 chflags ${n0} none expect 0 chmod ${n0} 0600 -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 chflags ${n0} UF_IMMUTABLE -expect EPERM chmod ${n0} 0600 -expect 0644 stat ${n0} mode -expect 0 chflags ${n0} none -expect 0 chmod ${n0} 0600 -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 chflags ${n0} SF_APPEND -expect EPERM chmod ${n0} 0600 -expect 0644 stat ${n0} mode -expect 0 chflags ${n0} none -expect 0 chmod ${n0} 0600 -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 chflags ${n0} UF_APPEND -expect EPERM chmod ${n0} 0600 -expect 0644 stat ${n0} mode -expect 0 chflags ${n0} none -expect 0 chmod ${n0} 0600 +expect 0600 stat ${n0} mode expect 0 unlink ${n0} expect 0 create ${n0} 0644 @@ -51,9 +37,50 @@ expect 0600 stat ${n0} mode expect 0 chflags ${n0} none expect 0 unlink ${n0} -expect 0 create ${n0} 0644 -expect 0 chflags ${n0} UF_NOUNLINK -expect 0 chmod ${n0} 0600 -expect 0600 stat ${n0} mode -expect 0 chflags ${n0} none -expect 0 unlink ${n0} +case "${os}:${fs}" in +FreeBSD:ZFS) + expect 0 create ${n0} 0644 + expect 0 chflags ${n0} SF_APPEND + expect 0 chmod ${n0} 0600 + expect 0600 stat ${n0} mode + expect 0 chflags ${n0} none + expect 0 chmod ${n0} 0600 + expect 0600 stat ${n0} mode + expect 0 unlink ${n0} + ;; +FreeBSD:UFS) + expect 0 create ${n0} 0644 + expect 0 chflags ${n0} SF_APPEND + expect EPERM chmod ${n0} 0600 + expect 0644 stat ${n0} mode + expect 0 chflags ${n0} none + expect 0 chmod ${n0} 0600 + expect 0600 stat ${n0} mode + expect 0 unlink ${n0} + + expect 0 create ${n0} 0644 + expect 0 chflags ${n0} UF_IMMUTABLE + expect EPERM chmod ${n0} 0600 + expect 0644 stat ${n0} mode + expect 0 c
svn commit: r210986 - in head/sys/mips: include mips
Author: neel Date: Sat Aug 7 01:49:44 2010 New Revision: 210986 URL: http://svn.freebsd.org/changeset/base/210986 Log: - Consolidate the the cache coherence attribute definitions in a single place. Adapted from Juli's changes to pte.h in the octeon branch: http://svn.freebsd.org/viewvc/base/user/jmallett/octeon/sys/mips/include/pte.h - Set the KX and UX bits in the status register for n64 kernels. Reviewed by: jmallett Modified: head/sys/mips/include/cpuregs.h head/sys/mips/include/pte.h head/sys/mips/mips/locore.S head/sys/mips/mips/mpboot.S Modified: head/sys/mips/include/cpuregs.h == --- head/sys/mips/include/cpuregs.h Sat Aug 7 01:05:02 2010 (r210985) +++ head/sys/mips/include/cpuregs.h Sat Aug 7 01:49:44 2010 (r210986) @@ -110,15 +110,75 @@ #defineMIPS_XKPHYS_START 0x8000 #defineMIPS_XKPHYS_END 0xbfff -#defineMIPS_CCA_UC 0x02/* Uncached. */ -#defineMIPS_CCA_CNC0x03/* Cacheable non-coherent. */ +/* + * Cache Coherency Attributes: + * UC: Uncached. + * UA: Uncached accelerated. + * C: Cacheable, coherency unspecified. + * CNC:Cacheable non-coherent. + * CC: Cacheable coherent. + * CCE:Cacheable coherent, exclusive read. + * CCEW: Cacheable coherent, exclusive write. + * CCUOW: Cacheable coherent, update on write. + * + * Note that some bits vary in meaning across implementations (and that the + * listing here is no doubt incomplete) and that the optimal cached mode varies + * between implementations. 0x02 is required to be UC and 0x03 is required to + * be a least C. + * + * We define the following logical bits: + * UNCACHED: + * The optimal uncached mode for the target CPU type. This must + * be suitable for use in accessing memory-mapped devices. + * CACHED: The optional cached mode for the target CPU type. + */ + +#defineMIPS_CCA_UC 0x02/* Uncached. */ +#defineMIPS_CCA_C 0x03/* Cacheable, coherency unspecified. */ + +#if defined(CPU_R4000) || defined(CPU_R1) +#defineMIPS_CCA_CNC0x03 +#defineMIPS_CCA_CCE0x04 +#defineMIPS_CCA_CCEW 0x05 + +#ifdef CPU_R4000 +#defineMIPS_CCA_CCUOW 0x06 +#endif + +#ifdef CPU_R1 +#defineMIPS_CCA_UA 0x07 +#endif + +#defineMIPS_CCA_CACHED MIPS_CCA_CCEW +#endif /* defined(CPU_R4000) || defined(CPU_R1) */ + +#if defined(CPU_SB1) +#defineMIPS_CCA_CC 0x05/* Cacheable Coherent. */ +#endif + +#ifndefMIPS_CCA_UNCACHED +#defineMIPS_CCA_UNCACHED MIPS_CCA_UC +#endif + +/* + * If we don't know which cached mode to use and there is a cache coherent + * mode, use it. If there is not a cache coherent mode, use the required + * cacheable mode. + */ +#ifndef MIPS_CCA_CACHED +#ifdef MIPS_CCA_CC +#defineMIPS_CCA_CACHED MIPS_CCA_CC +#else +#defineMIPS_CCA_CACHED MIPS_CCA_C +#endif +#endif #defineMIPS_PHYS_TO_XKPHYS(cca,x) \ ((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x)) #defineMIPS_PHYS_TO_XKPHYS_CACHED(x) \ - ((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_CNC) << 59) | (x)) + ((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_CACHED) << 59) | (x)) #defineMIPS_PHYS_TO_XKPHYS_UNCACHED(x) \ - ((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_UC) << 59) | (x)) + ((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_UNCACHED) << 59) | (x)) #defineMIPS_XKPHYS_TO_PHYS(x) ((x) & 0x07ffULL) Modified: head/sys/mips/include/pte.h == --- head/sys/mips/include/pte.h Sat Aug 7 01:05:02 2010(r210985) +++ head/sys/mips/include/pte.h Sat Aug 7 01:49:44 2010(r210986) @@ -113,17 +113,8 @@ typedefpt_entry_t *pd_entry_t; * it is matched. */ #definePTE_C(attr) ((attr & 0x07) << 3) -#definePTE_C_UNCACHED (PTE_C(0x02)) -/* - * The preferred cache attribute for cacheable pages, this can be - * implementation dependent. We will use the standard value 0x3 as - * default. - */ -#if defined(CPU_SB1) -#definePTE_C_CACHE (PTE_C(0x05)) -#else -#definePTE_C_CACHE (PTE_C(0x03)) -#endif +#definePTE_C_UNCACHED (PTE_C(MIPS_CCA_UNCACHED)) +#definePTE_C_CACHE (PTE_C(MIPS_CCA_CACHED)) #definePTE_D 0x04 #definePTE_V 0x02 #definePTE_G 0x01 Modified: head/sys/mips/mips/locore.S == --- head/sys/mips/mips/locore.S Sat Aug 7 01:05:02 2010(r210985) +++ head/sys/mips/mips/locore.S Sat Aug 7 01:49
svn commit: r210992 - head/sys/compat/x86bios
Author: jkim Date: Sat Aug 7 03:45:45 2010 New Revision: 210992 URL: http://svn.freebsd.org/changeset/base/210992 Log: Optimize interrupt vector lookup. There is no need to check the page table. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c == --- head/sys/compat/x86bios/x86bios.c Sat Aug 7 02:19:19 2010 (r210991) +++ head/sys/compat/x86bios/x86bios.c Sat Aug 7 03:45:45 2010 (r210992) @@ -194,7 +194,7 @@ uint32_t x86bios_get_intr(int intno) { - return (readl(x86bios_offset(intno * 4))); + return (readl(BIOS_PADDRTOVADDR(intno * 4))); } void ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210993 - head/sys/compat/x86bios
Author: jkim Date: Sat Aug 7 04:05:58 2010 New Revision: 210993 URL: http://svn.freebsd.org/changeset/base/210993 Log: Do not block any I/O port on amd64. Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c == --- head/sys/compat/x86bios/x86bios.c Sat Aug 7 03:45:45 2010 (r210992) +++ head/sys/compat/x86bios/x86bios.c Sat Aug 7 04:05:58 2010 (r210993) @@ -424,10 +424,12 @@ static uint8_t x86bios_emu_inb(struct x86emu *emu, uint16_t port) { +#ifndef X86BIOS_NATIVE_ARCH if (port == 0xb2) /* APM scratch register */ return (0); if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); +#endif return (iodev_read_1(port)); } @@ -437,10 +439,10 @@ x86bios_emu_inw(struct x86emu *emu, uint { uint16_t val; +#ifndef X86BIOS_NATIVE_ARCH if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); -#ifndef X86BIOS_NATIVE_ARCH if ((port & 1) != 0) { val = iodev_read_1(port); val |= iodev_read_1(port + 1) << 8; @@ -456,10 +458,10 @@ x86bios_emu_inl(struct x86emu *emu, uint { uint32_t val; +#ifndef X86BIOS_NATIVE_ARCH if (port >= 0x80 && port < 0x88) /* POST status register */ return (0); -#ifndef X86BIOS_NATIVE_ARCH if ((port & 1) != 0) { val = iodev_read_1(port); val |= iodev_read_2(port + 1) << 8; @@ -478,10 +480,12 @@ static void x86bios_emu_outb(struct x86emu *emu, uint16_t port, uint8_t val) { +#ifndef X86BIOS_NATIVE_ARCH if (port == 0xb2) /* APM scratch register */ return; if (port >= 0x80 && port < 0x88) /* POST status register */ return; +#endif iodev_write_1(port, val); } @@ -490,10 +494,10 @@ static void x86bios_emu_outw(struct x86emu *emu, uint16_t port, uint16_t val) { +#ifndef X86BIOS_NATIVE_ARCH if (port >= 0x80 && port < 0x88) /* POST status register */ return; -#ifndef X86BIOS_NATIVE_ARCH if ((port & 1) != 0) { iodev_write_1(port, val); iodev_write_1(port + 1, val >> 8); @@ -506,10 +510,10 @@ static void x86bios_emu_outl(struct x86emu *emu, uint16_t port, uint32_t val) { +#ifndef X86BIOS_NATIVE_ARCH if (port >= 0x80 && port < 0x88) /* POST status register */ return; -#ifndef X86BIOS_NATIVE_ARCH if ((port & 1) != 0) { iodev_write_1(port, val); iodev_write_2(port + 1, val >> 8); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r210994 - head/sys/dev/fb
Author: jkim Date: Sat Aug 7 05:46:04 2010 New Revision: 210994 URL: http://svn.freebsd.org/changeset/base/210994 Log: Protect shared palette and state buffer with a mutex. Remove defunct spltty() calls while I am here. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c == --- head/sys/dev/fb/vesa.c Sat Aug 7 04:05:58 2010(r210993) +++ head/sys/dev/fb/vesa.c Sat Aug 7 05:46:04 2010(r210994) @@ -37,8 +37,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -73,6 +75,8 @@ struct adp_state { }; typedef struct adp_state adp_state_t; +static struct mtx vesa_lock; + static void *vesa_state_buf = NULL; static uint32_t vesa_state_buf_offs = 0; static ssize_t vesa_state_buf_size = 0; @@ -381,17 +385,19 @@ vesa_bios_save_palette(int start, int co regs.R_ES = X86BIOS_PHYSTOSEG(vesa_palette_offs); regs.R_DI = X86BIOS_PHYSTOOFF(vesa_palette_offs); + bits = 8 - bits; + mtx_lock(&vesa_lock); x86bios_intr(®s, 0x10); - - if (regs.R_AX != 0x004f) + if (regs.R_AX != 0x004f) { + mtx_unlock(&vesa_lock); return (1); - - bits = 8 - bits; + } for (i = 0; i < colors; ++i) { palette[i * 3] = vesa_palette[i * 4 + 2] << bits; palette[i * 3 + 1] = vesa_palette[i * 4 + 1] << bits; palette[i * 3 + 2] = vesa_palette[i * 4] << bits; } + mtx_unlock(&vesa_lock); return (0); } @@ -412,17 +418,19 @@ vesa_bios_save_palette2(int start, int c regs.R_ES = X86BIOS_PHYSTOSEG(vesa_palette_offs); regs.R_DI = X86BIOS_PHYSTOOFF(vesa_palette_offs); + bits = 8 - bits; + mtx_lock(&vesa_lock); x86bios_intr(®s, 0x10); - - if (regs.R_AX != 0x004f) + if (regs.R_AX != 0x004f) { + mtx_unlock(&vesa_lock); return (1); - - bits = 8 - bits; + } for (i = 0; i < colors; ++i) { r[i] = vesa_palette[i * 4 + 2] << bits; g[i] = vesa_palette[i * 4 + 1] << bits; b[i] = vesa_palette[i * 4] << bits; } + mtx_unlock(&vesa_lock); return (0); } @@ -443,6 +451,7 @@ vesa_bios_load_palette(int start, int co regs.R_DI = X86BIOS_PHYSTOOFF(vesa_palette_offs); bits = 8 - bits; + mtx_lock(&vesa_lock); for (i = 0; i < colors; ++i) { vesa_palette[i * 4] = palette[i * 3 + 2] >> bits; vesa_palette[i * 4 + 1] = palette[i * 3 + 1] >> bits; @@ -450,6 +459,7 @@ vesa_bios_load_palette(int start, int co vesa_palette[i * 4 + 3] = 0; } x86bios_intr(®s, 0x10); + mtx_unlock(&vesa_lock); return (regs.R_AX != 0x004f); } @@ -471,6 +481,7 @@ vesa_bios_load_palette2(int start, int c regs.R_DI = X86BIOS_PHYSTOOFF(vesa_palette_offs); bits = 8 - bits; + mtx_lock(&vesa_lock); for (i = 0; i < colors; ++i) { vesa_palette[i * 4] = b[i] >> bits; vesa_palette[i * 4 + 1] = g[i] >> bits; @@ -478,6 +489,7 @@ vesa_bios_load_palette2(int start, int c vesa_palette[i * 4 + 3] = 0; } x86bios_intr(®s, 0x10); + mtx_unlock(&vesa_lock); return (regs.R_AX != 0x004f); } @@ -516,6 +528,7 @@ vesa_bios_save_restore(int code, void *p regs.R_ES = X86BIOS_PHYSTOSEG(vesa_state_buf_offs); regs.R_BX = X86BIOS_PHYSTOOFF(vesa_state_buf_offs); + mtx_lock(&vesa_lock); switch (code) { case STATE_SAVE: x86bios_intr(®s, 0x10); @@ -526,6 +539,7 @@ vesa_bios_save_restore(int code, void *p x86bios_intr(®s, 0x10); break; } + mtx_unlock(&vesa_lock); return (regs.R_AX != 0x004f); } @@ -1805,16 +1819,15 @@ static int vesa_load(void) { int error; - int s; if (vesa_init_done) return (0); + mtx_init(&vesa_lock, "VESA lock", NULL, MTX_DEF); + /* locate a VGA adapter */ - s = spltty(); vesa_adp = NULL; error = vesa_configure(0); - splx(s); if (error == 0) vesa_bios_info(bootverbose); @@ -1827,7 +1840,6 @@ vesa_unload(void) { u_char palette[256*3]; int error; - int s; /* if the adapter is currently in a VESA mode, don't unload */ if ((vesa_adp != NULL) && VESA_MODE(vesa_adp->va_mode)) @@ -1837,7 +1849,6 @@ vesa_unload(void) * we shouldn't be unloading! XXX */ - s = spltty(); if ((error = vesa_unload_ioctl()) == 0) { if (vesa_adp != NULL) { if ((vesa_adp->va_flags & V_ADP_DAC8) != 0) { @@ -1850,7 +1861,6 @@ vesa_unload(void) vi