Re: svn commit: r187494 - head/sys/dev/usb2/bluetooth
On Tue, January 20, 2009 11:17 pm, Maksim Yevmenkin wrote: Author: emax Date: Tue Jan 20 22:17:05 2009 New Revision: 187494 URL: http://svn.freebsd.org/changeset/base/187494 Log: Update (well, actually rewrite mostly) ng_ubt2 driver for USB2. Reviewed by:HPS, alfred Blessed by: HPS nice! good work ;) -- /\ Best regards, | re...@freebsd.org \ / Remko Lodder | re...@efnet Xhttp://www.evilcoder.org/ | / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187524 - head/share/zoneinfo
Author: phk Date: Wed Jan 21 10:51:54 2009 New Revision: 187524 URL: http://svn.freebsd.org/changeset/base/187524 Log: Latest bulletin C from Daniel GAMBIS: no leap at the end of june 2009. Modified: head/share/zoneinfo/leapseconds Modified: head/share/zoneinfo/leapseconds == --- head/share/zoneinfo/leapseconds Wed Jan 21 07:41:24 2009 (r187523) +++ head/share/zoneinfo/leapseconds Wed Jan 21 10:51:54 2009 (r187524) @@ -58,28 +58,19 @@ Leap2008Dec 31 23:59:60+ S # e-mail: services.i...@obspm.fr # http://hpiers.obspm.fr/eop-pc # -# Paris, 4 July 2008 +# Paris, 15 January 2009 # -# Bulletin C 36 +# Bulletin C 37 # # To authorities responsible # for the measurement and # distribution of time # -# UTC TIME STEP -# on the 1st of January 2009 -# -# A positive leap second will be introduced at the end of December 2008. -# The sequence of dates of the UTC second markers will be: -# -# 2008 December 31, 23h 59m 59s -# 2008 December 31, 23h 59m 60s -# 2009 January 1, 0h 0m 0s -# -# The difference between UTC and the International Atomic Time TAI is: -# -# from 2006 January 1, 0h UTC, to 2009 January 1 0h UTC : UTC-TAI = - 33s -# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = - 34s +# NO positive leap second will be introduced at the end of June 2009. +# The difference between Coordinated Universal Time UTC and the +# International Atomic Time TAI is : +# +# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s # # Leap seconds can be introduced in UTC at the end of the months of December # or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r187523 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb
Just picking a random commit, but since a couple of days, nearly all commits to stable/7/sys contain the props changed line for Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) It's always these four. What's up with that? Cheers, Ulrich Spörlein -- None are more hopelessly enslaved than those who falsely believe they are free -- Johann Wolfgang von Goethe ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r187523 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb
On 2009-01-21 13:11, Ulrich Spörlein wrote: Just picking a random commit, but since a couple of days, nearly all commits to stable/7/sys contain the props changed line for Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) It's always these four. What's up with that? Looks like Subversion merge information (since it says props changed). ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187525 - head/sys/dev/mmc
Author: mav Date: Wed Jan 21 14:22:06 2009 New Revision: 187525 URL: http://svn.freebsd.org/changeset/base/187525 Log: Fix copy/paste mistake in variable name. This could lead to using incorrect bus frequency. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c == --- head/sys/dev/mmc/mmc.c Wed Jan 21 10:51:54 2009(r187524) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 14:22:06 2009(r187525) @@ -1326,7 +1326,7 @@ mmc_calculate_clock(struct mmc_softc *sc max_timing = ivar-timing; if (ivar-tran_speed max_dtr) max_dtr = ivar-tran_speed; - if (ivar-hs_tran_speed max_dtr) + if (ivar-hs_tran_speed max_hs_dtr) max_hs_dtr = ivar-hs_tran_speed; } for (i = 0; i nkid; i++) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187526 - in head/sys: kern nfsclient ufs/ufs
Author: jhb Date: Wed Jan 21 14:42:00 2009 New Revision: 187526 URL: http://svn.freebsd.org/changeset/base/187526 Log: Move the VA_MARKATIME flag for VOP_SETATTR() out into its own VOP: VOP_MARKATIME() since unlike the rest of VOP_SETATTR(), VA_MARKATIME can be performed while holding a shared vnode lock (the same functionality is done internally by VOP_READ which can run with a shared vnode lock). Add missing locking of the vnode interlock to the ufs implementation and remove a special note and test from the NFS client about not supporting the feature. Inspired by: ups Tested by:pho Modified: head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src head/sys/nfsclient/nfs_vnops.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cWed Jan 21 14:22:06 2009(r187525) +++ head/sys/kern/vfs_subr.cWed Jan 21 14:42:00 2009(r187526) @@ -4206,18 +4206,15 @@ vfs_read_dirent(struct vop_readdir_args /* * Mark for update the access time of the file if the filesystem - * supports VA_MARK_ATIME. This functionality is used by execve + * supports VOP_MARKATIME. This functionality is used by execve * and mmap, so we want to avoid the synchronous I/O implied by * directly setting va_atime for the sake of efficiency. */ void vfs_mark_atime(struct vnode *vp, struct ucred *cred) { - struct vattr atimeattr; if ((vp-v_mount-mnt_flag (MNT_NOATIME | MNT_RDONLY)) == 0) { - VATTR_NULL(atimeattr); - atimeattr.va_vaflags |= VA_MARK_ATIME; - (void)VOP_SETATTR(vp, atimeattr, cred); + (void)VOP_MARKATIME(vp); } } Modified: head/sys/kern/vnode_if.src == --- head/sys/kern/vnode_if.src Wed Jan 21 14:22:06 2009(r187525) +++ head/sys/kern/vnode_if.src Wed Jan 21 14:42:00 2009(r187526) @@ -171,6 +171,11 @@ vop_setattr { IN struct ucred *cred; }; +%% markatime vp L L L + +vop_markatime { + IN struct vnode *vp; +}; %% readvp L L L Modified: head/sys/nfsclient/nfs_vnops.c == --- head/sys/nfsclient/nfs_vnops.c Wed Jan 21 14:22:06 2009 (r187525) +++ head/sys/nfsclient/nfs_vnops.c Wed Jan 21 14:42:00 2009 (r187526) @@ -707,9 +707,9 @@ nfs_setattr(struct vop_setattr_args *ap) #endif /* -* Setting of flags and marking of atimes are not supported. +* Setting of flags is not supported. */ - if (vap-va_flags != VNOVAL || (vap-va_vaflags VA_MARK_ATIME)) + if (vap-va_flags != VNOVAL) return (EOPNOTSUPP); /* Modified: head/sys/ufs/ufs/ufs_vnops.c == --- head/sys/ufs/ufs/ufs_vnops.cWed Jan 21 14:22:06 2009 (r187525) +++ head/sys/ufs/ufs/ufs_vnops.cWed Jan 21 14:42:00 2009 (r187526) @@ -98,6 +98,7 @@ static vop_create_t ufs_create; static vop_getattr_t ufs_getattr; static vop_link_t ufs_link; static int ufs_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); +static vop_markatime_t ufs_markatime; static vop_mkdir_t ufs_mkdir; static vop_mknod_t ufs_mknod; static vop_open_t ufs_open; @@ -491,17 +492,6 @@ ufs_setattr(ap) ((int)vap-va_bytes != VNOVAL) || (vap-va_gen != VNOVAL)) { return (EINVAL); } - /* -* Mark for update the file's access time for vfs_mark_atime(). -* We are doing this here to avoid some of the checks done -* below -- this operation is done by request of the kernel and -* should bypass some security checks. Things like read-only -* checks get handled by other levels (e.g., ffs_update()). -*/ - if (vap-va_vaflags VA_MARK_ATIME) { - ip-i_flag |= IN_ACCESS; - return (0); - } if (vap-va_flags != VNOVAL) { if (vp-v_mount-mnt_flag MNT_RDONLY) return (EROFS); @@ -663,6 +653,25 @@ ufs_setattr(ap) } /* + * Mark this file's access time for update for vfs_mark_atime(). This + * is called from execve() and mmap(). + */ +static int +ufs_markatime(ap) + struct vop_markatime_args /* { + struct vnode *a_vp; + } */ *ap; +{ + struct vnode *vp = ap-a_vp; + struct inode *ip = VTOI(vp); + + VI_LOCK(vp); + ip-i_flag |= IN_ACCESS; + VI_UNLOCK(vp); + return (0); +} + +/* * Change the mode on a file. * Inode must be locked before calling. */ @@ -2481,6 +2490,7 @@ struct vop_vector ufs_vnodeops = { .vop_rename = ufs_rename, .vop_rmdir =
svn commit: r187527 - head/sys/vm
Author: jhb Date: Wed Jan 21 14:43:35 2009 New Revision: 187527 URL: http://svn.freebsd.org/changeset/base/187527 Log: Now that vfs_markatime() no longer requires an exclusive lock due to the VOP_MARKATIME() changes, use a shared vnode lock for mmap(). Submitted by: ups Modified: head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_mmap.c == --- head/sys/vm/vm_mmap.c Wed Jan 21 14:42:00 2009(r187526) +++ head/sys/vm/vm_mmap.c Wed Jan 21 14:43:35 2009(r187527) @@ -1160,7 +1160,7 @@ vm_mmap_vnode(struct thread *td, vm_size mp = vp-v_mount; cred = td-td_ucred; vfslocked = VFS_LOCK_GIANT(mp); - if ((error = vget(vp, LK_EXCLUSIVE, td)) != 0) { + if ((error = vget(vp, LK_SHARED, td)) != 0) { VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -1177,7 +1177,7 @@ vm_mmap_vnode(struct thread *td, vm_size if (obj-handle != vp) { vput(vp); vp = (struct vnode*)obj-handle; - vget(vp, LK_EXCLUSIVE, td); + vget(vp, LK_SHARED, td); } type = OBJT_VNODE; handle = vp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187528 - in head/sys: kern sys ufs/ufs
Author: kib Date: Wed Jan 21 14:51:38 2009 New Revision: 187528 URL: http://svn.freebsd.org/changeset/base/187528 Log: Move the code from ufs_lookup.c used to do dotdot lookup, into the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the .. entry in lookup routine. Requested by: jhb Tested by:pho MFC after:1 month Modified: head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/kern/vfs_vnops.c == --- head/sys/kern/vfs_vnops.c Wed Jan 21 14:43:35 2009(r187527) +++ head/sys/kern/vfs_vnops.c Wed Jan 21 14:51:38 2009(r187528) @@ -1286,3 +1286,35 @@ vn_extattr_rm(struct vnode *vp, int iofl return (error); } + +int +vn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, struct vnode **rvp) +{ + struct mount *mp; + int ltype, error; + + mp = vp-v_mount; + ltype = VOP_ISLOCKED(vp); + KASSERT(ltype == LK_EXCLUSIVE || ltype == LK_SHARED, + (vn_vget_ino: vp not locked)); + for (;;) { + error = vfs_busy(mp, MBF_NOWAIT); + if (error == 0) + break; + VOP_UNLOCK(vp, 0); + pause(vn_vget, 1); + vn_lock(vp, ltype | LK_RETRY); + if (vp-v_iflag VI_DOOMED) + return (ENOENT); + } + VOP_UNLOCK(vp, 0); + error = VFS_VGET(mp, ino, lkflags, rvp); + vfs_unbusy(mp); + vn_lock(vp, ltype | LK_RETRY); + if (vp-v_iflag VI_DOOMED) { + if (error == 0) + vput(*rvp); + error = ENOENT; + } + return (error); +} Modified: head/sys/sys/vnode.h == --- head/sys/sys/vnode.hWed Jan 21 14:43:35 2009(r187527) +++ head/sys/sys/vnode.hWed Jan 21 14:51:38 2009(r187528) @@ -636,6 +636,9 @@ int vn_extattr_set(struct vnode *vp, int const char *attrname, int buflen, char *buf, struct thread *td); intvn_extattr_rm(struct vnode *vp, int ioflg, int attrnamespace, const char *attrname, struct thread *td); +intvn_vget_ino(struct vnode *vp, ino_t ino, int lkflags, + struct vnode **rvp); + intvfs_cache_lookup(struct vop_lookup_args *ap); void vfs_timestamp(struct timespec *); void vfs_write_resume(struct mount *mp); Modified: head/sys/ufs/ufs/ufs_lookup.c == --- head/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 14:43:35 2009 (r187527) +++ head/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 14:51:38 2009 (r187528) @@ -157,7 +157,6 @@ ufs_lookup(ap) int nameiop = cnp-cn_nameiop; ino_t ino; int ltype; - struct mount *mp; bp = NULL; slotoffset = -1; @@ -578,27 +577,7 @@ found: */ pdp = vdp; if (flags ISDOTDOT) { - ltype = VOP_ISLOCKED(pdp); - mp = pdp-v_mount; - for (;;) { - error = vfs_busy(mp, MBF_NOWAIT); - if (error == 0) - break; - VOP_UNLOCK(pdp, 0); - pause(ufs_dd, 1); - vn_lock(pdp, ltype | LK_RETRY); - if (pdp-v_iflag VI_DOOMED) - return (ENOENT); - } - VOP_UNLOCK(pdp, 0); /* race to get the inode */ - error = VFS_VGET(mp, ino, cnp-cn_lkflags, tdp); - vfs_unbusy(mp); - vn_lock(pdp, ltype | LK_RETRY); - if (pdp-v_iflag VI_DOOMED) { - if (error == 0) - vput(tdp); - error = ENOENT; - } + error = vn_vget_ino(pdp, ino, cnp-cn_lkflags, tdp); if (error) return (error); *vpp = tdp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187529 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb i386/cpufreq
Author: jhb Date: Wed Jan 21 15:01:36 2009 New Revision: 187529 URL: http://svn.freebsd.org/changeset/base/187529 Log: MFC: If we are unable to obtain a frequency list from either ACPI or the static tables, then attempt to build a simple list containing just the high and low frequencies if the hw.est.msr_info tunable is set to 1. By default this is disabled. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/cpufreq/est.c Modified: stable/7/sys/i386/cpufreq/est.c == --- stable/7/sys/i386/cpufreq/est.c Wed Jan 21 14:51:38 2009 (r187528) +++ stable/7/sys/i386/cpufreq/est.c Wed Jan 21 15:01:36 2009 (r187529) @@ -38,6 +38,7 @@ __FBSDID($FreeBSD$); #include sys/systm.h #include cpufreq_if.h +#include machine/clock.h #include machine/md_var.h #include machine/specialreg.h @@ -71,6 +72,7 @@ typedef struct { struct est_softc { device_tdev; int acpi_settings; + int msr_settings; freq_info *freq_list; }; @@ -92,6 +94,8 @@ struct est_softc { const char intel_id[] = GenuineIntel; const char centaur_id[] = CentaurHauls; +static int msr_info_enabled = 0; +TUNABLE_INT(hw.est.msr_info, msr_info_enabled); /* Default bus clock value for Centrino processors. */ #define INTEL_BUS_CLK 100 @@ -898,6 +902,7 @@ static int est_detach(device_t parent); static int est_get_info(device_t dev); static int est_acpi_info(device_t dev, freq_info **freqs); static int est_table_info(device_t dev, uint64_t msr, freq_info **freqs); +static int est_msr_info(device_t dev, uint64_t msr, freq_info **freqs); static freq_info *est_get_current(freq_info *freq_list); static int est_settings(device_t dev, struct cf_setting *sets, int *count); static int est_set(device_t dev, const struct cf_setting *set); @@ -1039,7 +1044,7 @@ est_detach(device_t dev) return (error); sc = device_get_softc(dev); - if (sc-acpi_settings) + if (sc-acpi_settings || sc-msr_settings) free(sc-freq_list, M_DEVBUF); return (0); } @@ -1063,6 +1068,8 @@ est_get_info(device_t dev) error = est_table_info(dev, msr, sc-freq_list); if (error) error = est_acpi_info(dev, sc-freq_list); + if (error) + error = est_msr_info(dev, msr, sc-freq_list); if (error) { printf( @@ -1168,6 +1175,91 @@ est_table_info(device_t dev, uint64_t ms return (0); } +static int +bus_speed_ok(int bus) +{ + + switch (bus) { + case 100: + case 133: + case 333: + return (1); + default: + return (0); + } +} + +/* + * Flesh out a simple rate table containing the high and low frequencies + * based on the current clock speed and the upper 32 bits of the MSR. + */ +static int +est_msr_info(device_t dev, uint64_t msr, freq_info **freqs) +{ + struct est_softc *sc; + freq_info *fp; + int bus, freq, volts; + uint16_t id; + + if (!msr_info_enabled) + return (EOPNOTSUPP); + + /* Figure out the bus clock. */ + freq = tsc_freq / 100; + id = msr 32; + bus = freq / (id 8); + device_printf(dev, Guessed bus clock (high) of %d MHz\n, bus); + if (!bus_speed_ok(bus)) { + /* We may be running on the low frequency. */ + id = msr 48; + bus = freq / (id 8); + device_printf(dev, Guessed bus clock (low) of %d MHz\n, bus); + if (!bus_speed_ok(bus)) + return (EOPNOTSUPP); + + /* Calculate high frequency. */ + id = msr 32; + freq = ((id 8) 0xff) * bus; + } + + /* Fill out a new freq table containing just the high and low freqs. */ + sc = device_get_softc(dev); + fp = malloc(sizeof(freq_info) * 3, M_DEVBUF, M_WAITOK | M_ZERO); + + /* First, the high frequency. */ + volts = id 0xff; + if (volts != 0) { + volts = 4; + volts += 700; + } + fp[0].freq = freq; + fp[0].volts = volts; + fp[0].id16 = id; + fp[0].power = CPUFREQ_VAL_UNKNOWN; + device_printf(dev, Guessed high setting of %d MHz @ %d Mv\n, freq, + volts); + + /* Second, the low frequency. */ + id = msr 48; + freq = ((id 8) 0xff) * bus; + volts = id 0xff; + if (volts != 0) { + volts = 4; + volts += 700; + } + fp[1].freq = freq; + fp[1].volts = volts; + fp[1].id16 = id; + fp[1].power = CPUFREQ_VAL_UNKNOWN; + device_printf(dev, Guessed low setting of
svn commit: r187530 - in stable/6/sys: . vm
Author: emaste Date: Wed Jan 21 15:04:06 2009 New Revision: 187530 URL: http://svn.freebsd.org/changeset/base/187530 Log: MFC r181693: Fix REDZONE(9) on amd64 and perhaps other 64 bit targets -- ensure the space that redzone adds to the allocation for storing its metadata is at least as large as the metadata that it will store there. PR: kern/128744 Modified: stable/6/sys/ (props changed) stable/6/sys/vm/redzone.c Modified: stable/6/sys/vm/redzone.c == --- stable/6/sys/vm/redzone.c Wed Jan 21 15:01:36 2009(r187529) +++ stable/6/sys/vm/redzone.c Wed Jan 21 15:04:06 2009(r187530) @@ -54,6 +54,8 @@ static u_long redzone_roundup(u_long n) { + if (n REDZONE_HSIZE) + n = REDZONE_HSIZE; if (n = 128) return (128); else if (n = 256) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187531 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ufs
Author: kib Date: Wed Jan 21 15:06:53 2009 New Revision: 187531 URL: http://svn.freebsd.org/changeset/base/187531 Log: MFC r185170. r185556: Busy ufs filesystem around block of code that does .. lookup. Do not lock vnode interlock around reading of v_iflag to check VI_DOOMED. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/ufs/ufs/ufs_lookup.c Modified: stable/7/sys/ufs/ufs/ufs_lookup.c == --- stable/7/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 15:04:06 2009 (r187530) +++ stable/7/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 15:06:53 2009 (r187531) @@ -158,6 +158,7 @@ ufs_lookup(ap) struct thread *td = cnp-cn_thread; ino_t ino; int ltype; + struct mount *mp; bp = NULL; slotoffset = -1; @@ -579,9 +580,26 @@ found: pdp = vdp; if (flags ISDOTDOT) { ltype = VOP_ISLOCKED(pdp, td); + mp = pdp-v_mount; + for (;;) { + error = vfs_busy(mp, LK_NOWAIT, NULL, td); + if (error == 0) + break; + VOP_UNLOCK(pdp, 0, td); + pause(ufs_dd, 1); + vn_lock(pdp, ltype | LK_RETRY, td); + if (pdp-v_iflag VI_DOOMED) + return (ENOENT); + } VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ - error = VFS_VGET(pdp-v_mount, ino, cnp-cn_lkflags, tdp); + error = VFS_VGET(mp, ino, cnp-cn_lkflags, tdp); + vfs_unbusy(mp, td); vn_lock(pdp, ltype | LK_RETRY, td); + if (pdp-v_iflag VI_DOOMED) { + if (error == 0) + vput(tdp); + error = ENOENT; + } if (error) return (error); *vpp = tdp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187532 - stable/7/gnu/usr.bin/gdb/kgdb
Author: jhb Date: Wed Jan 21 15:19:38 2009 New Revision: 187532 URL: http://svn.freebsd.org/changeset/base/187532 Log: MFC: Use existing GDB routines for parsing the section table of klds in the 'add-kld' command. Modified: stable/7/gnu/usr.bin/gdb/kgdb/ (props changed) stable/7/gnu/usr.bin/gdb/kgdb/kld.c Modified: stable/7/gnu/usr.bin/gdb/kgdb/kld.c == --- stable/7/gnu/usr.bin/gdb/kgdb/kld.c Wed Jan 21 15:06:53 2009 (r187531) +++ stable/7/gnu/usr.bin/gdb/kgdb/kld.c Wed Jan 21 15:19:38 2009 (r187532) @@ -37,6 +37,7 @@ __FBSDID($FreeBSD$); #include command.h #include completer.h #include environ.h +#include exec.h #include frame-unwind.h #include inferior.h #include objfiles.h @@ -196,39 +197,14 @@ find_kld_address (char *arg, CORE_ADDR * return (0); } -struct add_section_info { - struct section_addr_info *section_addrs; - int sect_index; - CORE_ADDR base_addr; -}; - -static void -add_section (bfd *bfd, asection *sect, void *arg) -{ - struct add_section_info *asi = arg; - CORE_ADDR address; - char *name; - - /* Ignore non-resident sections. */ - if ((bfd_get_section_flags(bfd, sect) (SEC_ALLOC | SEC_LOAD)) == 0) - return; - - name = xstrdup(bfd_get_section_name(bfd, sect)); - make_cleanup(xfree, name); - address = asi-base_addr + bfd_get_section_vma(bfd, sect); - asi-section_addrs-other[asi-sect_index].name = name; - asi-section_addrs-other[asi-sect_index].addr = address; - asi-section_addrs-other[asi-sect_index].sectindex = sect-index; - printf_unfiltered(\t%s_addr = %s\n, name, local_hex_string(address)); - asi-sect_index++; -} - static void load_kld (char *path, CORE_ADDR base_addr, int from_tty) { - struct add_section_info asi; + struct section_addr_info *sap; + struct section_table *sections = NULL, *sections_end = NULL, *s; struct cleanup *cleanup; bfd *bfd; + int i; /* Open the kld. */ bfd = bfd_openr(path, gnutarget); @@ -244,19 +220,30 @@ load_kld (char *path, CORE_ADDR base_add if (bfd_get_section_by_name (bfd, .text) == NULL) error(\%s\: can't find text section, path); - printf_unfiltered(add symbol table from file \%s\ at\n, path); + /* Build a section table from the bfd and relocate the sections. */ + if (build_section_table (bfd, sections, sections_end)) + error(\%s\: can't find file sections, path); + cleanup = make_cleanup(xfree, sections); + for (s = sections; s sections_end; s++) { + s-addr += base_addr; + s-endaddr += base_addr; + } + + /* Build a section addr info to pass to symbol_file_add(). */ + sap = build_section_addr_info_from_section_table (sections, + sections_end); + cleanup = make_cleanup((make_cleanup_ftype *)free_section_addr_info, + sap); - /* Build a section table for symbol_file_add() from the bfd sections. */ - asi.section_addrs = alloc_section_addr_info(bfd_count_sections(bfd)); - cleanup = make_cleanup(xfree, asi.section_addrs); - asi.sect_index = 0; - asi.base_addr = base_addr; - bfd_map_over_sections(bfd, add_section, asi); + printf_unfiltered(add symbol table from file \%s\ at\n, path); + for (i = 0; i sap-num_sections; i++) + printf_unfiltered(\t%s_addr = %s\n, sap-other[i].name, + local_hex_string(sap-other[i].addr)); if (from_tty (!query(%s, ))) error(Not confirmed.); - symbol_file_add(path, from_tty, asi.section_addrs, 0, OBJF_USERLOADED); + symbol_file_add(path, from_tty, sap, 0, OBJF_USERLOADED); do_cleanups(cleanup); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187533 - stable/6/gnu/usr.bin/gdb/kgdb
Author: jhb Date: Wed Jan 21 15:25:00 2009 New Revision: 187533 URL: http://svn.freebsd.org/changeset/base/187533 Log: MFC: Use existing GDB routines for parsing the section table of klds in the 'add-kld' command. Modified: stable/6/gnu/usr.bin/gdb/kgdb/ (props changed) stable/6/gnu/usr.bin/gdb/kgdb/kld.c Modified: stable/6/gnu/usr.bin/gdb/kgdb/kld.c == --- stable/6/gnu/usr.bin/gdb/kgdb/kld.c Wed Jan 21 15:19:38 2009 (r187532) +++ stable/6/gnu/usr.bin/gdb/kgdb/kld.c Wed Jan 21 15:25:00 2009 (r187533) @@ -37,6 +37,7 @@ __FBSDID($FreeBSD$); #include command.h #include completer.h #include environ.h +#include exec.h #include frame-unwind.h #include inferior.h #include objfiles.h @@ -196,39 +197,14 @@ find_kld_address (char *arg, CORE_ADDR * return (0); } -struct add_section_info { - struct section_addr_info *section_addrs; - int sect_index; - CORE_ADDR base_addr; -}; - -static void -add_section (bfd *bfd, asection *sect, void *arg) -{ - struct add_section_info *asi = arg; - CORE_ADDR address; - char *name; - - /* Ignore non-resident sections. */ - if ((bfd_get_section_flags(bfd, sect) (SEC_ALLOC | SEC_LOAD)) == 0) - return; - - name = xstrdup(bfd_get_section_name(bfd, sect)); - make_cleanup(xfree, name); - address = asi-base_addr + bfd_get_section_vma(bfd, sect); - asi-section_addrs-other[asi-sect_index].name = name; - asi-section_addrs-other[asi-sect_index].addr = address; - asi-section_addrs-other[asi-sect_index].sectindex = sect-index; - printf_unfiltered(\t%s_addr = %s\n, name, local_hex_string(address)); - asi-sect_index++; -} - static void load_kld (char *path, CORE_ADDR base_addr, int from_tty) { - struct add_section_info asi; + struct section_addr_info *sap; + struct section_table *sections = NULL, *sections_end = NULL, *s; struct cleanup *cleanup; bfd *bfd; + int i; /* Open the kld. */ bfd = bfd_openr(path, gnutarget); @@ -244,19 +220,30 @@ load_kld (char *path, CORE_ADDR base_add if (bfd_get_section_by_name (bfd, .text) == NULL) error(\%s\: can't find text section, path); - printf_unfiltered(add symbol table from file \%s\ at\n, path); + /* Build a section table from the bfd and relocate the sections. */ + if (build_section_table (bfd, sections, sections_end)) + error(\%s\: can't find file sections, path); + cleanup = make_cleanup(xfree, sections); + for (s = sections; s sections_end; s++) { + s-addr += base_addr; + s-endaddr += base_addr; + } + + /* Build a section addr info to pass to symbol_file_add(). */ + sap = build_section_addr_info_from_section_table (sections, + sections_end); + cleanup = make_cleanup((make_cleanup_ftype *)free_section_addr_info, + sap); - /* Build a section table for symbol_file_add() from the bfd sections. */ - asi.section_addrs = alloc_section_addr_info(bfd_count_sections(bfd)); - cleanup = make_cleanup(xfree, asi.section_addrs); - asi.sect_index = 0; - asi.base_addr = base_addr; - bfd_map_over_sections(bfd, add_section, asi); + printf_unfiltered(add symbol table from file \%s\ at\n, path); + for (i = 0; i sap-num_sections; i++) + printf_unfiltered(\t%s_addr = %s\n, sap-other[i].name, + local_hex_string(sap-other[i].addr)); if (from_tty (!query(%s, ))) error(Not confirmed.); - symbol_file_add(path, from_tty, asi.section_addrs, 0, OBJF_USERLOADED); + symbol_file_add(path, from_tty, sap, 0, OBJF_USERLOADED); do_cleanups(cleanup); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187534 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/devfs fs/fdescfs fs/hpfs fs/msdosfs fs/ntfs fs/portalfs fs/pseudofs fs/smbfs fs/tmpfs fs/udf gnu/fs/xfs/FreeBSD kern ...
Author: kib Date: Wed Jan 21 15:51:15 2009 New Revision: 187534 URL: http://svn.freebsd.org/changeset/base/187534 Log: MFC r183211: Initialize birthtime fields in vn_stat() to prevent stat(2) from returning uninitialized birthtime. Most file systems don't initialize birthtime properly in their VOP_GETTATTR(). MFC r183212: Initialize va_flags and va_filerev properly in VOP_GETATTR(). Don't initialize va_vaflags and va_spare because they are not part of the VOP_GETATTR() API. Also don't initialize birthtime to ctime or zero. MFC rr183213: Initialize va_rdev to NODEV and va_fsid to VNOVAL before the VOP_GETATTR() call in vn_stat(). Thus if a file system doesn't initialize those fields in VOP_GETATTR() they will have a sane default value. MFC r183214: Initialize va_rdev to NODEV instead of 0 or VNOVAL in VOP_GETATTR(). NODEV is more appropriate when va_rdev doesn't have a meaningful value. MFC r183215: fdescfs, devfs, mqueuefs, nfs, portalfs, pseudofs, tmpfs and xfs initialize the vattr structure in VOP_GETATTR() with VATTR_NULL(), vattr_null() or by zeroing it. Remove these to allow preinitialization of fields work in vn_stat(). This is needed to get birthtime initialized correctly. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/devfs/devfs_vnops.c stable/7/sys/fs/fdescfs/fdesc_vnops.c stable/7/sys/fs/hpfs/hpfs_vnops.c stable/7/sys/fs/msdosfs/msdosfs_vnops.c stable/7/sys/fs/ntfs/ntfs_vnops.c stable/7/sys/fs/portalfs/portal_vnops.c stable/7/sys/fs/pseudofs/pseudofs_vnops.c stable/7/sys/fs/smbfs/smbfs_node.c stable/7/sys/fs/tmpfs/tmpfs_vnops.c stable/7/sys/fs/udf/udf_vnops.c stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c stable/7/sys/kern/uipc_mqueue.c stable/7/sys/kern/vfs_vnops.c stable/7/sys/nfsclient/nfs_vnops.c stable/7/sys/ufs/ufs/ufs_vnops.c Modified: stable/7/sys/fs/devfs/devfs_vnops.c == --- stable/7/sys/fs/devfs/devfs_vnops.c Wed Jan 21 15:25:00 2009 (r187533) +++ stable/7/sys/fs/devfs/devfs_vnops.c Wed Jan 21 15:51:15 2009 (r187534) @@ -507,8 +507,6 @@ devfs_getattr(struct vop_getattr_args *a KASSERT(de != NULL, (Null dir dirent in devfs_getattr vp=%p, vp)); } - bzero((caddr_t) vap, sizeof(*vap)); - vattr_null(vap); vap-va_uid = de-de_uid; vap-va_gid = de-de_gid; vap-va_mode = de-de_mode; @@ -551,6 +549,7 @@ devfs_getattr(struct vop_getattr_args *a } vap-va_gen = 0; vap-va_flags = 0; + vap-va_filerev = 0; vap-va_nlink = de-de_links; vap-va_fileid = de-de_inode; Modified: stable/7/sys/fs/fdescfs/fdesc_vnops.c == --- stable/7/sys/fs/fdescfs/fdesc_vnops.c Wed Jan 21 15:25:00 2009 (r187533) +++ stable/7/sys/fs/fdescfs/fdesc_vnops.c Wed Jan 21 15:51:15 2009 (r187534) @@ -391,8 +391,6 @@ fdesc_getattr(ap) switch (VTOFDESC(vp)-fd_type) { case Froot: - VATTR_NULL(vap); - vap-va_mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; vap-va_type = VDIR; vap-va_nlink = 2; @@ -407,8 +405,9 @@ fdesc_getattr(ap) vap-va_ctime = vap-va_mtime; vap-va_gen = 0; vap-va_flags = 0; - vap-va_rdev = 0; + vap-va_rdev = NODEV; vap-va_bytes = 0; + vap-va_filerev = 0; break; case Fdesc: @@ -421,7 +420,6 @@ fdesc_getattr(ap) error = fo_stat(fp, stb, ap-a_td-td_ucred, ap-a_td); fdrop(fp, ap-a_td); if (error == 0) { - VATTR_NULL(vap); vap-va_type = IFTOVT(stb.st_mode); vap-va_mode = stb.st_mode; #define FDRX (VREAD|VEXEC) @@ -456,6 +454,8 @@ fdesc_getattr(ap) vap-va_ctime = stb.st_ctimespec; vap-va_uid = stb.st_uid; vap-va_gid = stb.st_gid; + vap-va_gen = 0; + vap-va_filerev = 0; } break; Modified: stable/7/sys/fs/hpfs/hpfs_vnops.c == --- stable/7/sys/fs/hpfs/hpfs_vnops.c Wed Jan 21 15:25:00 2009 (r187533) +++ stable/7/sys/fs/hpfs/hpfs_vnops.c Wed Jan 21 15:51:15 2009 (r187534) @@ -425,7 +425,7 @@ hpfs_getattr(ap) vap-va_nlink = 1; vap-va_uid = hp-h_uid; vap-va_gid = hp-h_gid; - vap-va_rdev = 0; /* XXX UNODEV ? */ + vap-va_rdev = NODEV;
svn commit: r187535 - in stable/7/sys: . compat/freebsd32 compat/ia32 contrib/pf dev/ath/ath_hal dev/cxgb
Author: jhb Date: Wed Jan 21 16:14:43 2009 New Revision: 187535 URL: http://svn.freebsd.org/changeset/base/187535 Log: MFC: Add support for installing 32-bit system calls from kernel modules. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/freebsd32_misc.c stable/7/sys/compat/freebsd32/freebsd32_util.h stable/7/sys/compat/ia32/ia32_sysvec.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/compat/freebsd32/freebsd32_misc.c == --- stable/7/sys/compat/freebsd32/freebsd32_misc.c Wed Jan 21 15:51:15 2009(r187534) +++ stable/7/sys/compat/freebsd32/freebsd32_misc.c Wed Jan 21 16:14:43 2009(r187535) @@ -2589,3 +2589,83 @@ freebsd32_xxx(struct thread *td, struct return (error); } #endif + +int +syscall32_register(int *offset, struct sysent *new_sysent, +struct sysent *old_sysent) +{ + if (*offset == NO_SYSCALL) { + int i; + + for (i = 1; i SYS_MAXSYSCALL; ++i) + if (freebsd32_sysent[i].sy_call == + (sy_call_t *)lkmnosys) + break; + if (i == SYS_MAXSYSCALL) + return (ENFILE); + *offset = i; + } else if (*offset 0 || *offset = SYS_MAXSYSCALL) + return (EINVAL); + else if (freebsd32_sysent[*offset].sy_call != (sy_call_t *)lkmnosys + freebsd32_sysent[*offset].sy_call != (sy_call_t *)lkmressys) + return (EEXIST); + + *old_sysent = freebsd32_sysent[*offset]; + freebsd32_sysent[*offset] = *new_sysent; + return 0; +} + +int +syscall32_deregister(int *offset, struct sysent *old_sysent) +{ + + if (*offset) + freebsd32_sysent[*offset] = *old_sysent; + return 0; +} + +int +syscall32_module_handler(struct module *mod, int what, void *arg) +{ + struct syscall_module_data *data = (struct syscall_module_data*)arg; + modspecific_t ms; + int error; + + switch (what) { + case MOD_LOAD: + error = syscall32_register(data-offset, data-new_sysent, + data-old_sysent); + if (error) { + /* Leave a mark so we know to safely unload below. */ + data-offset = NULL; + return error; + } + ms.intval = *data-offset; + MOD_XLOCK; + module_setspecific(mod, ms); + MOD_XUNLOCK; + if (data-chainevh) + error = data-chainevh(mod, what, data-chainarg); + return (error); + case MOD_UNLOAD: + /* +* MOD_LOAD failed, so just return without calling the +* chained handler since we didn't pass along the MOD_LOAD +* event. +*/ + if (data-offset == NULL) + return (0); + if (data-chainevh) { + error = data-chainevh(mod, what, data-chainarg); + if (error) + return (error); + } + error = syscall32_deregister(data-offset, data-old_sysent); + return (error); + default: + error = EOPNOTSUPP; + if (data-chainevh) + error = data-chainevh(mod, what, data-chainarg); + return (error); + } +} Modified: stable/7/sys/compat/freebsd32/freebsd32_util.h == --- stable/7/sys/compat/freebsd32/freebsd32_util.h Wed Jan 21 15:51:15 2009(r187534) +++ stable/7/sys/compat/freebsd32/freebsd32_util.h Wed Jan 21 16:14:43 2009(r187535) @@ -28,14 +28,16 @@ * $FreeBSD$ */ -#include vm/vm.h -#include vm/vm_param.h -#include vm/pmap.h - +#ifndef _COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ +#define _COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ +#include sys/cdefs.h #include sys/exec.h #include sys/sysent.h -#include sys/cdefs.h + +#include vm/vm.h +#include vm/vm_param.h +#include vm/pmap.h struct freebsd32_ps_strings { u_int32_t ps_argvstr; /* first of 0 or more argument strings */ @@ -50,3 +52,35 @@ struct freebsd32_ps_strings { #define FREEBSD32_PS_STRINGS \ (FREEBSD32_USRSTACK - sizeof(struct freebsd32_ps_strings)) + +extern struct sysent freebsd32_sysent[]; + +#define SYSCALL32_MODULE(name, offset, new_sysent, evh, arg) \ +static struct syscall_module_data name##_syscall32_mod = { \ + evh, arg, offset, new_sysent, { 0, NULL } \ +}; \ +
svn commit: r187536 - in stable/6/sys: . compat/freebsd32 compat/ia32
Author: jhb Date: Wed Jan 21 16:28:15 2009 New Revision: 187536 URL: http://svn.freebsd.org/changeset/base/187536 Log: MFC: Add support for installing 32-bit system calls from kernel modules. Modified: stable/6/sys/ (props changed) stable/6/sys/compat/freebsd32/freebsd32_misc.c stable/6/sys/compat/freebsd32/freebsd32_util.h stable/6/sys/compat/ia32/ia32_sysvec.c Modified: stable/6/sys/compat/freebsd32/freebsd32_misc.c == --- stable/6/sys/compat/freebsd32/freebsd32_misc.c Wed Jan 21 16:14:43 2009(r187535) +++ stable/6/sys/compat/freebsd32/freebsd32_misc.c Wed Jan 21 16:28:15 2009(r187536) @@ -2298,3 +2298,83 @@ freebsd32_xxx(struct thread *td, struct } #endif + +int +syscall32_register(int *offset, struct sysent *new_sysent, +struct sysent *old_sysent) +{ + if (*offset == NO_SYSCALL) { + int i; + + for (i = 1; i SYS_MAXSYSCALL; ++i) + if (freebsd32_sysent[i].sy_call == + (sy_call_t *)lkmnosys) + break; + if (i == SYS_MAXSYSCALL) + return (ENFILE); + *offset = i; + } else if (*offset 0 || *offset = SYS_MAXSYSCALL) + return (EINVAL); + else if (freebsd32_sysent[*offset].sy_call != (sy_call_t *)lkmnosys + freebsd32_sysent[*offset].sy_call != (sy_call_t *)lkmressys) + return (EEXIST); + + *old_sysent = freebsd32_sysent[*offset]; + freebsd32_sysent[*offset] = *new_sysent; + return 0; +} + +int +syscall32_deregister(int *offset, struct sysent *old_sysent) +{ + + if (*offset) + freebsd32_sysent[*offset] = *old_sysent; + return 0; +} + +int +syscall32_module_handler(struct module *mod, int what, void *arg) +{ + struct syscall_module_data *data = (struct syscall_module_data*)arg; + modspecific_t ms; + int error; + + switch (what) { + case MOD_LOAD: + error = syscall32_register(data-offset, data-new_sysent, + data-old_sysent); + if (error) { + /* Leave a mark so we know to safely unload below. */ + data-offset = NULL; + return error; + } + ms.intval = *data-offset; + MOD_XLOCK; + module_setspecific(mod, ms); + MOD_XUNLOCK; + if (data-chainevh) + error = data-chainevh(mod, what, data-chainarg); + return (error); + case MOD_UNLOAD: + /* +* MOD_LOAD failed, so just return without calling the +* chained handler since we didn't pass along the MOD_LOAD +* event. +*/ + if (data-offset == NULL) + return (0); + if (data-chainevh) { + error = data-chainevh(mod, what, data-chainarg); + if (error) + return (error); + } + error = syscall32_deregister(data-offset, data-old_sysent); + return (error); + default: + error = EOPNOTSUPP; + if (data-chainevh) + error = data-chainevh(mod, what, data-chainarg); + return (error); + } +} Modified: stable/6/sys/compat/freebsd32/freebsd32_util.h == --- stable/6/sys/compat/freebsd32/freebsd32_util.h Wed Jan 21 16:14:43 2009(r187535) +++ stable/6/sys/compat/freebsd32/freebsd32_util.h Wed Jan 21 16:28:15 2009(r187536) @@ -28,14 +28,16 @@ * $FreeBSD$ */ -#include vm/vm.h -#include vm/vm_param.h -#include vm/pmap.h - +#ifndef _COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ +#define _COMPAT_FREEBSD32_FREEBSD32_UTIL_H_ +#include sys/cdefs.h #include sys/exec.h #include sys/sysent.h -#include sys/cdefs.h + +#include vm/vm.h +#include vm/vm_param.h +#include vm/pmap.h struct freebsd32_ps_strings { u_int32_t ps_argvstr; /* first of 0 or more argument strings */ @@ -50,3 +52,35 @@ struct freebsd32_ps_strings { #define FREEBSD32_PS_STRINGS \ (FREEBSD32_USRSTACK - sizeof(struct freebsd32_ps_strings)) + +extern struct sysent freebsd32_sysent[]; + +#define SYSCALL32_MODULE(name, offset, new_sysent, evh, arg) \ +static struct syscall_module_data name##_syscall32_mod = { \ + evh, arg, offset, new_sysent, { 0, NULL } \ +}; \ + \ +static moduledata_t name##32_mod = { \ + #name, \ +
svn commit: r187537 - in stable/6/sys: . compat/freebsd32 kern sys
Author: jhb Date: Wed Jan 21 17:03:55 2009 New Revision: 187537 URL: http://svn.freebsd.org/changeset/base/187537 Log: MFC: Split most of getdirentries() out into a kern_getdirentries() and add a freebsd32 frontend to fix a data corruption bug with 32-bit binaries. Modified: stable/6/sys/ (props changed) stable/6/sys/compat/freebsd32/freebsd32_misc.c stable/6/sys/compat/freebsd32/syscalls.master stable/6/sys/kern/vfs_syscalls.c stable/6/sys/sys/syscallsubr.h Modified: stable/6/sys/compat/freebsd32/freebsd32_misc.c == --- stable/6/sys/compat/freebsd32/freebsd32_misc.c Wed Jan 21 16:28:15 2009(r187536) +++ stable/6/sys/compat/freebsd32/freebsd32_misc.c Wed Jan 21 17:03:55 2009(r187537) @@ -1702,6 +1702,24 @@ freebsd32_ftruncate(struct thread *td, s return (ftruncate(td, ap)); } +int +freebsd32_getdirentries(struct thread *td, +struct freebsd32_getdirentries_args *uap) +{ + long base; + int32_t base32; + int error; + + error = kern_getdirentries(td, uap-fd, uap-buf, uap-count, base); + if (error) + return (error); + if (uap-basep != NULL) { + base32 = base; + error = copyout(base32, uap-basep, sizeof(int32_t)); + } + return (error); +} + struct sf_hdtr32 { uint32_t headers; int hdr_cnt; Modified: stable/6/sys/compat/freebsd32/syscalls.master == --- stable/6/sys/compat/freebsd32/syscalls.master Wed Jan 21 16:28:15 2009(r187536) +++ stable/6/sys/compat/freebsd32/syscalls.master Wed Jan 21 17:03:55 2009(r187537) @@ -355,8 +355,8 @@ 195AUE_SETRLIMIT MNOPROTO { int setrlimit(u_int which, \ struct rlimit *rlp); } setrlimit \ __setrlimit_args int -196AUE_GETDIRENTRIES MNOPROTO { int getdirentries(int fd, char *buf, \ - u_int count, long *basep); } +196AUE_GETDIRENTRIES MSTD{ int freebsd32_getdirentries(int fd, \ + char *buf, u_int count, int32_t *basep); } 197AUE_MMAPMSTD{ caddr_t freebsd32_mmap(caddr_t addr, \ size_t len, int prot, int flags, int fd, \ int pad, u_int32_t poslo, \ Modified: stable/6/sys/kern/vfs_syscalls.c == --- stable/6/sys/kern/vfs_syscalls.cWed Jan 21 16:28:15 2009 (r187536) +++ stable/6/sys/kern/vfs_syscalls.cWed Jan 21 17:03:55 2009 (r187537) @@ -3688,6 +3688,21 @@ getdirentries(td, uap) long *basep; } */ *uap; { + long base; + int error; + + error = kern_getdirentries(td, uap-fd, uap-buf, uap-count, base); + if (error) + return (error); + if (uap-basep != NULL) + error = copyout(base, uap-basep, sizeof(long)); + return (error); +} + +int +kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, +long *basep) +{ struct vnode *vp; struct file *fp; struct uio auio; @@ -3696,10 +3711,10 @@ getdirentries(td, uap) long loff; int error, eofflag; - AUDIT_ARG(fd, uap-fd); + AUDIT_ARG(fd, fd); if (uap-count INT_MAX) return (EINVAL); - if ((error = getvnode(td-td_proc-p_fd, uap-fd, fp)) != 0) + if ((error = getvnode(td-td_proc-p_fd, fd, fp)) != 0) return (error); if ((fp-f_flag FREAD) == 0) { fdrop(fp, td); @@ -3713,14 +3728,14 @@ unionread: error = EINVAL; goto fail; } - aiov.iov_base = uap-buf; - aiov.iov_len = uap-count; + aiov.iov_base = buf; + aiov.iov_len = count; auio.uio_iov = aiov; auio.uio_iovcnt = 1; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; - auio.uio_resid = uap-count; + auio.uio_resid = count; /* vn_lock(vp, LK_SHARED | LK_RETRY, td); */ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); AUDIT_ARG(vnode, vp, ARG_VNODE1); @@ -3737,7 +3752,7 @@ unionread: VFS_UNLOCK_GIANT(vfslocked); goto fail; } - if (uap-count == auio.uio_resid + if (count == auio.uio_resid (vp-v_vflag VV_ROOT) (vp-v_mount-mnt_flag MNT_UNION)) { struct vnode *tvp = vp; @@ -3752,10 +3767,8 @@ unionread: } VOP_UNLOCK(vp, 0, td); VFS_UNLOCK_GIANT(vfslocked); - if (uap-basep != NULL) { - error = copyout(loff, uap-basep, sizeof(long)); - } - td-td_retval[0] = uap-count -
svn commit: r187538 - stable/6/sys/compat/freebsd32
Author: jhb Date: Wed Jan 21 17:07:23 2009 New Revision: 187538 URL: http://svn.freebsd.org/changeset/base/187538 Log: Regen. Modified: stable/6/sys/compat/freebsd32/freebsd32_proto.h stable/6/sys/compat/freebsd32/freebsd32_syscall.h stable/6/sys/compat/freebsd32/freebsd32_syscalls.c stable/6/sys/compat/freebsd32/freebsd32_sysent.c Modified: stable/6/sys/compat/freebsd32/freebsd32_proto.h == --- stable/6/sys/compat/freebsd32/freebsd32_proto.h Wed Jan 21 17:03:55 2009(r187537) +++ stable/6/sys/compat/freebsd32/freebsd32_proto.h Wed Jan 21 17:07:23 2009(r187538) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.16 2008/04/24 10:46:17 dfr Exp + * created from FreeBSD: stable/6/sys/compat/freebsd32/syscalls.master 187537 2009-01-21 17:03:55Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -163,6 +163,12 @@ struct freebsd32_lstat_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char ub_l_[PADL_(struct stat32 *)]; struct stat32 * ub; char ub_r_[PADR_(struct stat32 *)]; }; +struct freebsd32_getdirentries_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; + char count_l_[PADL_(u_int)]; u_int count; char count_r_[PADR_(u_int)]; + char basep_l_[PADL_(int32_t *)]; int32_t * basep; char basep_r_[PADR_(int32_t *)]; +}; struct freebsd32_mmap_args { char addr_l_[PADL_(caddr_t)]; caddr_t addr; char addr_r_[PADR_(caddr_t)]; char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; @@ -349,6 +355,7 @@ int freebsd32_pwrite(struct thread *, st intfreebsd32_stat(struct thread *, struct freebsd32_stat_args *); intfreebsd32_fstat(struct thread *, struct freebsd32_fstat_args *); intfreebsd32_lstat(struct thread *, struct freebsd32_lstat_args *); +intfreebsd32_getdirentries(struct thread *, struct freebsd32_getdirentries_args *); intfreebsd32_mmap(struct thread *, struct freebsd32_mmap_args *); intfreebsd32_lseek(struct thread *, struct freebsd32_lseek_args *); intfreebsd32_truncate(struct thread *, struct freebsd32_truncate_args *); Modified: stable/6/sys/compat/freebsd32/freebsd32_syscall.h == --- stable/6/sys/compat/freebsd32/freebsd32_syscall.h Wed Jan 21 17:03:55 2009(r187537) +++ stable/6/sys/compat/freebsd32/freebsd32_syscall.h Wed Jan 21 17:07:23 2009(r187538) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.16 2008/04/24 10:46:17 dfr Exp + * created from FreeBSD: stable/6/sys/compat/freebsd32/syscalls.master 187537 2009-01-21 17:03:55Z jhb */ #defineFREEBSD32_SYS_syscall 0 @@ -177,7 +177,7 @@ #defineFREEBSD32_SYS_fpathconf 192 #defineFREEBSD32_SYS_getrlimit 194 #defineFREEBSD32_SYS_setrlimit 195 -#defineFREEBSD32_SYS_getdirentries 196 +#defineFREEBSD32_SYS_freebsd32_getdirentries 196 #defineFREEBSD32_SYS_freebsd32_mmap197 #defineFREEBSD32_SYS___syscall 198 #defineFREEBSD32_SYS_freebsd32_lseek 199 Modified: stable/6/sys/compat/freebsd32/freebsd32_syscalls.c == --- stable/6/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jan 21 17:03:55 2009(r187537) +++ stable/6/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jan 21 17:07:23 2009(r187538) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.50.2.16 2008/04/24 10:46:17 dfr Exp + * created from FreeBSD: stable/6/sys/compat/freebsd32/syscalls.master 187537 2009-01-21 17:03:55Z jhb */ const char *freebsd32_syscallnames[] = { @@ -203,7 +203,7 @@ const char *freebsd32_syscallnames[] = { #193, /* 193 = nosys */ getrlimit,/* 194 = getrlimit */ setrlimit,/* 195 = setrlimit */ - getdirentries,/* 196 = getdirentries */ + freebsd32_getdirentries, /* 196 = freebsd32_getdirentries */ freebsd32_mmap, /* 197 = freebsd32_mmap */ __syscall,/* 198 = __syscall */ freebsd32_lseek, /* 199 = freebsd32_lseek */ Modified: stable/6/sys/compat/freebsd32/freebsd32_sysent.c == --- stable/6/sys/compat/freebsd32/freebsd32_sysent.cWed Jan 21
svn commit: r187539 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb pci
Author: jkim Date: Wed Jan 21 17:07:46 2009 New Revision: 187539 URL: http://svn.freebsd.org/changeset/base/187539 Log: MFC: Add support for AMD64 Family 10h processors. PR: kern/128331 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/pci/agp_amd64.c Modified: stable/7/sys/pci/agp_amd64.c == --- stable/7/sys/pci/agp_amd64.cWed Jan 21 17:07:23 2009 (r187538) +++ stable/7/sys/pci/agp_amd64.cWed Jan 21 17:07:46 2009 (r187539) @@ -167,14 +167,16 @@ agp_amd64_attach(device_t dev) { struct agp_amd64_softc *sc = device_get_softc(dev); struct agp_gatt *gatt; + uint32_t devid; int i, n, error; - for (i = 0, n = 0; i PCI_SLOTMAX n AMD64_MAX_MCTRL; i++) - if (pci_cfgregread(0, i, 3, 0, 4) == 0x11031022) { + for (i = 0, n = 0; i PCI_SLOTMAX n AMD64_MAX_MCTRL; i++) { + devid = pci_cfgregread(0, i, 3, 0, 4); + if (devid == 0x11031022 || devid == 0x12031022) { sc-mctrl[n] = i; n++; } - + } if (n == 0) return (ENXIO); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187540 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mfi
Author: jhb Date: Wed Jan 21 17:13:31 2009 New Revision: 187540 URL: http://svn.freebsd.org/changeset/base/187540 Log: MFC: Fix the maximum transfer size for mfi(4) disk devices to not exceed the maximum number of scatter/gather elements supported in the bus dma tag. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mfi/mfi_disk.c Modified: stable/7/sys/dev/mfi/mfi_disk.c == --- stable/7/sys/dev/mfi/mfi_disk.c Wed Jan 21 17:07:46 2009 (r187539) +++ stable/7/sys/dev/mfi/mfi_disk.c Wed Jan 21 17:13:31 2009 (r187540) @@ -136,7 +136,8 @@ mfi_disk_attach(device_t dev) sc-ld_disk = disk_alloc(); sc-ld_disk-d_drv1 = sc; - sc-ld_disk-d_maxsize = sc-ld_controller-mfi_max_io * secsize; + sc-ld_disk-d_maxsize = min(sc-ld_controller-mfi_max_io * secsize, + (sc-ld_controller-mfi_max_sge - 1) * PAGE_SIZE); sc-ld_disk-d_name = mfid; sc-ld_disk-d_open = mfi_disk_open; sc-ld_disk-d_close = mfi_disk_close; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187541 - in stable/6/sys: . dev/mfi
Author: jhb Date: Wed Jan 21 17:16:03 2009 New Revision: 187541 URL: http://svn.freebsd.org/changeset/base/187541 Log: MFC: Fix the maximum transfer size for mfi(4) disk devices to not exceed the maximum number of scatter/gather elements supported in the bus dma tag. Modified: stable/6/sys/ (props changed) stable/6/sys/dev/mfi/mfi_disk.c Modified: stable/6/sys/dev/mfi/mfi_disk.c == --- stable/6/sys/dev/mfi/mfi_disk.c Wed Jan 21 17:13:31 2009 (r187540) +++ stable/6/sys/dev/mfi/mfi_disk.c Wed Jan 21 17:16:03 2009 (r187541) @@ -136,7 +136,8 @@ mfi_disk_attach(device_t dev) sc-ld_disk = disk_alloc(); sc-ld_disk-d_drv1 = sc; - sc-ld_disk-d_maxsize = sc-ld_controller-mfi_max_io * secsize; + sc-ld_disk-d_maxsize = min(sc-ld_controller-mfi_max_io * secsize, + (sc-ld_controller-mfi_max_sge - 1) * PAGE_SIZE); sc-ld_disk-d_name = mfid; sc-ld_disk-d_open = mfi_disk_open; sc-ld_disk-d_close = mfi_disk_close; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187542 - stable/7/sys/dev/ata
Author: n_hibma Date: Wed Jan 21 17:23:06 2009 New Revision: 187542 URL: http://svn.freebsd.org/changeset/base/187542 Log: Couple of pointy hats to me, please. Not only did I make an unnecessary commit, I actually managed to screw up the revert as well. Submitted by: quite a few people... Modified: stable/7/sys/dev/ata/ata-all.c Modified: stable/7/sys/dev/ata/ata-all.c == --- stable/7/sys/dev/ata/ata-all.c Wed Jan 21 17:16:03 2009 (r187541) +++ stable/7/sys/dev/ata/ata-all.c Wed Jan 21 17:23:06 2009 (r187542) @@ -127,7 +127,7 @@ ata_attach(device_t dev) /* reset the controller HW, the channel and device(s) */ while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch-unit) - pause(atatch, 1); + pause(ataatch, 1); ATA_RESET(dev); ATA_LOCKING(dev, ATA_LF_UNLOCK); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187543 - head/sys/dev/mmc
Author: imp Date: Wed Jan 21 17:28:24 2009 New Revision: 187543 URL: http://svn.freebsd.org/changeset/base/187543 Log: Make the command reporting be under boot verbose. Also, report a few other things under boot verbose. Small style nit to make new code look like old code in this file. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c == --- head/sys/dev/mmc/mmc.c Wed Jan 21 17:23:06 2009(r187542) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 17:28:24 2009(r187543) @@ -340,7 +340,9 @@ mmc_wait_for_cmd(struct mmc_softc *sc, s memset(cmd-resp, 0, sizeof(cmd-resp)); cmd-retries = retries; mreq.cmd = cmd; -/* printf(CMD: %x ARG %x\n, cmd-opcode, cmd-arg); */ + if (bootverbose) + device_printf(sc-dev, CMD: %#x ARG %#x\n, cmd-opcode, + cmd-arg); mmc_wait_for_req(sc, mreq); return (cmd-error); } @@ -629,6 +631,7 @@ mmc_set_timing(struct mmc_softc *sc, int { int err; uint8_t value; + u_char switch_res[64]; switch (timing) { case bus_timing_normal: @@ -640,14 +643,11 @@ mmc_set_timing(struct mmc_softc *sc, int default: return (MMC_ERR_INVALID); } - if (mmcbr_get_mode(sc-dev) == mode_sd) { - u_char switch_res[64]; - + if (mmcbr_get_mode(sc-dev) == mode_sd) err = mmc_sd_switch(sc, 1, 0, value, switch_res); - } else { + else err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, value); - } return (err); } @@ -1255,8 +1255,12 @@ mmc_go_discovery(struct mmc_softc *sc) mmcbr_set_mode(dev, mode_sd); mmc_power_up(sc); mmcbr_set_bus_mode(dev, pushpull); + if (bootverbose) + device_printf(sc-dev, Idle cards for SD probe\n); mmc_idle_cards(sc); err = mmc_send_if_cond(sc, 1); + if (bootverbose) + device_printf(sc-dev, SD: SEND_IF_CONF %d\n, err); if (mmc_send_app_op_cond(sc, err ? 0 : MMC_OCR_CCS, ocr) != MMC_ERR_NONE) { /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187544 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/fdc
Author: jkim Date: Wed Jan 21 17:32:26 2009 New Revision: 187544 URL: http://svn.freebsd.org/changeset/base/187544 Log: MFC: r184976 - Revive fdc(4) per-device flag 0x10, which was removed in r1.284[1]. - If the flag is set and auto-select fails, assume disk is not present. - Set disk empty flag only when the floppy controller reset is needed. It fixes regression introduced in r1.311, which prevented it from ignoring errors. Now fdformat(1) and dd(1) with conv=noerror option can continue when read/write errors occur as they should. - Do not retry disk probing as it is extremely slow and pointless. - Move the disk probing code into a separate function. - Do not reset disk empty flag if write-protect check fails somehow. PR: kern/116538[1] Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/fdc/fdc.c Modified: stable/7/sys/dev/fdc/fdc.c == --- stable/7/sys/dev/fdc/fdc.c Wed Jan 21 17:28:24 2009(r187543) +++ stable/7/sys/dev/fdc/fdc.c Wed Jan 21 17:32:26 2009(r187544) @@ -97,6 +97,8 @@ __FBSDID($FreeBSD$); * fd_drivetype; on i386 machines, if * given as 0, use RTC type for fd0 * and fd1 */ +#defineFD_NO_CHLINE0x10/* drive does not support changeline +* aka. unit attention */ #define FD_NO_PROBE0x20/* don't probe drive (seek test), just * assume it is there */ @@ -263,6 +265,7 @@ struct fd_data { static driver_intr_t fdc_intr; static driver_filter_t fdc_intr_fast; static void fdc_reset(struct fdc_data *); +static int fd_probe_disk(struct fd_data *, int *); SYSCTL_NODE(_debug, OID_AUTO, fdc, CTLFLAG_RW, 0, fdc driver); @@ -768,9 +771,11 @@ fdc_worker(struct fdc_data *fdc) (fdc-retry = retries || (fd-options FDOPT_NORETRY))) { if ((debugflags 4)) printf(Too many retries (EIO)\n); - mtx_lock(fdc-fdc_mtx); - fd-flags |= FD_EMPTY; - mtx_unlock(fdc-fdc_mtx); + if (fdc-flags FDC_NEEDS_RESET) { + mtx_lock(fdc-fdc_mtx); + fd-flags |= FD_EMPTY; + mtx_unlock(fdc-fdc_mtx); + } return (fdc_biodone(fdc, EIO)); } @@ -836,65 +841,12 @@ fdc_worker(struct fdc_data *fdc) fdctl_wr(fdc, fd-ft-trans); if (bp-bio_cmd BIO_PROBE) { - - if (!(fdin_rd(fdc) FDI_DCHG) !(fd-flags FD_EMPTY)) + if ((!(device_get_flags(fd-dev) FD_NO_CHLINE) + !(fdin_rd(fdc) FDI_DCHG) + !(fd-flags FD_EMPTY)) || + fd_probe_disk(fd, need_recal) == 0) return (fdc_biodone(fdc, 0)); - - /* -* Try to find out if we have a disk in the drive -* -* First recal, then seek to cyl#1, this clears the -* old condition on the disk change line so we can -* examine it for current status -*/ - if (debugflags 0x40) - printf(New disk in probe\n); - mtx_lock(fdc-fdc_mtx); - fd-flags |= FD_NEWDISK; - mtx_unlock(fdc-fdc_mtx); - retry_line = __LINE__; - if (fdc_cmd(fdc, 2, NE7CMD_RECAL, fd-fdsu, 0)) - return (1); - tsleep(fdc, PRIBIO, fdrecal, hz); - retry_line = __LINE__; - if (fdc_sense_int(fdc, st0, cyl) == FD_NOT_VALID) - return (1); /* XXX */ - retry_line = __LINE__; - if ((st0 0xc0) || cyl != 0) - return (1); - - /* Seek to track 1 */ - retry_line = __LINE__; - if (fdc_cmd(fdc, 3, NE7CMD_SEEK, fd-fdsu, 1, 0)) - return (1); - tsleep(fdc, PRIBIO, fdseek, hz); - retry_line = __LINE__; - if (fdc_sense_int(fdc, st0, cyl) == FD_NOT_VALID) - return (1); /* XXX */ - need_recal |= (1 fd-fdsu); - if (fdin_rd(fdc) FDI_DCHG) { - if (debugflags 0x40) - printf(Empty in probe\n); - mtx_lock(fdc-fdc_mtx); - fd-flags |= FD_EMPTY; - mtx_unlock(fdc-fdc_mtx); - } else { - if (debugflags 0x40) - printf(Got disk in probe\n); - mtx_lock(fdc-fdc_mtx); -
svn commit: r187545 - svnadmin/conf
Author: thompsa Date: Wed Jan 21 17:33:45 2009 New Revision: 187545 URL: http://svn.freebsd.org/changeset/base/187545 Log: Bump my size limit. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf == --- svnadmin/conf/sizelimit.confWed Jan 21 17:32:26 2009 (r187544) +++ svnadmin/conf/sizelimit.confWed Jan 21 17:33:45 2009 (r187545) @@ -20,3 +20,4 @@ des lstewart obrien +thompsa ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187546 - head/sys/dev/mmc
Author: imp Date: Wed Jan 21 17:34:14 2009 New Revision: 187546 URL: http://svn.freebsd.org/changeset/base/187546 Log: Fix minor style nit for file consistency. Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c == --- head/sys/dev/mmc/mmc.c Wed Jan 21 17:33:45 2009(r187545) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 17:34:14 2009(r187546) @@ -586,11 +586,11 @@ mmc_sd_switch(struct mmc_softc *sc, uint static int mmc_set_card_bus_width(struct mmc_softc *sc, uint16_t rca, int width) { + struct mmc_command cmd; int err; + uint8_t value; if (mmcbr_get_mode(sc-dev) == mode_sd) { - struct mmc_command cmd; - memset(cmd, 0, sizeof(struct mmc_command)); cmd.opcode = ACMD_SET_BUS_WIDTH; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; @@ -606,8 +606,6 @@ mmc_set_card_bus_width(struct mmc_softc } err = mmc_wait_for_app_cmd(sc, rca, cmd, CMD_RETRIES); } else { - uint8_t value; - switch (width) { case bus_width_1: value = EXT_CSD_BUS_WIDTH_1; @@ -621,7 +619,8 @@ mmc_set_card_bus_width(struct mmc_softc default: return (MMC_ERR_INVALID); } - err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, value); + err = mmc_switch(sc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, + value); } return (err); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187548 - head/sys/arm/at91
Author: imp Date: Wed Jan 21 17:39:11 2009 New Revision: 187548 URL: http://svn.freebsd.org/changeset/base/187548 Log: o The f_max is really at91_master_clock / 2, not 30MHz, so compute it as such. o Only set 4-bit caps on those boards that have 4-bit caps (this means that because we don't set wire4 yet, this forces us to always use 1-bit bus). o Don't test wire4 when setting up the bus width, since bad things will happen if we do. # This likely won't fix the busted at91 sd card support, but these are # needful changes for correctness. Modified: head/sys/arm/at91/at91_mci.c Modified: head/sys/arm/at91/at91_mci.c == --- head/sys/arm/at91/at91_mci.cWed Jan 21 17:36:06 2009 (r187547) +++ head/sys/arm/at91/at91_mci.cWed Jan 21 17:39:11 2009 (r187548) @@ -199,9 +199,12 @@ at91_mci_attach(device_t dev) goto out; } sc-host.f_min = 375000; - sc-host.f_max = 3000; + sc-host.f_max = at91_master_clock / 2; /* Typically 30MHz */ sc-host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc-host.caps = MMC_CAP_4_BIT_DATA; + if (sc-wire4) + sc-host.caps = MMC_CAP_4_BIT_DATA; + else + sc-host.caps = 0; child = device_add_child(dev, mmc, 0); device_set_ivars(dev, sc-host); err = bus_generic_attach(dev); @@ -294,7 +297,7 @@ at91_mci_update_ios(device_t brdev, devi else clkdiv = (at91_master_clock / ios-clock) / 2; } - if (ios-bus_width == bus_width_4 sc-wire4) + if (ios-bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); else WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) ~MCI_SDCR_SDCBUS); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187551 - head/sys/dev/mmc
Author: imp Date: Wed Jan 21 17:49:23 2009 New Revision: 187551 URL: http://svn.freebsd.org/changeset/base/187551 Log: Default to normal bus timing mode on SD cards. In practice, most cards people have today support high speed mode, so the timing field would be initialized to bus_timing_hs, but there are some slow cards... Modified: head/sys/dev/mmc/mmc.c Modified: head/sys/dev/mmc/mmc.c == --- head/sys/dev/mmc/mmc.c Wed Jan 21 17:42:57 2009(r187550) +++ head/sys/dev/mmc/mmc.c Wed Jan 21 17:49:23 2009(r187551) @@ -1118,6 +1118,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_app_send_scr(sc, ivar-rca, ivar-raw_scr); mmc_app_decode_scr(ivar-raw_scr, ivar-scr); /* Get card switch capabilities. */ + ivar-timing = bus_timing_normal; if ((ivar-scr.sda_vsn = 1) (ivar-csd.ccc (110))) { mmc_sd_switch(sc, 0, 0, 0xF, switch_res); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187552 - in stable/7/sys: . compat/linprocfs contrib/pf dev/ath/ath_hal dev/cxgb
Author: jhb Date: Wed Jan 21 18:26:10 2009 New Revision: 187552 URL: http://svn.freebsd.org/changeset/base/187552 Log: MFC: Don't leak a reference on the /compat/linux vnode everytime the linprocfs 'mtab' file is read. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linprocfs/linprocfs.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/compat/linprocfs/linprocfs.c == --- stable/7/sys/compat/linprocfs/linprocfs.c Wed Jan 21 17:49:23 2009 (r187551) +++ stable/7/sys/compat/linprocfs/linprocfs.c Wed Jan 21 18:26:10 2009 (r187552) @@ -315,11 +315,13 @@ linprocfs_domtab(PFS_FILL_ARGS) NDINIT(nd, LOOKUP, FOLLOW | MPSAFE, UIO_SYSSPACE, linux_emul_path, td); flep = NULL; error = namei(nd); - VFS_UNLOCK_GIANT(NDHASGIANT(nd)); - if (error != 0 || vn_fullpath(td, nd.ni_vp, dlep, flep) != 0) - lep = linux_emul_path; - else - lep = dlep; + lep = linux_emul_path; + if (error == 0) { + if (vn_fullpath(td, nd.ni_vp, dlep, flep) != 0) + lep = dlep; + vrele(nd.ni_vp); + VFS_UNLOCK_GIANT(NDHASGIANT(nd)); + } lep_len = strlen(lep); mtx_lock(mountlist_mtx); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187553 - in stable/7/sys: . contrib/pf dev/cxgb kern sys
Author: jhb Date: Wed Jan 21 18:32:43 2009 New Revision: 187553 URL: http://svn.freebsd.org/changeset/base/187553 Log: MFC: Invoke MOD_QUIESCE on all modules in a linker file (kld) before unloading any modules. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_linker.c stable/7/sys/kern/kern_module.c stable/7/sys/sys/module.h Modified: stable/7/sys/kern/kern_linker.c == --- stable/7/sys/kern/kern_linker.c Wed Jan 21 18:26:10 2009 (r187552) +++ stable/7/sys/kern/kern_linker.c Wed Jan 21 18:32:43 2009 (r187553) @@ -587,7 +587,30 @@ linker_file_unload(linker_file_t file, i informing modules\n)); /* -* Inform any modules associated with this file. +* Quiesce all the modules to give them a chance to veto the unload. +*/ + MOD_SLOCK; + for (mod = TAILQ_FIRST(file-modules); mod; +mod = module_getfnext(mod)) { + + error = module_quiesce(mod); + if (error != 0 flags != LINKER_UNLOAD_FORCE) { + KLD_DPF(FILE, (linker_file_unload: module %s +vetoed unload\n, module_getname(mod))); + /* +* XXX: Do we need to tell all the quiesced modules +* that they can resume work now via a new module +* event? +*/ + MOD_SUNLOCK; + return (error); + } + } + MOD_SUNLOCK; + + /* +* Inform any modules associated with this file that they are +* being be unloaded. */ MOD_XLOCK; for (mod = TAILQ_FIRST(file-modules); mod; mod = next) { @@ -597,9 +620,9 @@ linker_file_unload(linker_file_t file, i /* * Give the module a chance to veto the unload. */ - if ((error = module_unload(mod, flags)) != 0) { - KLD_DPF(FILE, (linker_file_unload: module %p -vetoes unload\n, mod)); + if ((error = module_unload(mod)) != 0) { + KLD_DPF(FILE, (linker_file_unload: module %s +failed unload\n, mod)); return (error); } MOD_XLOCK; Modified: stable/7/sys/kern/kern_module.c == --- stable/7/sys/kern/kern_module.c Wed Jan 21 18:26:10 2009 (r187552) +++ stable/7/sys/kern/kern_module.c Wed Jan 21 18:32:43 2009 (r187553) @@ -196,9 +196,7 @@ module_release(module_t mod) TAILQ_REMOVE(modules, mod, link); if (mod-file) TAILQ_REMOVE(mod-file-modules, mod, flink); - MOD_XUNLOCK; free(mod, M_MODULE); - MOD_XLOCK; } } @@ -232,16 +230,25 @@ module_lookupbyid(int modid) } int -module_unload(module_t mod, int flags) +module_quiesce(module_t mod) { int error; mtx_lock(Giant); error = MOD_EVENT(mod, MOD_QUIESCE); + mtx_unlock(Giant); if (error == EOPNOTSUPP || error == EINVAL) error = 0; - if (error == 0 || flags == LINKER_UNLOAD_FORCE) - error = MOD_EVENT(mod, MOD_UNLOAD); + return (error); +} + +int +module_unload(module_t mod) +{ + int error; + + mtx_lock(Giant); + error = MOD_EVENT(mod, MOD_UNLOAD); mtx_unlock(Giant); return (error); } @@ -262,6 +269,14 @@ module_getfnext(module_t mod) return (TAILQ_NEXT(mod, flink)); } +const char * +module_getname(module_t mod) +{ + + MOD_LOCK_ASSERT; + return (mod-name); +} + void module_setspecific(module_t mod, modspecific_t *datap) { Modified: stable/7/sys/sys/module.h == --- stable/7/sys/sys/module.h Wed Jan 21 18:26:10 2009(r187552) +++ stable/7/sys/sys/module.h Wed Jan 21 18:32:43 2009(r187553) @@ -141,11 +141,13 @@ void module_register_init(const void *); intmodule_register(const struct moduledata *, struct linker_file *); module_t module_lookupbyname(const char *); module_t module_lookupbyid(int); +intmodule_quiesce(module_t); void module_reference(module_t); void module_release(module_t); -intmodule_unload(module_t, int flags); +intmodule_unload(module_t); intmodule_getid(module_t); module_t module_getfnext(module_t); +const char * module_getname(module_t); void module_setspecific(module_t, modspecific_t *); struct linker_file *module_file(module_t); ___
svn commit: r187554 - in stable/7/sys: . contrib/pf dev/cxgb kern
Author: jhb Date: Wed Jan 21 18:35:48 2009 New Revision: 187554 URL: http://svn.freebsd.org/changeset/base/187554 Log: MFC: Reorder modules during initialization to ensure that MOD_QUIESCE and MOD_UNLOAD events are posted to kernel modules in the reverse order of MOD_LOAD events. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_module.c Modified: stable/7/sys/kern/kern_module.c == --- stable/7/sys/kern/kern_module.c Wed Jan 21 18:32:43 2009 (r187553) +++ stable/7/sys/kern/kern_module.c Wed Jan 21 18:35:48 2009 (r187554) @@ -130,6 +130,21 @@ module_register_init(const void *arg) printf(module_register_init: MOD_LOAD (%s, %p, %p) error %d\n, data-name, (void *)data-evhand, data-priv, error); + } else { + MOD_XLOCK; + if (mod-file) { + /* +* Once a module is succesfully loaded, move +* it to the head of the module list for this +* linker file. This resorts the list so that +* when the kernel linker iterates over the +* modules to unload them, it will unload them +* in the reverse order they were loaded. +*/ + TAILQ_REMOVE(mod-file-modules, mod, flink); + TAILQ_INSERT_HEAD(mod-file-modules, mod, flink); + } + MOD_XUNLOCK; } mtx_unlock(Giant); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187555 - in stable/7/sys: . contrib/pf dev/cxgb sys
Author: jhb Date: Wed Jan 21 18:38:12 2009 New Revision: 187555 URL: http://svn.freebsd.org/changeset/base/187555 Log: MFC: Use ints and a pointer to represent the spare fields used by the old sigevent structure rather than using a char array with explicit knowledge about padding. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/sys/aio.h Modified: stable/7/sys/sys/aio.h == --- stable/7/sys/sys/aio.h Wed Jan 21 18:35:48 2009(r187554) +++ stable/7/sys/sys/aio.h Wed Jan 21 18:38:12 2009(r187555) @@ -69,7 +69,8 @@ typedef struct aiocb { off_t aio_offset; /* File offset for I/O */ volatile void *aio_buf; /* I/O buffer in process space */ size_t aio_nbytes; /* Number of bytes for I/O */ - char__spare__[sizeof(int) * 2 + sizeof(void *)]; /* osigevent. */ + int __spare__[2]; + void*__spare2__; int aio_lio_opcode; /* LIO opcode */ int aio_reqprio;/* Request priority -- ignored */ struct __aiocb_private _aiocb_private; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187558 - releng/6.4
Author: cperciva Date: Wed Jan 21 18:47:52 2009 New Revision: 187558 URL: http://svn.freebsd.org/changeset/base/187558 Log: Fix typo: FreeBSD 6.4 is at -p3, not at -p9. Approved by: so (cperciva) Modified: releng/6.4/UPDATING Modified: releng/6.4/UPDATING == --- releng/6.4/UPDATING Wed Jan 21 18:45:39 2009(r187557) +++ releng/6.4/UPDATING Wed Jan 21 18:47:52 2009(r187558) @@ -8,7 +8,7 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. -20090113: p9 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind +20090113: p3 FreeBSD-SA-09:03.ntpd, FreeBSD-SA-09:04.bind Correct ntpd cryptographic signature bypass. [09:03] Correct BIND DNSSEC incorrect checks for malformed ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187559 - in stable/7/sys: . compat/freebsd32 contrib/pf dev/cxgb kern modules/aio
Author: jhb Date: Wed Jan 21 18:52:33 2009 New Revision: 187559 URL: http://svn.freebsd.org/changeset/base/187559 Log: MFC: Add 32-bit compat system calls for VFS_AIO. Modified: stable/7/sys/ (props changed) stable/7/sys/compat/freebsd32/syscalls.master stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_aio.c stable/7/sys/modules/aio/Makefile Modified: stable/7/sys/compat/freebsd32/syscalls.master == --- stable/7/sys/compat/freebsd32/syscalls.master Wed Jan 21 18:47:52 2009(r187558) +++ stable/7/sys/compat/freebsd32/syscalls.master Wed Jan 21 18:52:33 2009(r187559) @@ -456,9 +456,13 @@ u_int nfds, int timeout); } 253AUE_ISSETUGID NOPROTO { int issetugid(void); } 254AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } -255AUE_NULLUNIMPL nosys -256AUE_NULLUNIMPL nosys -257AUE_NULLUNIMPL nosys +255AUE_NULLNOSTD { int freebsd32_aio_read( \ + struct aiocb32 *aiocbp); } +256AUE_NULLNOSTD { int freebsd32_aio_write( \ + struct aiocb32 *aiocbp); } +257AUE_NULLNOSTD { int freebsd32_lio_listio(int mode, \ + struct aiocb32 * const *acb_list, \ + int nent, struct sigevent *sig); } 258AUE_NULLUNIMPL nosys 259AUE_NULLUNIMPL nosys 260AUE_NULLUNIMPL nosys @@ -537,13 +541,22 @@ 312AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313AUE_NULLOBSOL signanosleep -314AUE_NULLUNIMPL aio_return -315AUE_NULLUNIMPL aio_suspend -316AUE_NULLUNIMPL aio_cancel -317AUE_NULLUNIMPL aio_error -318AUE_NULLUNIMPL aio_read -319AUE_NULLUNIMPL aio_write -320AUE_NULLUNIMPL lio_listio +314AUE_NULLNOSTD { int freebsd32_aio_return( \ + struct aiocb32 *aiocbp); } +315AUE_NULLNOSTD { int freebsd32_aio_suspend( \ + struct aiocb32 * const * aiocbp, int nent, \ + const struct timespec32 *timeout); } +316AUE_NULLNOSTD { int freebsd32_aio_cancel(int fd, \ + struct aiocb32 *aiocbp); } +317AUE_NULLNOSTD { int freebsd32_aio_error( \ + struct aiocb32 *aiocbp); } +318AUE_NULLNOSTD { int freebsd32_oaio_read( \ + struct oaiocb32 *aiocbp); } +319AUE_NULLNOSTD { int freebsd32_oaio_write( \ + struct oaiocb32 *aiocbp); } +320AUE_NULLNOSTD { int freebsd32_olio_listio(int mode, \ + struct oaiocb32 * const *acb_list, \ + int nent, struct osigevent32 *sig); } 321AUE_NULLNOPROTO { int yield(void); } 322AUE_NULLOBSOL thr_sleep 323AUE_NULLOBSOL thr_wakeup @@ -620,7 +633,9 @@ 358AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \ const char *path, int attrnamespace, \ const char *attrname); } -359AUE_NULLUNIMPL aio_waitcomplete +359AUE_NULLNOSTD { int freebsd32_aio_waitcomplete( \ + struct aiocb32 **aiocbp, \ + struct timespec32 *timeout); } 360AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ uid_t *suid); } 361AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ @@ -770,7 +785,8 @@ 462AUE_NULLUNIMPL kmq_unlink 463AUE_NULLNOPROTO { int abort2(const char *why, int nargs, void **args); } 464AUE_NULLNOPROTO { int thr_set_name(long id, const char *name); } -465AUE_NULLUNIMPL aio_fsync +465AUE_NULLNOSTD { int freebsd32_aio_fsync(int op, \ + struct aiocb32 *aiocbp); } 466AUE_RTPRIO NOPROTO { int rtprio_thread(int function, \ lwpid_t lwpid, struct rtprio *rtp); } 467AUE_NULLUNIMPL nosys Modified: stable/7/sys/kern/vfs_aio.c == --- stable/7/sys/kern/vfs_aio.c Wed Jan 21 18:47:52 2009(r187558) +++ stable/7/sys/kern/vfs_aio.c Wed Jan 21 18:52:33 2009(r187559) @@ -21,6 +21,8 @@ #include sys/cdefs.h __FBSDID($FreeBSD$); +#include opt_compat.h + #include sys/param.h
svn commit: r187561 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern
Author: jhb Date: Wed Jan 21 18:54:35 2009 New Revision: 187561 URL: http://svn.freebsd.org/changeset/base/187561 Log: MFC: Add a new KTR tracepoint in the KTR_CALLOUT class to note when a callout routine finishes executing. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/kern_timeout.c Modified: stable/7/sys/kern/kern_timeout.c == --- stable/7/sys/kern/kern_timeout.cWed Jan 21 18:53:46 2009 (r187560) +++ stable/7/sys/kern/kern_timeout.cWed Jan 21 18:54:35 2009 (r187561) @@ -290,6 +290,7 @@ softclock(void *dummy) lastfunc = c_func; } #endif + CTR1(KTR_CALLOUT, callout %p finished, c); if ((c_flags CALLOUT_RETURNUNLOCKED) == 0) mtx_unlock(c_mtx); skip: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187562 - head/sys/dev/syscons/teken
Author: ed Date: Wed Jan 21 19:43:10 2009 New Revision: 187562 URL: http://svn.freebsd.org/changeset/base/187562 Log: Add Unicode rendering to the teken demo application. Some time ago I tried adding Unicode rendering to the teken demo application, but I didn't get it working. It seems I forgot to call setlocale(). Polish this code and make sure it doesn't get lost. Also a small fix for my previous commit: all Unicode characters in teken_boxdrawing are below 0x1, so store them as 16-bit values. Modified: head/sys/dev/syscons/teken/teken_demo.c head/sys/dev/syscons/teken/teken_scs.h Modified: head/sys/dev/syscons/teken/teken_demo.c == --- head/sys/dev/syscons/teken/teken_demo.c Wed Jan 21 18:54:35 2009 (r187561) +++ head/sys/dev/syscons/teken/teken_demo.c Wed Jan 21 19:43:10 2009 (r187562) @@ -31,6 +31,7 @@ #include assert.h #include errno.h #include inttypes.h +#include locale.h #include stdio.h #include stdlib.h #include unistd.h @@ -83,7 +84,8 @@ static void printchar(const teken_pos_t *p) { int y, x, attr = 0; - struct pixel *px, pt; + struct pixel *px; + char str[5] = { 0 }; assert(p-tp_row NROWS); assert(p-tp_col NCOLS); @@ -92,14 +94,26 @@ printchar(const teken_pos_t *p) px = buffer[p-tp_col][p-tp_row]; - if (px-c = 0x80) { - /* Mark UTF-8 chars (we don't support it). */ - px = pt; - px-c = '?'; - px-a.ta_format = TF_BOLD; - px-a.ta_fgcolor = TC_BROWN; - px-a.ta_bgcolor = TC_RED; + /* Convert Unicode to UTF-8. */ +#ifdef TEKEN_UTF8 + if (px-c 0x80) { + str[0] = px-c; + } else if (px-c 0x800) { + str[0] = 0xc0 | (px-c 6); + str[1] = 0x80 | (px-c 0x3f); + } else if (px-c 0x1) { + str[0] = 0xe0 | (px-c 12); + str[1] = 0x80 | ((px-c 6) 0x3f); + str[2] = 0x80 | (px-c 0x3f); + } else { + str[0] = 0xf0 | (px-c 18); + str[1] = 0x80 | ((px-c 12) 0x3f); + str[2] = 0x80 | ((px-c 6) 0x3f); + str[3] = 0x80 | (px-c 0x3f); } +#else /* !TEKEN_UTF8 */ + str[0] = px-c; +#endif /* TEKEN_UTF8 */ if (px-a.ta_format TF_BOLD) attr |= A_BOLD; @@ -109,7 +123,7 @@ printchar(const teken_pos_t *p) attr |= A_BLINK; bkgdset(attr | COLOR_PAIR(px-a.ta_fgcolor + 8 * px-a.ta_bgcolor)); - mvaddch(p-tp_row, p-tp_col, px-c); + mvaddstr(p-tp_row, p-tp_col, str); move(y, x); } @@ -272,9 +286,16 @@ main(int argc __unused, char *argv[] __u fd_set rfds; char b[256]; ssize_t bl; - const int ccolors[8] = { COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE }; + const int ccolors[8] = { + COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_YELLOW, + COLOR_BLUE, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE + }; int i, j; +#ifdef TEKEN_UTF8 + setlocale(LC_CTYPE, UTF-8); +#endif /* TEKEN_UTF8 */ + tp.tp_row = ws.ws_row = NROWS; tp.tp_col = ws.ws_col = NCOLS; Modified: head/sys/dev/syscons/teken/teken_scs.h == --- head/sys/dev/syscons/teken/teken_scs.h Wed Jan 21 18:54:35 2009 (r187561) +++ head/sys/dev/syscons/teken/teken_scs.h Wed Jan 21 19:43:10 2009 (r187562) @@ -62,7 +62,7 @@ teken_scs_process(teken_t *t, teken_char } /* Unicode points for VT100 box drawing. */ -static const teken_char_t teken_boxdrawing[31] = { +static const uint16_t teken_boxdrawing[31] = { 0x25c6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187563 - stable/7/sys/compat/freebsd32
Author: jhb Date: Wed Jan 21 20:05:12 2009 New Revision: 187563 URL: http://svn.freebsd.org/changeset/base/187563 Log: Regen. Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h stable/7/sys/compat/freebsd32/freebsd32_syscall.h stable/7/sys/compat/freebsd32/freebsd32_syscalls.c stable/7/sys/compat/freebsd32/freebsd32_sysent.c Modified: stable/7/sys/compat/freebsd32/freebsd32_proto.h == --- stable/7/sys/compat/freebsd32/freebsd32_proto.h Wed Jan 21 19:43:10 2009(r187562) +++ stable/7/sys/compat/freebsd32/freebsd32_proto.h Wed Jan 21 20:05:12 2009(r187563) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 184469 2008-10-30 13:14:45Z jhb + * created from FreeBSD: stable/7/sys/compat/freebsd32/syscalls.master 187559 2009-01-21 18:52:33Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -215,6 +215,18 @@ struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_aio_read_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_write_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_lio_listio_args { + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char acb_list_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * acb_list; char acb_list_r_[PADR_(struct aiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char sig_l_[PADL_(struct sigevent *)]; struct sigevent * sig; char sig_r_[PADR_(struct sigevent *)]; +}; struct freebsd32_lutimes_args { char path_l_[PADL_(char *)]; char * path; char path_r_[PADR_(char *)]; char tptr_l_[PADL_(struct timeval32 *)]; struct timeval32 * tptr; char tptr_r_[PADR_(struct timeval32 *)]; @@ -235,6 +247,33 @@ struct freebsd32_modstat_args { char modid_l_[PADL_(int)]; int modid; char modid_r_[PADR_(int)]; char stat_l_[PADL_(struct module_stat32 *)]; struct module_stat32 * stat; char stat_r_[PADR_(struct module_stat32 *)]; }; +struct freebsd32_aio_return_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_suspend_args { + char aiocbp_l_[PADL_(struct aiocb32 *const *)]; struct aiocb32 *const * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char timeout_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * timeout; char timeout_r_[PADR_(const struct timespec32 *)]; +}; +struct freebsd32_aio_cancel_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_aio_error_args { + char aiocbp_l_[PADL_(struct aiocb32 *)]; struct aiocb32 * aiocbp; char aiocbp_r_[PADR_(struct aiocb32 *)]; +}; +struct freebsd32_oaio_read_args { + char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; char aiocbp_r_[PADR_(struct oaiocb32 *)]; +}; +struct freebsd32_oaio_write_args { + char aiocbp_l_[PADL_(struct oaiocb32 *)]; struct oaiocb32 * aiocbp; char aiocbp_r_[PADR_(struct oaiocb32 *)]; +}; +struct freebsd32_olio_listio_args { + char mode_l_[PADL_(int)]; int mode; char mode_r_[PADR_(int)]; + char acb_list_l_[PADL_(struct oaiocb32 *const *)]; struct oaiocb32 *const * acb_list; char acb_list_r_[PADR_(struct oaiocb32 *const *)]; + char nent_l_[PADL_(int)]; int nent; char nent_r_[PADR_(int)]; + char sig_l_[PADL_(struct osigevent32 *)]; struct osigevent32 * sig; char sig_r_[PADR_(struct osigevent32 *)]; +}; struct freebsd32_sigtimedwait_args { char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; @@ -244,6 +283,10 @@ struct freebsd32_sigwaitinfo_args { char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +struct freebsd32_aio_waitcomplete_args { + char aiocbp_l_[PADL_(struct aiocb32 **)]; struct aiocb32 ** aiocbp; char aiocbp_r_[PADR_(struct aiocb32 **)]; + char timeout_l_[PADL_(struct timespec32 *)]; struct timespec32 *
svn commit: r187564 - in head/sys: kern ufs/ufs
Author: jhb Date: Wed Jan 21 20:08:17 2009 New Revision: 187564 URL: http://svn.freebsd.org/changeset/base/187564 Log: Fix a few style bogons. Submitted by: bde Modified: head/sys/kern/vfs_subr.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cWed Jan 21 20:05:12 2009(r187563) +++ head/sys/kern/vfs_subr.cWed Jan 21 20:08:17 2009(r187564) @@ -4214,7 +4214,6 @@ void vfs_mark_atime(struct vnode *vp, struct ucred *cred) { - if ((vp-v_mount-mnt_flag (MNT_NOATIME | MNT_RDONLY)) == 0) { + if ((vp-v_mount-mnt_flag (MNT_NOATIME | MNT_RDONLY)) == 0) (void)VOP_MARKATIME(vp); - } } Modified: head/sys/ufs/ufs/ufs_vnops.c == --- head/sys/ufs/ufs/ufs_vnops.cWed Jan 21 20:05:12 2009 (r187563) +++ head/sys/ufs/ufs/ufs_vnops.cWed Jan 21 20:08:17 2009 (r187564) @@ -2477,6 +2477,7 @@ struct vop_vector ufs_vnodeops = { .vop_inactive = ufs_inactive, .vop_link = ufs_link, .vop_lookup = vfs_cache_lookup, + .vop_markatime =ufs_markatime, .vop_mkdir =ufs_mkdir, .vop_mknod =ufs_mknod, .vop_open = ufs_open, @@ -2490,7 +2491,6 @@ struct vop_vector ufs_vnodeops = { .vop_rename = ufs_rename, .vop_rmdir =ufs_rmdir, .vop_setattr = ufs_setattr, - .vop_markatime =ufs_markatime, #ifdef MAC .vop_setlabel = vop_stdsetlabel_ea, #endif @@ -2517,11 +2517,11 @@ struct vop_vector ufs_fifoops = { .vop_getattr = ufs_getattr, .vop_inactive = ufs_inactive, .vop_kqfilter = ufsfifo_kqfilter, + .vop_markatime =ufs_markatime, .vop_print =ufs_print, .vop_read = VOP_PANIC, .vop_reclaim = ufs_reclaim, .vop_setattr = ufs_setattr, - .vop_markatime =ufs_markatime, #ifdef MAC .vop_setlabel = vop_stdsetlabel_ea, #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187565 - in stable/7/sys: . amd64/amd64 amd64/include contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/include
Author: jkim Date: Wed Jan 21 20:16:11 2009 New Revision: 187565 URL: http://svn.freebsd.org/changeset/base/187565 Log: MFC: Detect Advanced Power Management Information for AMD CPUs. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/amd64/initcpu.c stable/7/sys/amd64/include/md_var.h stable/7/sys/amd64/include/specialreg.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/i386/initcpu.c stable/7/sys/i386/include/md_var.h stable/7/sys/i386/include/specialreg.h Modified: stable/7/sys/amd64/amd64/identcpu.c == --- stable/7/sys/amd64/amd64/identcpu.c Wed Jan 21 20:08:17 2009 (r187564) +++ stable/7/sys/amd64/amd64/identcpu.c Wed Jan 21 20:16:11 2009 (r187565) @@ -447,6 +447,10 @@ identify_cpu(void) amd_feature = regs[3] ~(cpu_feature 0x0183f3ff); amd_feature2 = regs[2]; } + if (cpu_exthigh = 0x8007) { + do_cpuid(0x8007, regs); + amd_pminfo = regs[3]; + } if (cpu_exthigh = 0x8008) { do_cpuid(0x8008, regs); cpu_procinfo2 = regs[2]; Modified: stable/7/sys/amd64/amd64/initcpu.c == --- stable/7/sys/amd64/amd64/initcpu.c Wed Jan 21 20:08:17 2009 (r187564) +++ stable/7/sys/amd64/amd64/initcpu.c Wed Jan 21 20:16:11 2009 (r187565) @@ -53,6 +53,7 @@ u_int cpu_feature;/* Feature flags */ u_int cpu_feature2; /* Feature flags */ u_int amd_feature;/* AMD feature flags */ u_int amd_feature2; /* AMD feature flags */ +u_int amd_pminfo; /* AMD advanced power management info */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh;/* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ Modified: stable/7/sys/amd64/include/md_var.h == --- stable/7/sys/amd64/include/md_var.h Wed Jan 21 20:08:17 2009 (r187564) +++ stable/7/sys/amd64/include/md_var.h Wed Jan 21 20:16:11 2009 (r187565) @@ -44,6 +44,7 @@ externu_int cpu_feature; extern u_int cpu_feature2; extern u_int amd_feature; extern u_int amd_feature2; +extern u_int amd_pminfo; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: stable/7/sys/amd64/include/specialreg.h == --- stable/7/sys/amd64/include/specialreg.h Wed Jan 21 20:08:17 2009 (r187564) +++ stable/7/sys/amd64/include/specialreg.h Wed Jan 21 20:16:11 2009 (r187565) @@ -156,6 +156,19 @@ #defineCPUID_LOCAL_APIC_ID 0xff00 /* + * AMD extended function 8000_0007h edx info + */ +#defineAMDPM_TS0x0001 +#defineAMDPM_FID 0x0002 +#defineAMDPM_VID 0x0004 +#defineAMDPM_TTP 0x0008 +#defineAMDPM_TM0x0010 +#defineAMDPM_STC 0x0020 +#defineAMDPM_100MHZ_STEPS 0x0040 +#defineAMDPM_HW_PSTATE 0x0080 +#defineAMDPM_TSC_INVARIANT 0x0100 + +/* * AMD extended function 8000_0008h ecx info */ #defineAMDID_CMP_CORES 0x00ff Modified: stable/7/sys/i386/i386/identcpu.c == --- stable/7/sys/i386/i386/identcpu.c Wed Jan 21 20:08:17 2009 (r187564) +++ stable/7/sys/i386/i386/identcpu.c Wed Jan 21 20:16:11 2009 (r187565) @@ -1088,6 +1088,10 @@ finishidentcpu(void) amd_feature = regs[3] ~(cpu_feature 0x0183f3ff); amd_feature2 = regs[2]; } + if (cpu_exthigh = 0x8007) { + do_cpuid(0x8007, regs); + amd_pminfo = regs[3]; + } if (cpu_exthigh = 0x8008) { do_cpuid(0x8008, regs); cpu_procinfo2 = regs[2]; Modified: stable/7/sys/i386/i386/initcpu.c == --- stable/7/sys/i386/i386/initcpu.cWed Jan 21 20:08:17 2009 (r187564) +++ stable/7/sys/i386/i386/initcpu.cWed Jan 21 20:16:11 2009 (r187565) @@ -82,6 +82,7 @@ u_int cpu_feature = 0;/* Feature flags u_int cpu_feature2 = 0; /* Feature flags */ u_int amd_feature = 0;/* AMD feature flags */ u_int amd_feature2 = 0; /* AMD feature
svn commit: r187566 - head/sys/contrib/altq/altq
Author: jkim Date: Wed Jan 21 20:44:42 2009 New Revision: 187566 URL: http://svn.freebsd.org/changeset/base/187566 Log: Change __FreeBSD_version to prepare for merging r184102. Modified: head/sys/contrib/altq/altq/altq_subr.c Modified: head/sys/contrib/altq/altq/altq_subr.c == --- head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:16:11 2009 (r187565) +++ head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:44:42 2009 (r187566) @@ -910,7 +910,7 @@ tsc_freq_changed(void *arg, const struct if (status != 0) return; -#if (__FreeBSD_version = 800050) (defined(__amd64__) || defined(__i386__)) +#if (__FreeBSD_version = 701102) (defined(__amd64__) || defined(__i386__)) /* If TSC is P-state invariant, don't do anything. */ if (tsc_is_invariant) return; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187567 - in stable/7/sys: . amd64/amd64 amd64/include contrib/altq/altq contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/include i386/isa
Author: jkim Date: Wed Jan 21 20:53:36 2009 New Revision: 187567 URL: http://svn.freebsd.org/changeset/base/187567 Log: MFC: Turn off CPU frequency change notifiers when the TSC is P-state invariant or it is forced by setting 'kern.timecounter.invariant_tsc' tunable to non-zero. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/amd64/prof_machdep.c stable/7/sys/amd64/amd64/tsc.c stable/7/sys/amd64/include/clock.h stable/7/sys/contrib/altq/altq/altq_subr.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/i386/tsc.c stable/7/sys/i386/include/clock.h stable/7/sys/i386/isa/prof_machdep.c Modified: stable/7/sys/amd64/amd64/identcpu.c == --- stable/7/sys/amd64/amd64/identcpu.c Wed Jan 21 20:44:42 2009 (r187566) +++ stable/7/sys/amd64/amd64/identcpu.c Wed Jan 21 20:53:36 2009 (r187567) @@ -345,6 +345,12 @@ printcpuinfo(void) AuthenticAMD) == 0) cpu_feature = ~CPUID_HTT; + if (!tsc_is_invariant + (amd_pminfo AMDPM_TSC_INVARIANT)) { + tsc_is_invariant = 1; + printf(\n P-state invariant TSC); + } + /* * If this CPU supports HTT or CMP then mention the * number of physical/logical cores it contains. @@ -405,8 +411,11 @@ panicifcpuunsupported(void) static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* +* If there was an error during the transition or +* TSC is P-state invariant, don't do anything. +*/ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: stable/7/sys/amd64/amd64/prof_machdep.c == --- stable/7/sys/amd64/amd64/prof_machdep.c Wed Jan 21 20:44:42 2009 (r187566) +++ stable/7/sys/amd64/amd64/prof_machdep.c Wed Jan 21 20:53:36 2009 (r187567) @@ -387,8 +387,11 @@ static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* +* If there was an error during the transition or +* TSC is P-state invariant, don't do anything. +*/ + if (status != 0 || tsc_is_invariant) return; if (cputime_prof_active cputime_clock == CPUTIME_CLOCK_TSC) printf(warning: cpu freq changed while profiling active\n); Modified: stable/7/sys/amd64/amd64/tsc.c == --- stable/7/sys/amd64/amd64/tsc.c Wed Jan 21 20:44:42 2009 (r187566) +++ stable/7/sys/amd64/amd64/tsc.c Wed Jan 21 20:53:36 2009 (r187567) @@ -53,8 +53,13 @@ __FBSDID($FreeBSD$); uint64_t tsc_freq; inttsc_is_broken; +inttsc_is_invariant; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; +SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, +tsc_is_invariant, 0, Indicates whether the TSC is P-state invariant); +TUNABLE_INT(kern.timecounter.invariant_tsc, tsc_is_invariant); + #ifdef SMP static int smp_tsc; SYSCTL_INT(_kern_timecounter, OID_AUTO, smp_tsc, CTLFLAG_RDTUN, smp_tsc, 0, @@ -179,11 +184,12 @@ static void tsc_freq_changing(void *arg, const struct cf_level *level, int *status) { - if (*status != 0 || timecounter != tsc_timecounter) + if (*status != 0 || timecounter != tsc_timecounter || + tsc_is_invariant) return; printf(timecounter TSC must not be in use when -changing frequencies; change denied\n); + changing frequencies; change denied\n); *status = EBUSY; } @@ -191,8 +197,11 @@ tsc_freq_changing(void *arg, const struc static void tsc_freq_changed(void *arg, const struct cf_level *level, int status) { - /* If there was an error during the transition, don't do anything. */ - if (status != 0) + /* +* If there was an error during the transition or +* TSC is P-state invariant, don't do anything. +*/ + if (status != 0 || tsc_is_invariant) return; /* Total setting for this level gives the new frequency in MHz. */ Modified: stable/7/sys/amd64/include/clock.h
svn commit: r187568 - head/sys/dev/usb
Author: joerg Date: Wed Jan 21 20:57:28 2009 New Revision: 187568 URL: http://svn.freebsd.org/changeset/base/187568 Log: Add the dresden elektronik SensorTerminalBoard which uses an FT245. Modified: head/sys/dev/usb/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/uftdi.c == --- head/sys/dev/usb/uftdi.cWed Jan 21 20:53:36 2009(r187567) +++ head/sys/dev/usb/uftdi.cWed Jan 21 20:57:28 2009(r187568) @@ -186,6 +186,9 @@ uftdi_match(device_t self) if (uaa-vendor == USB_VENDOR_MELCO (uaa-product == USB_PRODUCT_MELCO_PCOPRS1)) return (UMATCH_VENDOR_PRODUCT); + if (uaa-vendor == USB_VENDOR_DRESDENELEKTRONIK + (uaa-product == USB_PRODUCT_DRESDENELEKTRONIK_SENSORTERMINALBOARD)) + return (UMATCH_VENDOR_PRODUCT); return (UMATCH_NONE); } @@ -316,6 +319,18 @@ uftdi_attach(device_t self) } break; + case USB_VENDOR_DRESDENELEKTRONIK: + switch( uaa-product ){ + case USB_PRODUCT_DRESDENELEKTRONIK_SENSORTERMINALBOARD: + sc-sc_type = UFTDI_TYPE_8U232AM; + sc-sc_hdrlen = 0; + break; + + default:/* Can't happen */ + goto bad; + } + break; + default:/* Can't happen */ goto bad; } Modified: head/sys/dev/usb/usbdevs == --- head/sys/dev/usb/usbdevsWed Jan 21 20:53:36 2009(r187567) +++ head/sys/dev/usb/usbdevsWed Jan 21 20:57:28 2009(r187568) @@ -623,6 +623,7 @@ vendor QCOM 0x18e8 Qcom vendor LINKSYS30x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor STELERA 0x1a8d Stelera Wireless +vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor ERICSSON0x2282 Ericsson @@ -1169,6 +1170,9 @@ product DMI CFSM_RW 0xa109 CF/SM Reader /* DrayTek products */ product DRAYTEK VIGOR550 0x0550 Vigor550 +/* dresden elektronik products */ +product DRESDENELEKTRONIK SENSORTERMINALBOARD 0x0001 SensorTerminalBoard + /* Dynastream Innovations */ product DYNASTREAM ANTDEVBOARD 0x1003 ANT dev board ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187569 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb i386/cpufreq
Author: jkim Date: Wed Jan 21 20:57:54 2009 New Revision: 187569 URL: http://svn.freebsd.org/changeset/base/187569 Log: MFC: Use power management information for AMD CPUs from identcpu.c. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/cpufreq/powernow.c Modified: stable/7/sys/i386/cpufreq/powernow.c == --- stable/7/sys/i386/cpufreq/powernow.cWed Jan 21 20:57:28 2009 (r187568) +++ stable/7/sys/i386/cpufreq/powernow.cWed Jan 21 20:57:54 2009 (r187569) @@ -758,22 +758,6 @@ pn_decode_pst(device_t dev) return (ENODEV); } -/* - * TODO: this should be done in sys/ARCH/ARCH/identcpu.c - */ -static int -cpu_is_powernow_capable(void) -{ - u_int regs[4]; - - if (strcmp(cpu_vendor, AuthenticAMD) != 0 || - cpu_exthigh 0x8007) - return (FALSE); - - do_cpuid(0x8007, regs); - return (regs[3] 0x6); -} - static int pn_decode_acpi(device_t dev, device_t perf_dev) { @@ -883,7 +867,7 @@ pn_identify(driver_t *driver, device_t p { device_t child; - if (cpu_is_powernow_capable() == 0) + if ((amd_pminfo (AMDPM_FID | AMDPM_VID)) == 0) return; switch (cpu_id 0xf00) { case 0x600: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187570 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb i386/cpufreq
Author: jkim Date: Wed Jan 21 21:01:02 2009 New Revision: 187570 URL: http://svn.freebsd.org/changeset/base/187570 Log: MFC: Do not use PowerNow! if FID or VID is missing. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/cpufreq/powernow.c Modified: stable/7/sys/i386/cpufreq/powernow.c == --- stable/7/sys/i386/cpufreq/powernow.cWed Jan 21 20:57:54 2009 (r187569) +++ stable/7/sys/i386/cpufreq/powernow.cWed Jan 21 21:01:02 2009 (r187570) @@ -867,7 +867,7 @@ pn_identify(driver_t *driver, device_t p { device_t child; - if ((amd_pminfo (AMDPM_FID | AMDPM_VID)) == 0) + if ((amd_pminfo AMDPM_FID) == 0 || (amd_pminfo AMDPM_VID) == 0) return; switch (cpu_id 0xf00) { case 0x600: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187572 - in stable/7/sys: . amd64/amd64 amd64/include contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 i386/include
Author: jkim Date: Wed Jan 21 21:28:21 2009 New Revision: 187572 URL: http://svn.freebsd.org/changeset/base/187572 Log: MFC: Set tsc_is_invariant for some known AMD CPUs even if BIOS does not advertise it. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/include/specialreg.h stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/include/specialreg.h Modified: stable/7/sys/amd64/amd64/identcpu.c == --- stable/7/sys/amd64/amd64/identcpu.c Wed Jan 21 21:24:36 2009 (r187571) +++ stable/7/sys/amd64/amd64/identcpu.c Wed Jan 21 21:28:21 2009 (r187572) @@ -345,10 +345,17 @@ printcpuinfo(void) AuthenticAMD) == 0) cpu_feature = ~CPUID_HTT; + /* +* If this CPU supports P-state invariant TSC then +* mention the capability. +*/ if (!tsc_is_invariant - (amd_pminfo AMDPM_TSC_INVARIANT)) { + (strcmp(cpu_vendor, AuthenticAMD) == 0 + ((amd_pminfo AMDPM_TSC_INVARIANT) != 0 || + AMD64_CPU_FAMILY(cpu_id) = 0x10 || + cpu_id == 0x60fb2))) { tsc_is_invariant = 1; - printf(\n P-state invariant TSC); + printf(\n TSC: P-state invariant); } /* Modified: stable/7/sys/amd64/include/specialreg.h == --- stable/7/sys/amd64/include/specialreg.h Wed Jan 21 21:24:36 2009 (r187571) +++ stable/7/sys/amd64/include/specialreg.h Wed Jan 21 21:28:21 2009 (r187572) @@ -148,6 +148,21 @@ #defineAMDID2_PREFETCH 0x0100 /* + * CPUID instruction 1 eax info + */ +#defineCPUID_STEPPING 0x000f +#defineCPUID_MODEL 0x00f0 +#defineCPUID_FAMILY0x0f00 +#defineCPUID_EXT_MODEL 0x000f +#defineCPUID_EXT_FAMILY0x0ff0 +#defineAMD64_CPU_MODEL(id) \ +id) CPUID_MODEL) 4) | \ +(((id) CPUID_EXT_MODEL) 12)) +#defineAMD64_CPU_FAMILY(id) \ +id) CPUID_FAMILY) 8) + \ +(((id) CPUID_EXT_FAMILY) 20)) + +/* * CPUID instruction 1 ebx info */ #defineCPUID_BRAND_INDEX 0x00ff Modified: stable/7/sys/i386/i386/identcpu.c == --- stable/7/sys/i386/i386/identcpu.c Wed Jan 21 21:24:36 2009 (r187571) +++ stable/7/sys/i386/i386/identcpu.c Wed Jan 21 21:28:21 2009 (r187572) @@ -842,10 +842,17 @@ printcpuinfo(void) AuthenticAMD) == 0) cpu_feature = ~CPUID_HTT; + /* +* If this CPU supports P-state invariant TSC then +* mention the capability. +*/ if (!tsc_is_invariant - (amd_pminfo AMDPM_TSC_INVARIANT)) { + (strcmp(cpu_vendor, AuthenticAMD) == 0 + ((amd_pminfo AMDPM_TSC_INVARIANT) != 0 || + I386_CPU_FAMILY(cpu_id) = 0x10 || + cpu_id == 0x60fb2))) { tsc_is_invariant = 1; - printf(\n P-state invariant TSC); + printf(\n TSC: P-state invariant); } /* Modified: stable/7/sys/i386/include/specialreg.h == --- stable/7/sys/i386/include/specialreg.h Wed Jan 21 21:24:36 2009 (r187571) +++ stable/7/sys/i386/include/specialreg.h Wed Jan 21 21:28:21 2009 (r187572) @@ -150,6 +150,23 @@ #defineAMDID2_PREFETCH 0x0100 /* + * CPUID instruction 1 eax info + */ +#defineCPUID_STEPPING 0x000f +#defineCPUID_MODEL 0x00f0 +#defineCPUID_FAMILY0x0f00 +#defineCPUID_EXT_MODEL 0x000f +#defineCPUID_EXT_FAMILY0x0ff0 +#defineI386_CPU_MODEL(id) \ +id) CPUID_MODEL) 4) | \ +id) CPUID_FAMILY) = 0x600) ? \ +(((id) CPUID_EXT_MODEL) 12) : 0)) +#defineI386_CPU_FAMILY(id) \ +id) CPUID_FAMILY) 8) + \ +id) CPUID_FAMILY) == 0xf00) ? \ +(((id) CPUID_EXT_FAMILY) 20) : 0)) + +/* *
svn commit: r187573 - head/share/man/man7
Author: tabthorpe (ports committer) Date: Wed Jan 21 21:29:00 2009 New Revision: 187573 URL: http://svn.freebsd.org/changeset/base/187573 Log: - Document targets run-depends-list and build-depends-list PR: docs/127575 Submitted by: Walter Venable walt relnor.com Approved by: keramida MFC after:3 days Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 == --- head/share/man/man7/ports.7 Wed Jan 21 21:28:21 2009(r187572) +++ head/share/man/man7/ports.7 Wed Jan 21 21:29:00 2009(r187573) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 22, 2008 +.Dd January 21, 2009 .Dt PORTS 7 .Os .Sh NAME @@ -196,11 +196,14 @@ Fetch the distfiles of the port and all .It Cm fetch-recursive-list Show list of files that would be retrieved by .Cm fetch-recursive . +.It Cm run-depends-list , build-depends-list +Print a list of all the compile and run dependencies, and dependencies +of those dependencies, by port directory. .It Cm all-depends-list Print a list of all dependencies for the port. .It Cm pretty-print-run-depends-list , pretty-print-build-depends-list Print a list of all the compile and run dependencies, and dependencies -of those dependencies. +of those dependencies, by port name and version. .It Cm missing Print a list of missing dependencies to be installed for the port. .It Cm clean @@ -251,6 +254,8 @@ and Like .Cm package , but makes a package for each depending port as well. +.It Cm package-name +Prints the name with version of the port. .It Cm readmes Create a port's .Pa README.html . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187574 - in stable/7/sys: . contrib/pf dev/acpica dev/ath/ath_hal dev/cxgb
Author: jkim Date: Wed Jan 21 21:31:44 2009 New Revision: 187574 URL: http://svn.freebsd.org/changeset/base/187574 Log: MFC: Make sure legacy replacement route is turned off when enbling HPET. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/acpica/acpi_hpet.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/dev/acpica/acpi_hpet.c == --- stable/7/sys/dev/acpica/acpi_hpet.c Wed Jan 21 21:29:00 2009 (r187573) +++ stable/7/sys/dev/acpica/acpi_hpet.c Wed Jan 21 21:31:44 2009 (r187574) @@ -83,7 +83,9 @@ hpet_enable(struct acpi_hpet_softc *sc) uint32_t val; val = bus_read_4(sc-mem_res, HPET_CONFIG); - bus_write_4(sc-mem_res, HPET_CONFIG, val | HPET_CNF_ENABLE); + val = ~HPET_CNF_LEG_RT; + val |= HPET_CNF_ENABLE; + bus_write_4(sc-mem_res, HPET_CONFIG, val); } static void @@ -92,7 +94,8 @@ hpet_disable(struct acpi_hpet_softc *sc) uint32_t val; val = bus_read_4(sc-mem_res, HPET_CONFIG); - bus_write_4(sc-mem_res, HPET_CONFIG, val ~HPET_CNF_ENABLE); + val = ~HPET_CNF_ENABLE; + bus_write_4(sc-mem_res, HPET_CONFIG, val); } /* Discover the HPET via the ACPI table of the same name. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187575 - stable/6/sys/kern
Author: jhb Date: Wed Jan 21 21:48:46 2009 New Revision: 187575 URL: http://svn.freebsd.org/changeset/base/187575 Log: Fix build. Pointy hat to:jhb Modified: stable/6/sys/kern/vfs_syscalls.c Modified: stable/6/sys/kern/vfs_syscalls.c == --- stable/6/sys/kern/vfs_syscalls.cWed Jan 21 21:31:44 2009 (r187574) +++ stable/6/sys/kern/vfs_syscalls.cWed Jan 21 21:48:46 2009 (r187575) @@ -3712,7 +3712,7 @@ kern_getdirentries(struct thread *td, in int error, eofflag; AUDIT_ARG(fd, fd); - if (uap-count INT_MAX) + if (count INT_MAX) return (EINVAL); if ((error = getvnode(td-td_proc-p_fd, fd, fp)) != 0) return (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r187566 - head/sys/contrib/altq/altq
On Wed, 21 Jan 2009, Jung-uk Kim wrote: Author: jkim Date: Wed Jan 21 20:44:42 2009 New Revision: 187566 URL: http://svn.freebsd.org/changeset/base/187566 Log: Change __FreeBSD_version to prepare for merging r184102. Modified: head/sys/contrib/altq/altq/altq_subr.c Modified: head/sys/contrib/altq/altq/altq_subr.c == --- head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:16:11 2009 (r187565) +++ head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:44:42 2009 (r187566) @@ -910,7 +910,7 @@ tsc_freq_changed(void *arg, const struct if (status != 0) return; -#if (__FreeBSD_version = 800050) (defined(__amd64__) || defined(__i386__)) +#if (__FreeBSD_version = 701102) (defined(__amd64__) || defined(__i386__)) /* If TSC is P-state invariant, don't do anything. */ if (tsc_is_invariant) return; Doesn't that leave a gap now for 80 to 800050? -- Bjoern A. Zeeb The greatest risk is not taking one. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r187566 - head/sys/contrib/altq/altq
On Wednesday 21 January 2009 05:00 pm, Bjoern A. Zeeb wrote: On Wed, 21 Jan 2009, Jung-uk Kim wrote: Author: jkim Date: Wed Jan 21 20:44:42 2009 New Revision: 187566 URL: http://svn.freebsd.org/changeset/base/187566 Log: Change __FreeBSD_version to prepare for merging r184102. Modified: head/sys/contrib/altq/altq/altq_subr.c Modified: head/sys/contrib/altq/altq/altq_subr.c = = --- head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:16:11 2009(r187565) +++ head/sys/contrib/altq/altq/altq_subr.c Wed Jan 21 20:44:42 2009(r187566) @@ -910,7 +910,7 @@ tsc_freq_changed(void *arg, const struct if (status != 0) return; -#if (__FreeBSD_version = 800050) (defined(__amd64__) || defined(__i386__)) +#if (__FreeBSD_version = 701102) (defined(__amd64__) || defined(__i386__)) /* If TSC is P-state invariant, don't do anything. */ if (tsc_is_invariant) return; Doesn't that leave a gap now for 80 to 800050? Don't we have -CURRENT has no seat belt policy? Jung-uk Kim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187576 - in head/sys/dev: ppbus ppc
Author: jhb Date: Wed Jan 21 23:10:06 2009 New Revision: 187576 URL: http://svn.freebsd.org/changeset/base/187576 Log: Add locking to ppc and ppbus and mark the whole lot MPSAFE: - To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with all the child devices including ppbus(4), lpt(4), plip(4), etc. This mutex is then used for all the locking. - Rework the interrupt handling stuff yet again. Now ppbus drivers setup their interrupt handler during attach and tear it down during detach like most other drivers. ppbus(4) only invokes the interrupt handler of the device that currently owns the bus (if any) when an interrupt occurs, however. Also, interrupt handlers in general now accept their softc pointers as their argument rather than the device_t. Another feature of the ppbus interrupt handlers is that they are called with the parent ppc device's lock already held. This minimizes the number of lock operations during an interrupt. - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE. - lpbb(4) uses the ppc lock instead of Giant. - Other plip(4) changes: - Add a mutex to protect the global tables in plip(4) and free them on module unload. - Add a detach routine. - Split out the init/stop code from the ioctl routine into separate functions. - Other lpt(4) changes: - Use device_printf(). - Use a dedicated callout for the lptout timer. - Allocate the I/O buffers at attach and detach rather than during open and close as this simplifies the locking at the cost of 1024+32 bytes when the driver is attached. - Other ppi(4) changes: - Use an sx lock to serialize open and close. - Remove unused HADBUS flag. - Add a detach routine. - Use a malloc'd buffer for each read and write to avoid races with concurrent read/write. - Other pps(4) changes: - Use a callout rather than a callout handle with timeout(). - Conform to the new ppbus requirements (regular mutex, non-filter interrupt handler). pps(4) is probably going to have to become a standalone driver that doesn't use ppbus(4) to satisfy it's requirements for low latency as a result. - Use an sx lock to serialize open and close. - Other vpo(4) changes: - Use the parent ppc device's lock to create the CAM sim instead of Giant. - Other ppc(4) changes: - Fix ppc_isa's detach method to detach instead of calling attach. Tested by: no one :-( Modified: head/sys/dev/ppbus/if_plip.c head/sys/dev/ppbus/immio.c head/sys/dev/ppbus/lpbb.c head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/pcfclock.c head/sys/dev/ppbus/ppb_1284.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppb_msq.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppbus/ppbconf.h head/sys/dev/ppbus/ppi.c head/sys/dev/ppbus/pps.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/ppc/ppc.c head/sys/dev/ppc/ppc_acpi.c head/sys/dev/ppc/ppc_isa.c head/sys/dev/ppc/ppc_pci.c head/sys/dev/ppc/ppc_puc.c head/sys/dev/ppc/ppcreg.h head/sys/dev/ppc/ppcvar.h Modified: head/sys/dev/ppbus/if_plip.c == --- head/sys/dev/ppbus/if_plip.cWed Jan 21 21:48:46 2009 (r187575) +++ head/sys/dev/ppbus/if_plip.cWed Jan 21 23:10:06 2009 (r187576) @@ -152,8 +152,12 @@ struct lp_data { int sc_iferrs; struct resource *res_irq; + void*sc_intr_cookie; }; +static struct mtx lp_tables_lock; +MTX_SYSINIT(lp_tables, lp_tables_lock, plip tables, MTX_DEF); + /* Tables for the lp# interface */ static u_char *txmith; #definetxmitl (txmith + (1 * LPIPTBLSIZE)) @@ -170,13 +174,41 @@ static int lpinittables(void); static int lpioctl(struct ifnet *, u_long, caddr_t); static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); +static void lpstop(struct lp_data *); static void lp_intr(void *); +static int lp_module_handler(module_t, int, void *); #defineDEVTOSOFTC(dev) \ ((struct lp_data *)device_get_softc(dev)) static devclass_t lp_devclass; +static int +lp_module_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_UNLOAD: + mtx_lock(lp_tables_lock); + if (txmith != NULL) { + free(txmith, M_DEVBUF); + txmith = NULL; + } + if (ctxmith != NULL) { + free(ctxmith, M_DEVBUF); + ctxmith = NULL; + } + mtx_unlock(lp_tables_lock); + break; + case MOD_LOAD: + case MOD_QUIESCE: + break; + default: + return (EOPNOTSUPP); + } + return (0); +} +
svn commit: r187577 - stable/7/sys/dev/usb
Author: n_hibma Date: Wed Jan 21 23:10:43 2009 New Revision: 187577 URL: http://svn.freebsd.org/changeset/base/187577 Log: Sync this file with HEAD r183874. - Remove a redundant MOD_LOAD function - Reduce the attach priority for the attach function to give other drivers, like the to be committed u3g driver a better chance at attaching to the 3G devices with a ZeroCD / TruInstall mass storage device. Modified: stable/7/sys/dev/usb/umass.c Modified: stable/7/sys/dev/usb/umass.c == --- stable/7/sys/dev/usb/umass.cWed Jan 21 23:10:06 2009 (r187576) +++ stable/7/sys/dev/usb/umass.cWed Jan 21 23:10:43 2009 (r187577) @@ -574,6 +574,10 @@ static struct umass_devdescr_t umass_dev UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY }, + { USB_VENDOR_NETAC, USB_PRODUCT_NETAC_ONLYDISK, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + IGNORE_RESIDUE + }, { USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_CLIK_40, RID_WILDCARD, UMASS_PROTO_ATAPI, NO_INQUIRY @@ -606,6 +610,10 @@ static struct umass_devdescr_t umass_dev UMASS_PROTO_SCSI, NO_QUIRKS }, + { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_SDS_HOTFIND_D, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_GETMAXLUN | NO_SYNCHRONIZE_CACHE + }, { USB_VENDOR_ONSPEC, USB_PRODUCT_ONSPEC_MDCFE_B_CF_READER, RID_WILDCARD, UMASS_PROTO_SCSI, NO_QUIRKS @@ -1264,7 +1272,7 @@ umass_match_proto(struct umass_softc *sc return(UMATCH_NONE); } - return(UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO); + return(UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO); } static int @@ -1276,6 +1284,7 @@ umass_match(device_t self) sc-sc_dev = self; if (uaa-iface == NULL) return(UMATCH_NONE); + return(umass_match_proto(sc, uaa-iface, uaa-device)); } @@ -3276,17 +3285,6 @@ umass_cam_quirk_cb(struct umass_softc *s xpt_done(ccb); } -static int -umass_driver_load(module_t mod, int what, void *arg) -{ - switch (what) { - case MOD_UNLOAD: - case MOD_LOAD: - default: - return(usbd_driver_load(mod, what, arg)); - } -} - /* * SCSI specific functions */ @@ -3526,7 +3524,7 @@ umass_atapi_transform(struct umass_softc /* (even the comment is missing) */ -DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, umass_driver_load, 0); +DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, usbd_driver_load, 0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187579 - head/sys/dev/usb2/serial
Author: takawata Date: Thu Jan 22 05:05:56 2009 New Revision: 187579 URL: http://svn.freebsd.org/changeset/base/187579 Log: Rename sc_is_pseudo to sc_nobulk member in ufoma_softc. That was pseudo ucom because it used home brew tty interface. Now, it is integrated to usb serial framework, so it is not pseudo ucom any more. Modified: head/sys/dev/usb2/serial/ufoma2.c Modified: head/sys/dev/usb2/serial/ufoma2.c == --- head/sys/dev/usb2/serial/ufoma2.c Thu Jan 22 04:24:15 2009 (r187578) +++ head/sys/dev/usb2/serial/ufoma2.c Thu Jan 22 05:05:56 2009 (r187579) @@ -175,7 +175,7 @@ struct ufoma_softc { uint16_t sc_line; uint8_t sc_num_msg; - uint8_t sc_is_pseudo; + uint8_t sc_nobulk; uint8_t sc_ctrl_iface_no; uint8_t sc_ctrl_iface_index; uint8_t sc_data_iface_no; @@ -449,9 +449,9 @@ ufoma_attach(device_t dev) } if ((mad-bType == UMCPC_ACM_TYPE_AB5) || (mad-bType == UMCPC_ACM_TYPE_AB6)) { - sc-sc_is_pseudo = 1; + sc-sc_nobulk = 1; } else { - sc-sc_is_pseudo = 0; + sc-sc_nobulk = 0; if (ufoma_modem_setup(dev, sc, uaa)) { goto detach; } @@ -764,7 +764,7 @@ ufoma_intr_callback(struct usb2_xfer *xf } switch (pkt.bNotification) { case UCDC_N_RESPONSE_AVAILABLE: - if (!(sc-sc_is_pseudo)) { + if (!(sc-sc_nobulk)) { DPRINTF(Wrong serial state!\n); break; } @@ -775,7 +775,7 @@ ufoma_intr_callback(struct usb2_xfer *xf break; case UCDC_N_SERIAL_STATE: - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { DPRINTF(Wrong serial state!\n); break; } @@ -952,7 +952,7 @@ ufoma_cfg_set_break(struct usb2_com_soft struct usb2_device_request req; uint16_t wValue; - if (sc-sc_is_pseudo || + if (sc-sc_nobulk || (sc-sc_currentmode == UMCPC_ACM_MODE_OBEX)) { return; } @@ -1004,7 +1004,7 @@ ufoma_cfg_set_dtr(struct usb2_com_softc { struct ufoma_softc *sc = ucom-sc_parent; - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { return; } if (onoff) @@ -1020,7 +1020,7 @@ ufoma_cfg_set_rts(struct usb2_com_softc { struct ufoma_softc *sc = ucom-sc_parent; - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { return; } if (onoff) @@ -1044,7 +1044,7 @@ ufoma_cfg_param(struct usb2_com_softc *u struct usb2_device_request req; struct usb2_cdc_line_state ls; - if (sc-sc_is_pseudo || + if (sc-sc_nobulk || (sc-sc_currentmode == UMCPC_ACM_MODE_OBEX)) { return; } @@ -1175,7 +1175,7 @@ ufoma_start_read(struct usb2_com_softc * usb2_transfer_start(sc-sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR]); /* start data transfer */ - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { usb2_transfer_start(sc-sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); } else { usb2_transfer_start(sc-sc_bulk_xfer[UFOMA_BULK_ENDPT_READ]); @@ -1192,7 +1192,7 @@ ufoma_stop_read(struct usb2_com_softc *u usb2_transfer_stop(sc-sc_ctrl_xfer[UFOMA_CTRL_ENDPT_INTR_CLEAR]); /* stop data transfer */ - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { usb2_transfer_stop(sc-sc_ctrl_xfer[UFOMA_CTRL_ENDPT_READ]); } else { usb2_transfer_stop(sc-sc_bulk_xfer[UFOMA_BULK_ENDPT_READ_CLEAR]); @@ -1205,7 +1205,7 @@ ufoma_start_write(struct usb2_com_softc { struct ufoma_softc *sc = ucom-sc_parent; - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { usb2_transfer_start(sc-sc_ctrl_xfer[UFOMA_CTRL_ENDPT_WRITE]); } else { usb2_transfer_start(sc-sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE]); @@ -1217,7 +1217,7 @@ ufoma_stop_write(struct usb2_com_softc * { struct ufoma_softc *sc = ucom-sc_parent; - if (sc-sc_is_pseudo) { + if (sc-sc_nobulk) { usb2_transfer_stop(sc-sc_ctrl_xfer[UFOMA_CTRL_ENDPT_WRITE]); } else { usb2_transfer_stop(sc-sc_bulk_xfer[UFOMA_BULK_ENDPT_WRITE_CLEAR]); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r187580 - head/tools/sched
Author: jeff Date: Thu Jan 22 06:21:30 2009 New Revision: 187580 URL: http://svn.freebsd.org/changeset/base/187580 Log: - Update my copyright. - Print human readable time as a float with two digits of precision. Use ns now as well since clock periods are well into the hundreds of picoseconds now. - Show the average duration in the stats frame. This is often more useful than total duration. Modified: head/tools/sched/schedgraph.py Modified: head/tools/sched/schedgraph.py == --- head/tools/sched/schedgraph.py Thu Jan 22 05:05:56 2009 (r187579) +++ head/tools/sched/schedgraph.py Thu Jan 22 06:21:30 2009 (r187580) @@ -1,6 +1,6 @@ #!/usr/local/bin/python -# Copyright (c) 2002-2003, Jeffrey Roberson j...@freebsd.org +# Copyright (c) 2002-2003, 2009, Jeffrey Roberson j...@freebsd.org # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -149,15 +149,19 @@ class Colormap: return (color) def ticks2sec(ticks): - us = ticksps / 100 - ticks /= us + ticks = float(ticks) + ns = float(ticksps) / 10 + ticks /= ns if (ticks 1000): - return (str(ticks) + us) + return (%.2fns % ticks) ticks /= 1000 if (ticks 1000): - return (str(ticks) + ms) + return (%.2fus % ticks) ticks /= 1000 - return (str(ticks) + s) + if (ticks 1000): + return (%.2fms % ticks) + ticks /= 1000 + return (%.2fs % ticks) class Scaler(Frame): def __init__(self, master, target): @@ -443,7 +447,7 @@ class SourceStats(Toplevel): self.resizable(0, 0) self.title(source.name + statistics) self.evframe = LabelFrame(self, - text=Event Frequency and Duration) + text=Event Count, Duration, Avg Duration) self.evframe.grid(row=0, column=0, sticky=E+W) eventtypes={} for event in self.source.events: @@ -466,15 +470,22 @@ class SourceStats(Toplevel): ypos = 0 for event in events: (name, c, d) = event - l = Label(self.evframe, text=name, bd=1, - relief=SUNKEN, anchor=W, width=30) - m = Label(self.evframe, text=str(c), bd=1, - relief=SUNKEN, anchor=W, width=10) - r = Label(self.evframe, text=ticks2sec(d), - bd=1, relief=SUNKEN, width=10) - l.grid(row=ypos, column=0, sticky=E+W) - m.grid(row=ypos, column=1, sticky=E+W) - r.grid(row=ypos, column=2, sticky=E+W) + Label(self.evframe, text=name, bd=1, + relief=SUNKEN, anchor=W, width=30).grid( + row=ypos, column=0, sticky=W+E) + Label(self.evframe, text=str(c), bd=1, + relief=SUNKEN, anchor=W, width=10).grid( + row=ypos, column=1, sticky=W+E) + Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10).grid( + row=ypos, column=2, sticky=W+E) + if (d and c): + d /= c + else: + d = 0 + Label(self.evframe, text=ticks2sec(d), + bd=1, relief=SUNKEN, width=10).grid( + row=ypos, column=3, sticky=W+E) ypos += 1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r187576 - in head/sys/dev: ppbus ppc
On Wed, 21 Jan 2009, John Baldwin wrote: Author: jhb Date: Wed Jan 21 23:10:06 2009 New Revision: 187576 URL: http://svn.freebsd.org/changeset/base/187576 Log: Add locking to ppc and ppbus and mark the whole lot MPSAFE: Looks like there might be some kinks still: ppc0: Parallel port port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on acpi0 ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode ppc0: FIFO with 16/16/9 bytes threshold ppc0: [ITHREAD] ppbus0: Parallel port bus on ppc0 panic: mutex ppc0 not owned at ../../../dev/ppc/ppc.c:1983 cpuid = 0 KDB: enter: panic [thread pid 0 tid 10 ] Stopped at kdb_enter+0x3d: movq$0,0x652ea8(%rip) _mtx_assert() at _mtx_assert+0xdc ppc_write_ivar() at ppc_write_ivar+0x6e ppbus_attach() at ppbus_attach+0x14b Thanks, Jeff - To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with all the child devices including ppbus(4), lpt(4), plip(4), etc. This mutex is then used for all the locking. - Rework the interrupt handling stuff yet again. Now ppbus drivers setup their interrupt handler during attach and tear it down during detach like most other drivers. ppbus(4) only invokes the interrupt handler of the device that currently owns the bus (if any) when an interrupt occurs, however. Also, interrupt handlers in general now accept their softc pointers as their argument rather than the device_t. Another feature of the ppbus interrupt handlers is that they are called with the parent ppc device's lock already held. This minimizes the number of lock operations during an interrupt. - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE. - lpbb(4) uses the ppc lock instead of Giant. - Other plip(4) changes: - Add a mutex to protect the global tables in plip(4) and free them on module unload. - Add a detach routine. - Split out the init/stop code from the ioctl routine into separate functions. - Other lpt(4) changes: - Use device_printf(). - Use a dedicated callout for the lptout timer. - Allocate the I/O buffers at attach and detach rather than during open and close as this simplifies the locking at the cost of 1024+32 bytes when the driver is attached. - Other ppi(4) changes: - Use an sx lock to serialize open and close. - Remove unused HADBUS flag. - Add a detach routine. - Use a malloc'd buffer for each read and write to avoid races with concurrent read/write. - Other pps(4) changes: - Use a callout rather than a callout handle with timeout(). - Conform to the new ppbus requirements (regular mutex, non-filter interrupt handler). pps(4) is probably going to have to become a standalone driver that doesn't use ppbus(4) to satisfy it's requirements for low latency as a result. - Use an sx lock to serialize open and close. - Other vpo(4) changes: - Use the parent ppc device's lock to create the CAM sim instead of Giant. - Other ppc(4) changes: - Fix ppc_isa's detach method to detach instead of calling attach. Tested by: no one :-( Modified: head/sys/dev/ppbus/if_plip.c head/sys/dev/ppbus/immio.c head/sys/dev/ppbus/lpbb.c head/sys/dev/ppbus/lpt.c head/sys/dev/ppbus/pcfclock.c head/sys/dev/ppbus/ppb_1284.c head/sys/dev/ppbus/ppb_base.c head/sys/dev/ppbus/ppb_msq.c head/sys/dev/ppbus/ppbconf.c head/sys/dev/ppbus/ppbconf.h head/sys/dev/ppbus/ppi.c head/sys/dev/ppbus/pps.c head/sys/dev/ppbus/vpo.c head/sys/dev/ppbus/vpoio.c head/sys/dev/ppc/ppc.c head/sys/dev/ppc/ppc_acpi.c head/sys/dev/ppc/ppc_isa.c head/sys/dev/ppc/ppc_pci.c head/sys/dev/ppc/ppc_puc.c head/sys/dev/ppc/ppcreg.h head/sys/dev/ppc/ppcvar.h Modified: head/sys/dev/ppbus/if_plip.c == --- head/sys/dev/ppbus/if_plip.cWed Jan 21 21:48:46 2009 (r187575) +++ head/sys/dev/ppbus/if_plip.cWed Jan 21 23:10:06 2009 (r187576) @@ -152,8 +152,12 @@ struct lp_data { int sc_iferrs; struct resource *res_irq; + void*sc_intr_cookie; }; +static struct mtx lp_tables_lock; +MTX_SYSINIT(lp_tables, lp_tables_lock, plip tables, MTX_DEF); + /* Tables for the lp# interface */ static u_char *txmith; #define txmitl (txmith + (1 * LPIPTBLSIZE)) @@ -170,13 +174,41 @@ static int lpinittables(void); static int lpioctl(struct ifnet *, u_long, caddr_t); static int lpoutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); +static void lpstop(struct lp_data *); static void lp_intr(void *); +static int lp_module_handler(module_t, int, void *); #define DEVTOSOFTC(dev) \ ((struct lp_data *)device_get_softc(dev)) static devclass_t lp_devclass; +static int +lp_module_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_UNLOAD: + mtx_lock(lp_tables_lock);