svn commit: r212603 - in head/sys: kern sys
Author: mav Date: Tue Sep 14 08:48:06 2010 New Revision: 212603 URL: http://svn.freebsd.org/changeset/base/212603 Log: Make kern_tc.c provide minimum frequency of tc_ticktock() calls, required to handle current timecounter wraps. Make kern_clocksource.c to honor that requirement, scheduling sleeps on first CPU for no more then specified period. Allow other CPUs to sleep up to 1/4 second (for any case). Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_tc.c head/sys/kern/kern_timeout.c head/sys/sys/callout.h head/sys/sys/timetc.h Modified: head/sys/kern/kern_clock.c == --- head/sys/kern/kern_clock.c Tue Sep 14 07:09:24 2010(r212602) +++ head/sys/kern/kern_clock.c Tue Sep 14 08:48:06 2010(r212603) @@ -457,7 +457,7 @@ hardclock(int usermode, uintfptr_t pc) atomic_add_int((volatile int *)&ticks, 1); hardclock_cpu(usermode); - tc_ticktock(); + tc_ticktock(1); cpu_tick_calibration(); /* * If no separate statistics clock is available, run it from here. @@ -538,7 +538,7 @@ hardclock_anycpu(int cnt, int usermode) if (newticks > 0) { /* Dangerous and no need to call these things concurrently. */ if (atomic_cmpset_acq_int(&global_hardclock_run, 0, 1)) { - tc_ticktock(); + tc_ticktock(newticks); #ifdef DEVICE_POLLING /* This is very short and quick. */ hardclock_device_poll(); Modified: head/sys/kern/kern_clocksource.c == --- head/sys/kern/kern_clocksource.cTue Sep 14 07:09:24 2010 (r212602) +++ head/sys/kern/kern_clocksource.cTue Sep 14 08:48:06 2010 (r212603) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -247,7 +248,10 @@ getnextcpuevent(struct bintime *event, i state = DPCPU_PTR(timerstate); *event = state->nexthard; if (idle) { /* If CPU is idle - ask callouts for how long. */ - skip = callout_tickstofirst() - 1; + skip = 4; + if (curcpu == CPU_FIRST() && tc_min_ticktock_freq > skip) + skip = tc_min_ticktock_freq; + skip = callout_tickstofirst(hz / skip) - 1; CTR2(KTR_SPARE2, "skip at %d: %d", curcpu, skip); tmp = hardperiod; bintime_mul(&tmp, skip); Modified: head/sys/kern/kern_tc.c == --- head/sys/kern/kern_tc.c Tue Sep 14 07:09:24 2010(r212602) +++ head/sys/kern/kern_tc.c Tue Sep 14 08:48:06 2010(r212603) @@ -87,6 +87,8 @@ static struct timehands *volatile timeha struct timecounter *timecounter = &dummy_timecounter; static struct timecounter *timecounters = &dummy_timecounter; +int tc_min_ticktock_freq = 1; + time_t time_second = 1; time_t time_uptime = 1; @@ -482,6 +484,8 @@ tc_windup(void) if (th->th_counter != timecounter) { th->th_counter = timecounter; th->th_offset_count = ncount; + tc_min_ticktock_freq = max(1, timecounter->tc_frequency / + (((uint64_t)timecounter->tc_counter_mask + 1) / 3)); } /*- @@ -767,11 +771,12 @@ static int tc_tick; SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, ""); void -tc_ticktock(void) +tc_ticktock(int cnt) { static int count; - if (++count < tc_tick) + count += cnt; + if (count < tc_tick) return; count = 0; tc_windup(); Modified: head/sys/kern/kern_timeout.c == --- head/sys/kern/kern_timeout.cTue Sep 14 07:09:24 2010 (r212602) +++ head/sys/kern/kern_timeout.cTue Sep 14 08:48:06 2010 (r212603) @@ -280,7 +280,7 @@ callout_tick(void) } int -callout_tickstofirst(void) +callout_tickstofirst(int limit) { struct callout_cpu *cc; struct callout *c; @@ -291,7 +291,7 @@ callout_tickstofirst(void) cc = CC_SELF(); mtx_lock_spin_flags(&cc->cc_lock, MTX_QUIET); curticks = cc->cc_ticks; - while( skip < ncallout && skip < hz/8 ) { + while( skip < ncallout && skip < limit ) { sc = &cc->cc_callwheel[ (curticks+skip) & callwheelmask ]; /* search scanning ticks */ TAILQ_FOREACH( c, sc, c_links.tqe ){ Modified: head/sys/sys/callout.h == --- head/sys/sys/callout.h Tue Sep 14 07:09:24 2010(r212602) +++ head/sys/sys/callout.h Tue Sep 14 08:48:06 2010(r212
svn commit: r212604 - head/sys/kern
Author: mav Date: Tue Sep 14 10:26:49 2010 New Revision: 212604 URL: http://svn.freebsd.org/changeset/base/212604 Log: Fix panic on NULL dereference possible after r212541. Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c == --- head/sys/kern/kern_timeout.cTue Sep 14 08:48:06 2010 (r212603) +++ head/sys/kern/kern_timeout.cTue Sep 14 10:26:49 2010 (r212604) @@ -672,7 +672,8 @@ retry: c->c_time = ticks + to_ticks; TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask], c, c_links.tqe); - if ((c->c_time - cc->cc_firsttick) < 0) { + if ((c->c_time - cc->cc_firsttick) < 0 && + callout_new_inserted != NULL) { cc->cc_firsttick = c->c_time; (*callout_new_inserted)(cpu, to_ticks + (ticks - cc->cc_ticks)); ___ 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: r212605 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Tue Sep 14 10:27:32 2010 New Revision: 212605 URL: http://svn.freebsd.org/changeset/base/212605 Log: Add missing vop_vector zfsctl_ops_shares Add missing locks around VOP_READDIR and VOP_GETATTR with z_shares_dir PR: kern/150544 Approved by: delphij (mentor) Obtained from:perforce (pjd) MFC after:1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cTue Sep 14 10:26:49 2010(r212604) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cTue Sep 14 10:27:32 2010(r212605) @@ -1101,8 +1101,9 @@ zfsctl_shares_readdir(ap) return (ENOTSUP); } if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { + vn_lock(ZTOV(dzp), LK_SHARED | LK_RETRY); error = VOP_READDIR(ZTOV(dzp), uiop, cr, eofp, ap->a_ncookies, ap->a_cookies); - VN_RELE(ZTOV(dzp)); + VN_URELE(ZTOV(dzp)); } else { *eofp = 1; error = ENOENT; @@ -1149,6 +1150,7 @@ zfsctl_mknode_shares(vnode_t *pvp) NULL, NULL); sdp = vp->v_data; sdp->zc_cmtime = ((zfsctl_node_t *)pvp->v_data)->zc_cmtime; + VOP_UNLOCK(vp, 0); return (vp); } @@ -1176,8 +1178,9 @@ zfsctl_shares_getattr(ap) return (ENOTSUP); } if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) { + vn_lock(ZTOV(dzp), LK_SHARED | LK_RETRY); error = VOP_GETATTR(ZTOV(dzp), vap, cr); - VN_RELE(ZTOV(dzp)); + VN_URELE(ZTOV(dzp)); } ZFS_EXIT(zfsvfs); return (error); @@ -1253,6 +1256,20 @@ static struct vop_vector zfsctl_ops_snap .vop_fid = zfsctl_common_fid, }; +static struct vop_vector zfsctl_ops_shares = { + .vop_default = &default_vnodeops, + .vop_open = zfsctl_common_open, + .vop_close =zfsctl_common_close, + .vop_ioctl =VOP_EINVAL, + .vop_getattr = zfsctl_shares_getattr, + .vop_access = zfsctl_common_access, + .vop_readdir = zfsctl_shares_readdir, + .vop_lookup = zfsctl_shares_lookup, + .vop_inactive = gfs_vop_inactive, + .vop_reclaim = zfsctl_common_reclaim, + .vop_fid = zfsctl_shares_fid, +}; + /* * pvp is the GFS vnode '.zfs/snapshot'. * ___ 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: r212281 - head/sys/vm
On Tue, Sep 14, 2010 at 01:48:12AM -0500, Alan Cox wrote: > Kostik Belousov wrote: > >Did you noted the thread on current@ about r212281 ? The submitter > >claims that the rev. causes panics in unrelated code pathes when > >vnode_create_vobject() locks vm object lock. I cannot understand > >how this can happen, with or without the rev. > > > > > > Yes, I saw it. I don't understand it either. > > Alan > . As noted by Peter Holm, the report indicates that fuse.ko module was loaded. I believe this is another fuse-induced kernel memory corruption. pgp7zZHjGufmA.pgp Description: PGP signature
svn commit: r212606 - in head/sbin/geom: class/part core
Author: pjd Date: Tue Sep 14 11:13:46 2010 New Revision: 212606 URL: http://svn.freebsd.org/changeset/base/212606 Log: Introduce special G_VAL_OPTIONAL define, which when given in value field tells geom(8) to ignore it when it is not given and don't try to obtain default value. Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h Modified: head/sbin/geom/class/part/geom_part.c == --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 10:27:32 2010 (r212605) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 11:13:46 2010 (r212606) @@ -90,16 +90,16 @@ struct g_command PUBSYM(class_commands)[ { 'b', "start", GPART_AUTOFILL, G_TYPE_STRING }, { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, "", G_TYPE_ASCNUM }, - { 'l', "label", "", G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "[-b start] [-s size] -t type [-i index] [-l label] [-f flags] geom" }, { "bootcode", 0, gpart_bootcode, { - { 'b', GPART_PARAM_BOOTCODE, "", G_TYPE_STRING }, - { 'p', GPART_PARAM_PARTCODE, "", G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, "", G_TYPE_ASCNUM }, + { 'b', GPART_PARAM_BOOTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, + { 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "bootcode [-b bootcode] [-p partcode] [-i index] [-f flags] geom" @@ -109,7 +109,7 @@ struct g_command PUBSYM(class_commands)[ }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, - { 'n', "entries", "", G_TYPE_ASCNUM }, + { 'n', "entries", G_VAL_OPTIONAL, G_TYPE_ASCNUM }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-s scheme [-n entries] [-f flags] provider" @@ -127,8 +127,8 @@ struct g_command PUBSYM(class_commands)[ }, { "modify", 0, gpart_issue, { { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, - { 'l', "label", "", G_TYPE_STRING }, - { 't', "type", "", G_TYPE_STRING }, + { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, + { 't', "type", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-i index [-l label] [-t type] [-f flags] geom" Modified: head/sbin/geom/core/geom.c == --- head/sbin/geom/core/geom.c Tue Sep 14 10:27:32 2010(r212605) +++ head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010(r212606) @@ -374,9 +374,8 @@ parse_arguments(struct g_command *cmd, s warnx("Option '%c' not specified.", opt->go_char); usage(); - } else if (G_OPT_TYPE(opt) == G_TYPE_ASCNUM && - *(const char *)opt->go_val == '\0') { - ; /* add nothing. */ + } else if (opt->go_val == G_VAL_OPTIONAL) { + /* add nothing. */ } else { set_option(req, opt, opt->go_val); } Modified: head/sbin/geom/core/geom.h == --- head/sbin/geom/core/geom.h Tue Sep 14 10:27:32 2010(r212605) +++ head/sbin/geom/core/geom.h Tue Sep 14 11:13:46 2010(r212606) @@ -53,6 +53,8 @@ #defineG_OPT_NUM(opt) (((opt)->go_type & G_TYPE_NUMMASK) >> G_TYPE_NUMSHIFT) #defineG_OPT_NUMINC(opt) ((opt)->go_type += (1 << G_TYPE_NUMSHIFT)) +#defineG_VAL_OPTIONAL ((void *)-1) + #define G_OPT_SENTINEL { '\0', NULL, NULL, G_TYPE_NONE } #define G_NULL_OPTS{ G_OPT_SENTINEL } #defineG_CMD_SENTINEL { NULL, 0, NULL, G_NULL_OPTS, NULL } ___ 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: r212607 - head/sbin/geom/core
Author: pjd Date: Tue Sep 14 11:19:21 2010 New Revision: 212607 URL: http://svn.freebsd.org/changeset/base/212607 Log: Remove dot which shouldn't be here, as err(3) will attach error message at the end of the string. Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c == --- head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010(r212606) +++ head/sbin/geom/core/geom.c Tue Sep 14 11:19:21 2010(r212607) @@ -262,7 +262,7 @@ set_option(struct gctl_req *req, struct if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (expand_number(val, &number) == -1) { - err(EXIT_FAILURE, "Invalid value for '%c' argument.", + err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); } if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { ___ 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: r212608 - head/sbin/geom/class/part
Author: pjd Date: Tue Sep 14 11:36:26 2010 New Revision: 212608 URL: http://svn.freebsd.org/changeset/base/212608 Log: All gpart(8) subcommands apart from the 'bootcode' subcommand handle given geom/provider names with and without /dev/ prefix. Teach the 'bootcode' subcommand to handle /dev/ names as well. Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c == --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 11:19:21 2010 (r212607) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 11:36:26 2010 (r212608) @@ -183,6 +183,8 @@ find_geom(struct gclass *classp, const c { struct ggeom *gp; + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); LIST_FOREACH(gp, &classp->lg_geom, lg_geom) { if (strcmp(gp->lg_name, name) == 0) return (gp); ___ 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: r212554 - in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/mountver sbin/g
On Mon, Sep 13, 2010 at 03:06:55PM +, Alexander Best wrote: > hi there, > > could you take a quick peek at PR #150239 to see if the patch for g_part.c is > a > reasonable change? Yes, the current output was confusing to me as well. -- Pawel Jakub Dawidek http://www.wheelsystems.com p...@freebsd.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! pgpkAftK9eA7g.pgp Description: PGP signature
svn commit: r212610 - head/sbin/newfs
Author: gjb (doc committer) Date: Tue Sep 14 12:12:07 2010 New Revision: 212610 URL: http://svn.freebsd.org/changeset/base/212610 Log: Synchronize newfs(8) manual with code. PR: 61716 Submitted by: Radim Kolar Patch by: arundel Approved by: keramida (mentor) MFC after:1 week Modified: head/sbin/newfs/newfs.8 Modified: head/sbin/newfs/newfs.8 == --- head/sbin/newfs/newfs.8 Tue Sep 14 11:42:07 2010(r212609) +++ head/sbin/newfs/newfs.8 Tue Sep 14 12:12:07 2010(r212610) @@ -28,7 +28,7 @@ .\" @(#)newfs.88.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd March 21, 2008 +.Dd September 14, 2010 .Dt NEWFS 8 .Os .Sh NAME @@ -125,8 +125,9 @@ and the number of bytes per inode. .It Fl d Ar max-extent-size The file system may choose to store large files using extents. This parameter specifies the largest extent size that may be used. -It is presently limited to its default value which is 16 times -the file system blocksize. +The default value is the file system blocksize. +It is presently limited to a maximum value of 16 times the +file system blocksize and a minimum value of the file system blocksize. .It Fl e Ar maxbpg Indicate the maximum number of blocks any single file can allocate out of a cylinder group before it is forced to begin ___ 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: r212611 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Tue Sep 14 12:12:18 2010 New Revision: 212611 URL: http://svn.freebsd.org/changeset/base/212611 Log: Remove duplicated VFS_HOLD due to a mismerge. PR: kern/150544 Approved by: delphij (mentor) MFC after:1 day Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cTue Sep 14 12:12:07 2010(r212610) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cTue Sep 14 12:12:18 2010(r212611) @@ -1226,13 +1226,6 @@ zfs_mount(vfs_t *vfsp) if (error == 0 && ((zfsvfs_t *)vfsp->vfs_data)->z_issnap) VFS_HOLD(mvp->v_vfsp); - /* -* Add an extra VFS_HOLD on our parent vfs so that it can't -* disappear due to a forced unmount. -*/ - if (error == 0 && ((zfsvfs_t *)vfsp->vfs_data)->z_issnap) - VFS_HOLD(mvp->v_vfsp); - out: 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"
svn commit: r212609 - head/sys/geom/part
Author: pjd Date: Tue Sep 14 11:42:07 2010 New Revision: 212609 URL: http://svn.freebsd.org/changeset/base/212609 Log: Simplify the code a bit. Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c == --- head/sys/geom/part/g_part.c Tue Sep 14 11:36:26 2010(r212608) +++ head/sys/geom/part/g_part.c Tue Sep 14 11:42:07 2010(r212609) @@ -297,17 +297,14 @@ g_part_new_provider(struct g_geom *gp, s } static int -g_part_parm_geom(const char *rawname, struct g_geom **v) +g_part_parm_geom(const char *name, struct g_geom **v) { struct g_geom *gp; - const char *pname; - if (strncmp(rawname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pname = rawname + strlen(_PATH_DEV); - else - pname = rawname; + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(pname, gp->name)) + if (!strcmp(name, gp->name)) break; } if (gp == NULL) @@ -317,14 +314,13 @@ g_part_parm_geom(const char *rawname, st } static int -g_part_parm_provider(const char *pname, struct g_provider **v) +g_part_parm_provider(const char *name, struct g_provider **v) { struct g_provider *pp; - if (strncmp(pname, _PATH_DEV, strlen(_PATH_DEV)) == 0) - pp = g_provider_by_name(pname + strlen(_PATH_DEV)); - else - pp = g_provider_by_name(pname); + if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) + name += strlen(_PATH_DEV); + pp = g_provider_by_name(name); if (pp == NULL) return (EINVAL); *v = pp; ___ 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: r212607 - head/sbin/geom/core
On Tue, 14 Sep 2010, Pawel Jakub Dawidek wrote: Log: Remove dot which shouldn't be here, as err(3) will attach error message at the end of the string. In KNF, error messages are neither capitalized or terminated by a dot, partly because of this. Modified: head/sbin/geom/core/geom.c == --- head/sbin/geom/core/geom.c Tue Sep 14 11:13:46 2010(r212606) +++ head/sbin/geom/core/geom.c Tue Sep 14 11:19:21 2010(r212607) @@ -262,7 +262,7 @@ set_option(struct gctl_req *req, struct if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (expand_number(val, &number) == -1) { - err(EXIT_FAILURE, "Invalid value for '%c' argument.", + err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); } if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { This message is still capitalized. Most other error messages in sbin/geom have same bugs. Dots too, though this fixes the last dot for err(). For errx() and warnx(), you can supply the dot without ensuring the punctuation/grammar error ".:", but this is still a style bug since it is not KNF and it is silly for the shorter error messages without an errno string to be capitalized while longer ones with an errno cannot be since err() has a fixed format not including the dot. For the capitalization, a capital letter after the prefix ": " is just a style bug. I think capitalization after ": " looks strange, especially after starting with a lower case program name. Then the errno string messes up the formatting a bit by always being capitalized. In bin/*/*.c 1 month ago, the KNF rule about not capitializing err(1, "Foo") is followed in approx. 66 lines and broken in just 7 lines (1 in cp and 6 in pkill), partly because of tree sweeps to unbreak this. In Lite2 it was followed in approx. 29 lines and broken in just 1 line (in rmail). Bruce ___ 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: r212613 - head/sbin/geom/class/part
Author: pjd Date: Tue Sep 14 16:19:09 2010 New Revision: 212613 URL: http://svn.freebsd.org/changeset/base/212613 Log: Update two last places where "arg0" should be used instead of "geom". Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c == --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 14:56:34 2010 (r212612) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 16:19:09 2010 (r212613) @@ -302,7 +302,7 @@ gpart_autofill_resize(struct gctl_req *r cp = find_class(&mesh, s); if (cp == NULL) errx(EXIT_FAILURE, "Class %s not found.", s); - s = gctl_get_ascii(req, "geom"); + s = gctl_get_ascii(req, "arg0"); if (s == NULL) abort(); gp = find_geom(cp, s); @@ -411,7 +411,7 @@ gpart_autofill(struct gctl_req *req) cp = find_class(&mesh, s); if (cp == NULL) errx(EXIT_FAILURE, "Class %s not found.", s); - s = gctl_get_ascii(req, "geom"); + s = gctl_get_ascii(req, "arg0"); if (s == NULL) abort(); gp = find_geom(cp, s); ___ 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: r212614 - in head: sbin/geom/class/part sys/geom/part
Author: pjd Date: Tue Sep 14 16:21:13 2010 New Revision: 212614 URL: http://svn.freebsd.org/changeset/base/212614 Log: - Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER. It turns out the new type wasn't really needed. - Reorganize code a little bit. Modified: head/sbin/geom/class/part/geom_part.c head/sys/geom/part/g_part.c Modified: head/sbin/geom/class/part/geom_part.c == --- head/sbin/geom/class/part/geom_part.c Tue Sep 14 16:19:09 2010 (r212613) +++ head/sbin/geom/class/part/geom_part.c Tue Sep 14 16:21:13 2010 (r212614) @@ -90,7 +90,7 @@ struct g_command PUBSYM(class_commands)[ { 'b', "start", GPART_AUTOFILL, G_TYPE_STRING }, { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, @@ -99,7 +99,7 @@ struct g_command PUBSYM(class_commands)[ { "bootcode", 0, gpart_bootcode, { { 'b', GPART_PARAM_BOOTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, { 'p', GPART_PARAM_PARTCODE, G_VAL_OPTIONAL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "bootcode [-b bootcode] [-p partcode] [-i index] [-f flags] geom" @@ -109,13 +109,13 @@ struct g_command PUBSYM(class_commands)[ }, { "create", 0, gpart_issue, { { 's', "scheme", NULL, G_TYPE_STRING }, - { 'n', "entries", G_VAL_OPTIONAL, G_TYPE_ASCNUM }, + { 'n', "entries", G_VAL_OPTIONAL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-s scheme [-n entries] [-f flags] provider" }, { "delete", 0, gpart_issue, { - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-i index [-f flags] geom" @@ -126,7 +126,7 @@ struct g_command PUBSYM(class_commands)[ "[-f flags] geom" }, { "modify", 0, gpart_issue, { - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'l', "label", G_VAL_OPTIONAL, G_TYPE_STRING }, { 't', "type", G_VAL_OPTIONAL, G_TYPE_STRING }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, @@ -135,7 +135,7 @@ struct g_command PUBSYM(class_commands)[ }, { "set", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-a attrib -i index [-f flags] geom" @@ -151,14 +151,14 @@ struct g_command PUBSYM(class_commands)[ }, { "unset", 0, gpart_issue, { { 'a', "attrib", NULL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "-a attrib -i index [-f flags] geom" }, { "resize", 0, gpart_issue, { { 's', "size", GPART_AUTOFILL, G_TYPE_STRING }, - { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_ASCNUM }, + { 'i', GPART_PARAM_INDEX, NULL, G_TYPE_NUMBER }, { 'f', "flags", GPART_FLAGS, G_TYPE_STRING }, G_OPT_SENTINEL }, "[-s size] -i index [-f flags] geom" Modified: head/sys/geom/part/g_part.c == --- head/sys/geom/part/g_part.c Tue Sep 14 16:19:09 2010(r212613) +++ head/sys/geom/part/g_part.c Tue Sep 14 16:21:13 2010(r212614) @@ -297,86 +297,155 @@ g_part_new_provider(struct g_geom *gp, s } static int -g_part_parm_geom(const char *name, struct g_geom **v) +g_part_parm_geom(struct gctl_req *req, const char *name, struct g_geom **v) { struct g_geom *gp; + const char *gname; - if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) - name += strlen(_PATH_DEV); + gname = gctl_get_asciiparam(req, name); + if
svn commit: r212615 - head/sbin/geom/core
Author: pjd Date: Tue Sep 14 16:22:22 2010 New Revision: 212615 URL: http://svn.freebsd.org/changeset/base/212615 Log: Remove now unused G_TYPE_ASCNUM. Modified: head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h Modified: head/sbin/geom/core/geom.c == --- head/sbin/geom/core/geom.c Tue Sep 14 16:21:13 2010(r212614) +++ head/sbin/geom/core/geom.c Tue Sep 14 16:22:22 2010(r212615) @@ -259,8 +259,7 @@ set_option(struct gctl_req *req, struct optname = opt->go_name; } - if (G_OPT_TYPE(opt) == G_TYPE_NUMBER || - G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { + if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { if (expand_number(val, &number) == -1) { err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); Modified: head/sbin/geom/core/geom.h == --- head/sbin/geom/core/geom.h Tue Sep 14 16:21:13 2010(r212614) +++ head/sbin/geom/core/geom.h Tue Sep 14 16:22:22 2010(r212615) @@ -38,7 +38,6 @@ #defineG_TYPE_BOOL 0x01 #defineG_TYPE_STRING 0x02 #defineG_TYPE_NUMBER 0x03 -#defineG_TYPE_ASCNUM 0x04 #defineG_TYPE_MASK 0x0f #defineG_TYPE_DONE 0x10 #defineG_TYPE_MULTI0x20 ___ 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: r212616 - head/sys/dev/mps
Author: ken Date: Tue Sep 14 17:22:06 2010 New Revision: 212616 URL: http://svn.freebsd.org/changeset/base/212616 Log: MFp4: (//depot/projects/mps/...) Report data overruns properly. Submitted by: scottl Modified: head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mps/mps_sas.c == --- head/sys/dev/mps/mps_sas.c Tue Sep 14 16:22:22 2010(r212615) +++ head/sys/dev/mps/mps_sas.c Tue Sep 14 17:22:06 2010(r212616) @@ -1219,11 +1219,9 @@ mpssas_scsiio_complete(struct mps_softc ccb->ccb_h.status = CAM_REQ_CMP; break; case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: - /* -* XXX any way to report this? -*/ + /* resid is ignored for this condition */ ccb->csio.resid = 0; - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_DATA_RUN_ERR; break; case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE: case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: ___ 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: r212617 - head/sys/ufs/ffs
Author: mckusick Date: Tue Sep 14 18:04:05 2010 New Revision: 212617 URL: http://svn.freebsd.org/changeset/base/212617 Log: Update comments in soft updates code to more fully describe the addition of journalling. Only functional change is to tighten a KASSERT. Reviewed by: jeff Roberson Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/fs.h head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c == --- head/sys/ufs/ffs/ffs_softdep.c Tue Sep 14 17:22:06 2010 (r212616) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Sep 14 18:04:05 2010 (r212617) @@ -2378,7 +2378,8 @@ remove_from_journal(wk) /* * We emulate a TAILQ to save space in most structures which do not * require TAILQ semantics. Here we must update the tail position -* when removing the tail which is not the final entry. +* when removing the tail which is not the final entry. This works +* only if the worklist linkage are at the beginning of the structure. */ if (ump->softdep_journal_tail == wk) ump->softdep_journal_tail = @@ -2605,7 +2606,7 @@ jremref_write(jremref, jseg, data) inoref_write(&jremref->jr_ref, jseg, rec); } -static void +static void jmvref_write(jmvref, jseg, data) struct jmvref *jmvref; struct jseg *jseg; @@ -2906,9 +2907,9 @@ complete_jseg(jseg) waiting = wk->wk_state & IOWAITING; wk->wk_state &= ~(IOSTARTED | IOWAITING); wk->wk_state |= COMPLETE; - KASSERT(i < jseg->js_cnt, + KASSERT(i++ < jseg->js_cnt, ("handle_written_jseg: overflow %d >= %d", - i, jseg->js_cnt)); + i - 1, jseg->js_cnt)); switch (wk->wk_type) { case D_JADDREF: handle_written_jaddref(WK_JADDREF(wk)); @@ -7492,7 +7493,7 @@ handle_written_sbdep(sbdep, bp) if (inodedep_lookup(mp, fs->fs_sujfree, 0, &inodedep) == 0) panic("handle_written_sbdep: lost inodedep"); /* -* Now that we have a record of this indode in stable store allow it +* Now that we have a record of this inode in stable store allow it * to be written to free up pending work. Inodes may see a lot of * write activity after they are unlinked which we must not hold up. */ @@ -7509,8 +7510,7 @@ handle_written_sbdep(sbdep, bp) } /* - * Mark an inodedep has unlinked and insert it into the in-memory unlinked - * list. + * Mark an inodedep as unlinked and insert it into the in-memory unlinked list. */ static void unlinked_inodedep(mp, inodedep) @@ -7576,7 +7576,7 @@ clear_unlinked_inodedep(inodedep) * link before us, whether it be the superblock or an inode. * Unfortunately the list may change while we're waiting * on the buf lock for either resource so we must loop until -* we lock. the right one. If both the superblock and an +* we lock the right one. If both the superblock and an * inode point to this inode we must clear the inode first * followed by the superblock. */ @@ -9094,7 +9094,7 @@ handle_jwork(wkhd) /* * Handle the bufwait list on an inode when it is safe to release items * held there. This normally happens after an inode block is written but - * may be delayed and handle later if there are pending journal items that + * may be delayed and handled later if there are pending journal items that * are not yet safe to be released. */ static struct freefile * Modified: head/sys/ufs/ffs/fs.h == --- head/sys/ufs/ffs/fs.h Tue Sep 14 17:22:06 2010(r212616) +++ head/sys/ufs/ffs/fs.h Tue Sep 14 18:04:05 2010(r212617) @@ -661,7 +661,7 @@ lbn_level(ufs_lbn_t lbn) /* * Size of the segment record header. There is at most one for each disk - * block n the journal. The segment header is followed by an array of + * block in the journal. The segment header is followed by an array of * records. fsck depends on the first element in each record being 'op' * and the second being 'ino'. Segments may span multiple disk blocks but * the header is present on each. Modified: head/sys/ufs/ffs/softdep.h == --- head/sys/ufs/ffs/softdep.h Tue Sep 14 17:22:06 2010(r212616) +++ head/sys/ufs/ffs/softdep.h Tue Sep 14 18:04:05 2010(r212617) @@ -107,6 +107,15 @@ * * The ONWORKLIST flag shows whether the structure is currently linked * onto a worklist. + * + * The UNLINK* flags track the progress of updating the on-disk linked + * list of active but unlinked inodes. Wh
svn commit: r212618 - head/sys/sys
Author: kib Date: Tue Sep 14 18:58:51 2010 New Revision: 212618 URL: http://svn.freebsd.org/changeset/base/212618 Log: Rename the field to not confuse readers. The bytes are actually used. Discussed with: rmacklem MFC after:1 week Modified: head/sys/sys/mount.h Modified: head/sys/sys/mount.h == --- head/sys/sys/mount.hTue Sep 14 18:04:05 2010(r212617) +++ head/sys/sys/mount.hTue Sep 14 18:58:51 2010(r212618) @@ -56,7 +56,7 @@ typedef struct fsid { int32_t val[2]; } struct fid { u_short fid_len;/* length of data in bytes */ - u_short fid_reserved; /* force longword alignment */ + u_short fid_data0; /* force longword alignment */ charfid_data[MAXFIDSZ]; /* data (variable length) */ }; ___ 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: r212619 - head/sys/sparc64/sparc64
Author: marius Date: Tue Sep 14 19:35:43 2010 New Revision: 212619 URL: http://svn.freebsd.org/changeset/base/212619 Log: Remove redundant raising of the PIL to PIL_TICK as the respective locore code already did that. Modified: head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_machdep.c Modified: head/sys/sparc64/sparc64/machdep.c == --- head/sys/sparc64/sparc64/machdep.c Tue Sep 14 18:58:51 2010 (r212618) +++ head/sys/sparc64/sparc64/machdep.c Tue Sep 14 19:35:43 2010 (r212619) @@ -587,7 +587,6 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * enable them. */ intr_init2(); - wrpr(pil, 0, PIL_TICK); wrpr(pstate, 0, PSTATE_KERNEL); /* Modified: head/sys/sparc64/sparc64/mp_machdep.c == --- head/sys/sparc64/sparc64/mp_machdep.c Tue Sep 14 18:58:51 2010 (r212618) +++ head/sys/sparc64/sparc64/mp_machdep.c Tue Sep 14 19:35:43 2010 (r212619) @@ -446,7 +446,6 @@ cpu_mp_bootstrap(struct pcpu *pc) cpu_setregs(pc); /* Enable interrupts. */ - wrpr(pil, 0, PIL_TICK); wrpr(pstate, 0, PSTATE_KERNEL); smp_cpus++; ___ 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: r212620 - in head/sys: sparc64/sparc64 sun4v/sun4v
Author: marius Date: Tue Sep 14 20:31:09 2010 New Revision: 212620 URL: http://svn.freebsd.org/changeset/base/212620 Log: Remove a KASSERT which will also trigger for perfectly valid combinations of small maxsize and "large" (including BUS_SPACE_UNRESTRICTED) nsegments parameters. Generally using a presz of 0 (which indeed might indicate the use of bogus parameters for DMA tag creation) is not fatal, it just means that no additional DVMA space will be preallocated. Modified: head/sys/sparc64/sparc64/iommu.c head/sys/sun4v/sun4v/hviommu.c Modified: head/sys/sparc64/sparc64/iommu.c == --- head/sys/sparc64/sparc64/iommu.cTue Sep 14 19:35:43 2010 (r212619) +++ head/sys/sparc64/sparc64/iommu.cTue Sep 14 20:31:09 2010 (r212620) @@ -874,9 +874,6 @@ iommu_dvmamap_create(bus_dma_tag_t dt, i */ maxpre = imin(dt->dt_nsegments, IOMMU_MAX_PRE_SEG); presz = dt->dt_maxsize / maxpre; - KASSERT(presz != 0, ("%s: bogus preallocation size , nsegments = %d, " - "maxpre = %d, maxsize = %lu", __func__, dt->dt_nsegments, maxpre, - dt->dt_maxsize)); for (i = 1; i < maxpre && totsz < IOMMU_MAX_PRE; i++) { currsz = round_io_page(ulmin(presz, IOMMU_MAX_PRE - totsz)); error = iommu_dvma_valloc(dt, is, *mapp, currsz); Modified: head/sys/sun4v/sun4v/hviommu.c == --- head/sys/sun4v/sun4v/hviommu.c Tue Sep 14 19:35:43 2010 (r212619) +++ head/sys/sun4v/sun4v/hviommu.c Tue Sep 14 20:31:09 2010 (r212620) @@ -513,9 +513,6 @@ hviommu_dvmamap_create(bus_dma_tag_t dt, */ maxpre = imin(dt->dt_nsegments, IOMMU_MAX_PRE_SEG); presz = dt->dt_maxsize / maxpre; - KASSERT(presz != 0, ("hviommu_dvmamap_create: bogus preallocation size " - ", nsegments = %d, maxpre = %d, maxsize = %lu", dt->dt_nsegments, - maxpre, dt->dt_maxsize)); for (i = 1; i < maxpre && totsz < IOMMU_MAX_PRE; i++) { currsz = round_io_page(ulmin(presz, IOMMU_MAX_PRE - totsz)); error = hviommu_dvma_valloc(dt, him, *mapp, currsz); ___ 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: r212621 - head/sys/dev/usb
Author: marius Date: Tue Sep 14 20:41:06 2010 New Revision: 212621 URL: http://svn.freebsd.org/changeset/base/212621 Log: Use saner nsegments and maxsegsz parameters when creating certain DMA tags; tags for 1-byte allocations cannot possibly be split across 2 segments and maxsegsz must not exceed maxsize. Modified: head/sys/dev/usb/usb_busdma.c Modified: head/sys/dev/usb/usb_busdma.c == --- head/sys/dev/usb/usb_busdma.c Tue Sep 14 20:31:09 2010 (r212620) +++ head/sys/dev/usb/usb_busdma.c Tue Sep 14 20:41:06 2010 (r212621) @@ -366,9 +366,9 @@ usb_dma_tag_create(struct usb_dma_tag *u /* filter*/ NULL, /* filterarg */ NULL, /* maxsize */ size, -/* nsegments */ (align == 1) ? +/* nsegments */ (align == 1 && size > 1) ? (2 + (size / USB_PAGE_SIZE)) : 1, -/* maxsegsz */ (align == 1) ? +/* maxsegsz */ (align == 1 && size > USB_PAGE_SIZE) ? USB_PAGE_SIZE : size, /* flags */ BUS_DMA_KEEP_PG_OFFSET, /* lockfn*/ &usb_dma_lock_cb, ___ 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: r212622 - head/sbin/geom/core
Author: pjd Date: Tue Sep 14 20:54:22 2010 New Revision: 212622 URL: http://svn.freebsd.org/changeset/base/212622 Log: Remove dead code. Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c == --- head/sbin/geom/core/geom.c Tue Sep 14 20:41:06 2010(r212621) +++ head/sbin/geom/core/geom.c Tue Sep 14 20:54:22 2010(r212622) @@ -264,21 +264,12 @@ set_option(struct gctl_req *req, struct err(EXIT_FAILURE, "Invalid value for '%c' argument", opt->go_char); } - if (G_OPT_TYPE(opt) == G_TYPE_NUMBER) { - ptr = malloc(sizeof(intmax_t)); - if (ptr == NULL) - errx(EXIT_FAILURE, "No memory."); - *(intmax_t *)ptr = number; - opt->go_val = ptr; - gctl_ro_param(req, optname, sizeof(intmax_t), - opt->go_val); - } else { - asprintf((void *)(&ptr), "%jd", number); - if (ptr == NULL) - errx(EXIT_FAILURE, "No memory."); - opt->go_val = ptr; - gctl_ro_param(req, optname, -1, opt->go_val); - } + ptr = malloc(sizeof(intmax_t)); + if (ptr == NULL) + errx(EXIT_FAILURE, "No memory."); + *(intmax_t *)ptr = number; + opt->go_val = ptr; + gctl_ro_param(req, optname, sizeof(intmax_t), opt->go_val); } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { gctl_ro_param(req, optname, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { ___ 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: r212623 - head/sbin/geom/core
Author: pjd Date: Tue Sep 14 20:55:25 2010 New Revision: 212623 URL: http://svn.freebsd.org/changeset/base/212623 Log: Force commit to note, than the previous change was... Submitted by: ae Modified: head/sbin/geom/core/geom.c Modified: head/sbin/geom/core/geom.c == ___ 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: r212624 - head/share/man/man4
Author: ken Date: Tue Sep 14 21:40:29 2010 New Revision: 212624 URL: http://svn.freebsd.org/changeset/base/212624 Log: MFp4 (//depot/projects/mps/...) Add a man page for the mps(4) driver, and reference it in the mpt(4) driver man page. Sponsored by: Spectra Logic Corporation Added: head/share/man/man4/mps.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/mpt.4 Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileTue Sep 14 20:55:25 2010 (r212623) +++ head/share/man/man4/MakefileTue Sep 14 21:40:29 2010 (r212624) @@ -219,6 +219,7 @@ MAN=aac.4 \ mmcsd.4 \ mn.4 \ mouse.4 \ + mps.4 \ mpt.4 \ msk.4 \ mtio.4 \ Added: head/share/man/man4/mps.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mps.4 Tue Sep 14 21:40:29 2010(r212624) @@ -0,0 +1,159 @@ +.\" +.\" Copyright (c) 2010 Spectra Logic Corporation +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions, and the following disclaimer, +.\"without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\"substantially similar to the "NO WARRANTY" disclaimer below +.\"("Disclaimer") and any redistribution must be conditioned upon +.\"including a substantially similar Disclaimer requirement for further +.\"binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGES. +.\" +.\" mps driver man page. +.\" +.\" Author: Ken Merry +.\" +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#1 $ +.\" $FreeBSD$ +.\" +.Dd September 13, 2010 +.Dt MPS 4 +.Os +.Sh NAME +.Nm mps +.Nd LSI Fusion-MPT 2 Serial Attached SCSI driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device scbus" +.Cd "device mps" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +mpt_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for LSI Logic Fusion-MPT 2 +.Tn SAS +controllers. +.Sh HARDWARE +The following controllers are supported by the +.Nm +driver +.Pp +.Bl -bullet -compact +.It +LSI Logic SAS2004 (4 Port +.Tn SAS ) +.It +LSI Logic SAS2008 (8 Port +.Tn SAS ) +.It +LSI Logic SAS2108 (8 Port +.Tn SAS ) +.It +LSI Logic SAS2116 (16 Port +.Tn SAS ) +.It +LSI Logic SAS2208 (8 Port +.Tn SAS ) +.El +.Sh CONFIGURATION +To disable MSI interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.disable_msi=1 +.Ed +.Pp +To disable MSI-X interrupts for all +.Nm +driver instances, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.disable_msix=1 +.Ed +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.mps.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable tracing prints. +.It 0x04 +Enable prints for driver faults. +.It 0x08 +Enable prints for controller events. +.El +.Sh SEE ALSO +.Xr cd 4 , +.Xr ch 4 , +.Xr da 4 , +.Xr mpt 4 , +.Xr pci 4 , +.Xr sa 4 , +.Xr scsi 4 , +.Xr targ 4 +.Sh BUGS +This driver is still in development, it has only been tested on the amd64 +architecture and has some known shortcomings: +.Bl -bullet -compact +.It +No IR (Integrated RAID) support. +.It +No userland utility support (e.g. +.Xr mptutil 8). +.It +Sometimes the driver gets into a state where devices arrive and depart multiple +ti
svn commit: r212625 - head/share/man/man4
Author: weongyo Date: Tue Sep 14 23:27:06 2010 New Revision: 212625 URL: http://svn.freebsd.org/changeset/base/212625 Log: Fixes spellings and uses the better sentence. While I'm here bumps date. Pointed by: imp, Ruslan Mahmatkhanov Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 == --- head/share/man/man4/bwn.4 Tue Sep 14 21:40:29 2010(r212624) +++ head/share/man/man4/bwn.4 Tue Sep 14 23:27:06 2010(r212625) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 11, 2010 +.Dd September 14, 2010 .Dt BWN 4 .Os .Sh NAME @@ -93,12 +93,11 @@ driver supports Broadcom BCM43xx based w .It "US Robotics 5411 BCM4318 CardBus b/g" .El .Pp -However if the device chipset is one of BCM4301, BCM4303 and BCM4306 rev 2, -uses +Users of older Broadcom chipsets (BCM4301, BCM4303 and BCM4306 rev 2) +must use .Xr bwi 4 -instead of -.Xr bwn 4 -because the vendor dropped the firmware support. +because the v4 version of the firmware does not support these chips. +The newer firmware is too big to fit into these old chips. .Sh EXAMPLES Join an existing BSS network (i.e., connect to an access point): .Pp ___ 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: r212627 - in head/sys/powerpc: aim booke include
Author: grehan Date: Wed Sep 15 00:17:52 2010 New Revision: 212627 URL: http://svn.freebsd.org/changeset/base/212627 Log: Introduce inheritance into the PowerPC MMU kobj interface. include/mmuvar.h - Change the MMU_DEF macro to also create the class definition as well as define the DATA_SET. Add a macro, MMU_DEF_INHERIT, which has an extra parameter specifying the MMU class to inherit methods from. Update the comments at the start of the header file to describe the new macros. booke/pmap.c aim/mmu_oea.c aim/mmu_oea64.c - Collapse mmu_def_t declaration into updated MMU_DEF macro The MMU_DEF_INHERIT macro will be used in the PS3 MMU implementation to allow it to inherit the stock powerpc64 MMU methods. Reviewed by: nwhitehorn Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/mmuvar.h Modified: head/sys/powerpc/aim/mmu_oea.c == --- head/sys/powerpc/aim/mmu_oea.c Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/aim/mmu_oea.c Wed Sep 15 00:17:52 2010 (r212627) @@ -379,12 +379,8 @@ static mmu_method_t moea_methods[] = { { 0, 0 } }; -static mmu_def_t oea_mmu = { - MMU_TYPE_OEA, - moea_methods, - 0 -}; -MMU_DEF(oea_mmu); +MMU_DEF(oea_mmu, MMU_TYPE_OEA, moea_methods, 0); + static void tlbie(vm_offset_t va) Modified: head/sys/powerpc/aim/mmu_oea64.c == --- head/sys/powerpc/aim/mmu_oea64.cTue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/aim/mmu_oea64.cWed Sep 15 00:17:52 2010 (r212627) @@ -474,12 +474,7 @@ static mmu_method_t moea64_methods[] = { { 0, 0 } }; -static mmu_def_t oea64_mmu = { - MMU_TYPE_G5, - moea64_methods, - 0 -}; -MMU_DEF(oea64_mmu); +MMU_DEF(oea64_mmu, MMU_TYPE_G5, moea64_methods, 0); static __inline u_int va_to_pteg(uint64_t vsid, vm_offset_t addr, int large) Modified: head/sys/powerpc/booke/pmap.c == --- head/sys/powerpc/booke/pmap.c Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/booke/pmap.c Wed Sep 15 00:17:52 2010 (r212627) @@ -384,12 +384,7 @@ static mmu_method_t mmu_booke_methods[] { 0, 0 } }; -static mmu_def_t booke_mmu = { - MMU_TYPE_BOOKE, - mmu_booke_methods, - 0 -}; -MMU_DEF(booke_mmu); +MMU_DEF(booke_mmu, MMU_TYPE_BOOKE, mmu_booke_methods, 0); static inline void tlb_miss_lock(void) Modified: head/sys/powerpc/include/mmuvar.h == --- head/sys/powerpc/include/mmuvar.h Tue Sep 14 23:54:03 2010 (r212626) +++ head/sys/powerpc/include/mmuvar.h Wed Sep 15 00:17:52 2010 (r212627) @@ -31,7 +31,8 @@ /* * A PowerPC MMU implementation is declared with a kernel object and - * an associated method table, similar to a device driver. + * an associated method table. The MMU_DEF macro is used to declare + * the class, and also links it to the global MMU class list. * * e.g. * @@ -44,13 +45,12 @@ * { 0, 0 } * }; * - * static mmu_def_t ppc8xx_mmu = { - * "ppc8xx", - * ppc8xx_methods, - * sizeof(ppc8xx_mmu_softc), // or 0 if no softc - * }; + * MMU_DEF(ppc8xx, MMU_TYPE_8xx, ppc8xx_methods, sizeof(ppc8xx_mmu_softc)); + * + * A single level of inheritance is supported in a similar fashion to + * kobj inheritance e.g. * - * MMU_DEF(ppc8xx_mmu); + * MMU_DEF_1(ppc860c, MMU_TYPE_860c, ppc860c_methods, 0, ppc8xx); */ #include @@ -84,7 +84,29 @@ typedef struct kobj_classmmu_def_t; #define MMUMETHOD KOBJMETHOD -#define MMU_DEF(name) DATA_SET(mmu_set, name) +#define MMU_DEF(name, ident, methods, size)\ + \ +mmu_def_t name = { \ + ident, methods, size, NULL \ +}; \ +DATA_SET(mmu_set, name) + +#define MMU_DEF_INHERIT(name, ident, methods, size, base1) \ + \ +static kobj_class_t name ## _baseclasses[] = \ + { &base1, NULL }; \ +mmu_def_t name = { \ + ident, methods, size, name ## _baseclasses \ +}; \ +DATA_SET(mmu_set, name) + + +#if 0 +mmu_def_t name = { \ + ident, methods, size, name ## _baseclasses \ +}; +DATA_SET(mmu_set, name) +#endif /* * Known MMU names ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any m
svn commit: r212628 - head/sys/dev/aac
Author: emaste Date: Wed Sep 15 01:19:11 2010 New Revision: 212628 URL: http://svn.freebsd.org/changeset/base/212628 Log: Add some enums and constants from Adaptec's latest driver (build 17911). Modified: head/sys/dev/aac/aacreg.h Modified: head/sys/dev/aac/aacreg.h == --- head/sys/dev/aac/aacreg.h Wed Sep 15 00:17:52 2010(r212627) +++ head/sys/dev/aac/aacreg.h Wed Sep 15 01:19:11 2010(r212628) @@ -306,7 +306,9 @@ struct aac_adapter_init { u_int32_t HostElapsedSeconds; /* ADAPTER_INIT_STRUCT_REVISION_4 begins here */ u_int32_t InitFlags; /* flags for supported features */ -#define AAC_INITFLAGS_NEW_COMM_SUPPORTED 1 +#defineAAC_INITFLAGS_NEW_COMM_SUPPORTED1 +#defineAAC_INITFLAGS_DRIVER_USES_UTC_TIME 0x10 +#defineAAC_INITFLAGS_DRIVER_SUPPORTS_PM0x20 u_int32_t MaxIoCommands; /* max outstanding commands */ u_int32_t MaxIoSize; /* largest I/O command */ u_int32_t MaxFibSize; /* largest FIB to adapter */ @@ -885,6 +887,17 @@ typedef enum { AifEnBatteryNeedsRecond,/* The battery needs reconditioning */ AifEnClusterEvent, /* Some cluster event */ AifEnDiskSetEvent, /* A disk set event occured. */ + AifEnContainerScsiEvent,/* a container event with no. and scsi id */ + AifEnPicBatteryEvent, /* An event gen. by pic_battery.c for an ABM */ + AifEnExpEvent, /* Exp. Event Type to replace CTPopUp messages */ + AifEnRAID6RebuildDone, /* RAID6 rebuild finished */ + AifEnSensorOverHeat,/* Heat Sensor indicate overheat */ + AifEnSensorCoolDown,/* Heat Sensor ind. cooled down after overheat */ + AifFeatureKeysModified, /* notif. of updated feature keys */ + AifApplicationExpirationEvent, /* notif. on app. expiration status */ + AifEnBackgroundConsistencyCheck,/* BCC notif. for NEC - DDTS 94700 */ + AifEnAddJBOD, /* A new JBOD type drive was created (30) */ + AifEnDeleteJBOD,/* A JBOD type drive was deleted (31) */ AifDriverNotifyStart=199, /* Notifies for host driver go here */ /* Host driver notifications start here */ AifDenMorphComplete,/* A morph operation completed */ ___ 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: r212629 - head/lib/libthr/thread
Author: davidxu Date: Wed Sep 15 01:21:30 2010 New Revision: 212629 URL: http://svn.freebsd.org/changeset/base/212629 Log: Move back IN_GCLIST flag into field tlflags, since thread list and gc list still share same lock. Modified: head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_private.h == --- head/lib/libthr/thread/thr_private.hWed Sep 15 01:19:11 2010 (r212628) +++ head/lib/libthr/thread/thr_private.hWed Sep 15 01:21:30 2010 (r212629) @@ -415,13 +415,13 @@ struct pthread { #define THR_FLAGS_PRIVATE 0x0001 #defineTHR_FLAGS_NEED_SUSPEND 0x0002 /* thread should be suspended */ #defineTHR_FLAGS_SUSPENDED 0x0004 /* thread is suspended */ -#defineTHR_FLAGS_IN_GCLIST 0x0008 /* thread in gc list */ -#defineTHR_FLAGS_DETACHED 0x0010 /* thread is detached */ +#defineTHR_FLAGS_DETACHED 0x0008 /* thread is detached */ /* Thread list flags; only set with thread list lock held. */ int tlflags; #defineTLFLAGS_GC_SAFE 0x0001 /* thread safe for cleaning */ #defineTLFLAGS_IN_TDLIST 0x0002 /* thread in all thread list */ +#defineTLFLAGS_IN_GCLIST 0x0004 /* thread in gc list */ /* Queue of currently owned NORMAL or PRIO_INHERIT type mutexes. */ struct mutex_queue mutexq; @@ -559,16 +559,16 @@ do { \ } \ } while (0) #defineTHR_GCLIST_ADD(thrd) do { \ - if (((thrd)->flags & THR_FLAGS_IN_GCLIST) == 0) { \ + if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) == 0) { \ TAILQ_INSERT_HEAD(&_thread_gc_list, thrd, gcle);\ - (thrd)->flags |= THR_FLAGS_IN_GCLIST; \ + (thrd)->tlflags |= TLFLAGS_IN_GCLIST; \ _gc_count++;\ } \ } while (0) #defineTHR_GCLIST_REMOVE(thrd) do {\ - if (((thrd)->flags & THR_FLAGS_IN_GCLIST) != 0) { \ + if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) != 0) { \ TAILQ_REMOVE(&_thread_gc_list, thrd, gcle); \ - (thrd)->flags &= ~THR_FLAGS_IN_GCLIST; \ + (thrd)->tlflags &= ~TLFLAGS_IN_GCLIST; \ _gc_count--;\ } \ } while (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"
Re: svn commit: r212558 - head/usr.bin
On 9/13/2010 8:30 AM, Warner Losh wrote: Author: imp Date: Mon Sep 13 15:30:09 2010 New Revision: 212558 URL: http://svn.freebsd.org/changeset/base/212558 Log: Move to using Makefile.arch to include the proper target-specific programs. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Mon Sep 13 15:19:49 2010(r212557) +++ head/usr.bin/Makefile Mon Sep 13 15:30:09 2010(r212558) @@ -11,48 +11,29 @@ SUBDIR= alias \ apply \ - ${_ar} \ .if ${MK_TOOLCHAIN} != "no" -_ar= ar +SUBDIR+= ar I'm curious about why you're changing the method we use to switch optional elements. The change seems gratuitous to me, but I'm willing to be persuaded. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover!http://SupersetSolutions.com/ ___ 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: r212558 - head/usr.bin
In message: <4c9020c5.90...@freebsd.org> Doug Barton writes: : On 9/13/2010 8:30 AM, Warner Losh wrote: : > Author: imp : > Date: Mon Sep 13 15:30:09 2010 : > New Revision: 212558 : > URL: http://svn.freebsd.org/changeset/base/212558 : > : > Log: : >Move to using Makefile.arch to include the proper target-specific : >programs. : > : > Modified: : >head/usr.bin/Makefile : > : > Modified: head/usr.bin/Makefile : > == : > --- head/usr.bin/Makefile Mon Sep 13 15:19:49 2010(r212557) : > +++ head/usr.bin/Makefile Mon Sep 13 15:30:09 2010 (r212558) : > @@ -11,48 +11,29 @@ : > : > SUBDIR= alias \ : > apply \ : > - ${_ar} \ : : > .if ${MK_TOOLCHAIN} != "no" : > -_ar= ar : : > +SUBDIR+= ar : : : I'm curious about why you're changing the method we use to switch : optional elements. The change seems gratuitous to me, but I'm willing : to be persuaded. I posted these exact patches many times to arch@ and while people commented on other aspects of the change, no body ever commented on this aspect of the change (apart from comments about how to do it better). That's why I specifically said that there was no objection from arch@ for these changes. Doing things this way makes it easier for different architectures to subset or augment the directories to build (and it makes it a lot easier to know what's built on a given architecture). They can be concentrated into individual Makefiles that are easier to select on. MIPS and ARM are both moving to having multiple names (powerpc moved a couple of months ago) and the current arrangement doesn't scale well in the face of these changes. It is far from gratuitous. Warner ___ 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: r212630 - in head/lib/libthr: . thread
Author: davidxu Date: Wed Sep 15 02:56:32 2010 New Revision: 212630 URL: http://svn.freebsd.org/changeset/base/212630 Log: add code to support stack unwinding when thread exits. note that only defer-mode cancellation works, asynchrnous mode does not work because it lacks of libuwind's support. stack unwinding is not enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. Modified: head/lib/libthr/Makefile head/lib/libthr/thread/thr_clean.c head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/Makefile == --- head/lib/libthr/MakefileWed Sep 15 01:21:30 2010(r212629) +++ head/lib/libthr/MakefileWed Sep 15 02:56:32 2010(r212630) @@ -25,6 +25,14 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline + +LIBTHR_UNWIND_STACK=yes + +.ifdef LIBTHR_UNWIND_STACK +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions +CFLAGS+=-D_PTHREAD_FORCED_UNWIND +.endif + LDFLAGS+=-Wl,-znodelete VERSION_DEF=${.CURDIR}/../libc/Versions.def Modified: head/lib/libthr/thread/thr_clean.c == --- head/lib/libthr/thread/thr_clean.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_clean.c Wed Sep 15 02:56:32 2010 (r212630) @@ -78,6 +78,9 @@ __pthread_cleanup_pop_imp(int execute) void _pthread_cleanup_push(void (*routine) (void *), void *arg) { +#ifdef _PTHREAD_FORCED_UNWIND + PANIC("_pthread_cleanup_push is not supported while stack unwinding is enabled."); +#else struct pthread *curthread = _get_curthread(); struct pthread_cleanup *newbuf; @@ -89,10 +92,15 @@ _pthread_cleanup_push(void (*routine) (v newbuf->prev = curthread->cleanup; curthread->cleanup = newbuf; } +#endif } void _pthread_cleanup_pop(int execute) { +#ifdef _PTHREAD_FORCED_UNWIND + PANIC("_pthread_cleanup_pop is not supported while stack unwinding is enabled."); +#else __pthread_cleanup_pop_imp(execute); +#endif } Modified: head/lib/libthr/thread/thr_create.c == --- head/lib/libthr/thread/thr_create.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_create.c Wed Sep 15 02:56:32 2010 (r212630) @@ -264,6 +264,11 @@ thread_start(struct pthread *curthread) __sys_sigprocmask(SIG_SETMASK, &set, NULL); } +#ifdef _PTHREAD_FORCED_UNWIND + curthread->unwind_stackend = (char *)curthread->attr.stackaddr_attr + + curthread->attr.stacksize_attr; +#endif + /* Run the current thread's start routine with argument: */ _pthread_exit(curthread->start_routine(curthread->arg)); Modified: head/lib/libthr/thread/thr_exit.c == --- head/lib/libthr/thread/thr_exit.c Wed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/thread/thr_exit.c Wed Sep 15 02:56:32 2010 (r212630) @@ -31,6 +31,9 @@ #include "namespace.h" #include +#ifdef _PTHREAD_FORCED_UNWIND +#include +#endif #include #include #include @@ -43,8 +46,125 @@ void _pthread_exit(void *status); +static voidexit_thread(void) __dead2; + __weak_reference(_pthread_exit, pthread_exit); +#ifdef _PTHREAD_FORCED_UNWIND + +static void thread_unwind(void) __dead2; +#ifdef PIC +static void thread_uw_init(void); +static _Unwind_Reason_Code thread_unwind_stop(int version, + _Unwind_Action actions, + _Unwind_Exception_Class exc_class, + struct _Unwind_Exception *exc_obj, + struct _Unwind_Context *context, void *stop_parameter); +/* unwind library pointers */ +static _Unwind_Reason_Code (*uwl_forcedunwind)(struct _Unwind_Exception *, + _Unwind_Stop_Fn, void *); +static void (*uwl_resume)(struct _Unwind_Exception *exc); +static _Unwind_Word (*uwl_getcfa)(struct _Unwind_Context *); + +static void +thread_uw_init(void) +{ + static int inited = 0; + void *handle; + + if (inited) + return; + inited = 1; + handle = RTLD_DEFAULT; + if ((uwl_forcedunwind = dlsym(handle, "_Unwind_ForcedUnwind")) == NULL|| + (uwl_resume = dlsym(handle, "_Unwind_Resume")) == NULL || + (uwl_getcfa = dlsym(handle, "_Unwind_GetCFA")) == NULL) { + uwl_forcedunwind = NULL; + return; + } +} + +void +_Unwind_Resume(struct _Unwind_Exception *ex) +{ + (*uwl_resume)(ex); +} + +_Unwind_Reason_Code +_Unwind_ForcedUnwind(struct _Unwind_Exception *ex, _Unwind_Stop_Fn stop_func, + void *stop_arg) +{ + return (*uwl_for
Re: svn commit: r212630 - in head/lib/libthr: . thread
David Xu wrote: Author: davidxu Date: Wed Sep 15 02:56:32 2010 New Revision: 212630 URL: http://svn.freebsd.org/changeset/base/212630 Log: add code to support stack unwinding when thread exits. note that only defer-mode cancellation works, asynchrnous mode does not work because it lacks of libuwind's support. stack unwinding is not enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. Modified: head/lib/libthr/Makefile head/lib/libthr/thread/thr_clean.c head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h I have enabled stack unwinding to see if it will cause any problem, if it does, it can be easily turned off in Makefile. ___ 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: r212630 - in head/lib/libthr: . thread
On Wed, 15 Sep 2010 02:56:33 + (UTC) David Xu wrote: > Author: davidxu > Date: Wed Sep 15 02:56:32 2010 > New Revision: 212630 > URL: http://svn.freebsd.org/changeset/base/212630 > > Log: > add code to support stack unwinding when thread exits. note that > only defer-mode cancellation works, asynchrnous mode does not work > because it lacks of libuwind's support. stack unwinding is not > enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. > > Modified: > head/lib/libthr/Makefile > head/lib/libthr/thread/thr_clean.c > head/lib/libthr/thread/thr_create.c > head/lib/libthr/thread/thr_exit.c > head/lib/libthr/thread/thr_init.c > head/lib/libthr/thread/thr_private.h > > Modified: head/lib/libthr/Makefile > == > --- head/lib/libthr/Makefile Wed Sep 15 01:21:30 2010 > (r212629) +++ head/lib/libthr/MakefileWed Sep 15 02:56:32 > 2010 (r212630) @@ -25,6 +25,14 @@ > CFLAGS+=-I${.CURDIR}/../../libexec/rtld- > CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} > CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline > + > +LIBTHR_UNWIND_STACK=yes > + > +.ifdef LIBTHR_UNWIND_STACK > +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions > +CFLAGS+=-D_PTHREAD_FORCED_UNWIND > +.endif > + > Reaching into bowels of GCC like that is never good. -- Alexander Kabaev signature.asc Description: PGP signature
Re: svn commit: r212630 - in head/lib/libthr: . thread
Alexander Kabaev wrote: On Wed, 15 Sep 2010 02:56:33 + (UTC) David Xu wrote: Author: davidxu Date: Wed Sep 15 02:56:32 2010 New Revision: 212630 URL: http://svn.freebsd.org/changeset/base/212630 Log: add code to support stack unwinding when thread exits. note that only defer-mode cancellation works, asynchrnous mode does not work because it lacks of libuwind's support. stack unwinding is not enabled unless LIBTHR_UNWIND_STACK is defined in Makefile. Modified: head/lib/libthr/Makefile head/lib/libthr/thread/thr_clean.c head/lib/libthr/thread/thr_create.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/Makefile == --- head/lib/libthr/MakefileWed Sep 15 01:21:30 2010 (r212629) +++ head/lib/libthr/Makefile Wed Sep 15 02:56:32 2010(r212630) @@ -25,6 +25,14 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline + +LIBTHR_UNWIND_STACK=yes + +.ifdef LIBTHR_UNWIND_STACK +CFLAGS+=-I${.CURDIR}/../../contrib/gcc -fexceptions +CFLAGS+=-D_PTHREAD_FORCED_UNWIND +.endif + Reaching into bowels of GCC like that is never good. Any solution ? ;-) ___ 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: r212614 - in head: sbin/geom/class/part sys/geom/part
On Sep 14, 2010, at 9:21 AM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Tue Sep 14 16:21:13 2010 > New Revision: 212614 > URL: http://svn.freebsd.org/changeset/base/212614 > > Log: > - Change all places where G_TYPE_ASCNUM is used to G_TYPE_NUMBER. >It turns out the new type wasn't really needed. > - Reorganize code a little bit. Please revert. The gpart ctlreq interface is ASCII only by design. This change is unnecessary as nothing was broken and on top of that breaks compatibility with user-space -- again entirely without merit. Thanks, -- Marcel Moolenaar xcl...@mac.com ___ 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: r212631 - head/share/man/man4
Author: mav Date: Wed Sep 15 04:51:07 2010 New Revision: 212631 URL: http://svn.freebsd.org/changeset/base/212631 Log: Add hpet(4) man page. Added: head/share/man/man4/hpet.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileWed Sep 15 02:56:32 2010 (r212630) +++ head/share/man/man4/MakefileWed Sep 15 04:51:07 2010 (r212631) @@ -133,6 +133,7 @@ MAN=aac.4 \ hfa.4 \ hifn.4 \ hme.4 \ + hpet.4 \ ${_hptiop.4} \ ${_hptmv.4} \ ${_hptrr.4} \ @@ -544,6 +545,7 @@ MLINKS+=gif.4 if_gif.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 +MLINKS+=hpet.4 acpi_hpet.4 MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=idt.4 if_idt.4 MLINKS+=igb.4 if_igb.4 Added: head/share/man/man4/hpet.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/hpet.4 Wed Sep 15 04:51:07 2010(r212631) @@ -0,0 +1,105 @@ +.\" Copyright (c) 2009 Alexander Motin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" 3. The name of the author may not be used to endorse or promote products +.\"derived from this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 14, 2010 +.Dt HPET 4 +.Os +.Sh NAME +.Nm hpet +.Nd High Precision Event Timer driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device acpi" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hint.hpet. Ns Ar X Ns Va .allowed_irqs +is a 32bit mask. Each set bit allows driver to use respective IRQ, +if BIOS also set respective capability bit in comparator's configuration +register. +Default value is 0x, except some known broken hardware. +.It Va hint.hpet. Ns Ar X Ns Va .clock +controls event timers functionality support. Setting to 0, disables it. +Default value is 1. +.It Va hint.hpet. Ns Ar X Ns Va .legacy_route +controls "LegacyReplacement Route" mode. If enabled, HPET will steal IRQ0 of +i8254 timer and IRQ8 of RTC. Before using it, make sure that respective +drivers are not using interrupts, by setting also: +.Bd -literal +hint.attimer.0.clock=0 +hint.atrtc.0.clock=0 +.Ed +Default value is 0. +.It Va hint.hpet. Ns Ar X Ns Va .per_cpu +controls how much per-CPU event timers should driver attempt to register. +This functionality requires every comparator in a group to have own unshared +IRQ, so it depends on hardware capabilities and interrupts configuration. +Default value is 1. +.El +.Sh DESCRIPTION +This driver uses High Precision Event Timer hardware (part of the chipset, +usually enumerated via ACPI) to supply kernel with one time counter and +several (usually from 3 to 8) event timers. +This hardware includes single main counter with known increment frequency +(10MHz or more), and several programable comparators (optionally with +automatic reload feature). +When value of the main counter matches current value of any comparator, +interrupt can be generated. +Depending on hardware capabilities and configuration, interrupt can be +delivered as regular I/O APIC interrupt (ISA or PCI) in range from 0 to 31, +or as Front Side Bus interrupt, alike to PCI MSI interrupts, or in so called +"LegacyReplacement Route" HPET can speal IRQ0 of i8254 and IRQ8 of the RTC. +Interrupt can be either edge- or level-triggered. In last case they could be +s
svn commit: r212632 - in head/sys/mips: cavium include mips sibyte
Author: neel Date: Wed Sep 15 05:10:50 2010 New Revision: 212632 URL: http://svn.freebsd.org/changeset/base/212632 Log: Make the meaning of the 'mask' argument to 'set_intr_mask(mask)' consistent with the meaning of IM bits in the status register. Reviewed by: jmallett, jchandra Modified: head/sys/mips/cavium/octeon_mp.c head/sys/mips/include/cpufunc.h head/sys/mips/mips/machdep.c head/sys/mips/mips/trap.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/cavium/octeon_mp.c == --- head/sys/mips/cavium/octeon_mp.cWed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/cavium/octeon_mp.cWed Sep 15 05:10:50 2010 (r212632) @@ -96,7 +96,7 @@ platform_init_ap(int cpuid) */ clock_int_mask = hard_int_mask(5); ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); - set_intr_mask(MIPS_SR_INT_MASK & ~(ipi_int_mask | clock_int_mask)); + set_intr_mask(ipi_int_mask | clock_int_mask); mips_wbflush(); } Modified: head/sys/mips/include/cpufunc.h == --- head/sys/mips/include/cpufunc.h Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/include/cpufunc.h Wed Sep 15 05:10:50 2010 (r212632) @@ -272,7 +272,7 @@ set_intr_mask(uint32_t mask) uint32_t ostatus; ostatus = mips_rd_status(); - mask = (ostatus & ~MIPS_SR_INT_MASK) | (~mask & MIPS_SR_INT_MASK); + mask = (ostatus & ~MIPS_SR_INT_MASK) | (mask & MIPS_SR_INT_MASK); mips_wr_status(mask); return (ostatus); } Modified: head/sys/mips/mips/machdep.c == --- head/sys/mips/mips/machdep.cWed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/mips/machdep.cWed Sep 15 05:10:50 2010 (r212632) @@ -356,7 +356,7 @@ mips_vector_init(void) * Mask all interrupts. Each interrupt will be enabled * when handler is installed for it */ - set_intr_mask(MIPS_SR_INT_MASK); + set_intr_mask(0); /* Clear BEV in SR so we start handling our own exceptions */ mips_wr_status(mips_rd_status() & ~MIPS_SR_BEV); Modified: head/sys/mips/mips/trap.c == --- head/sys/mips/mips/trap.c Wed Sep 15 04:51:07 2010(r212631) +++ head/sys/mips/mips/trap.c Wed Sep 15 05:10:50 2010(r212632) @@ -304,7 +304,7 @@ trap(struct trapframe *trapframe) * return to userland. */ if (trapframe->sr & MIPS_SR_INT_IE) { - set_intr_mask(~(trapframe->sr & MIPS_SR_INT_MASK)); + set_intr_mask(trapframe->sr & MIPS_SR_INT_MASK); intr_enable(); } else { intr_disable(); Modified: head/sys/mips/sibyte/sb_machdep.c == --- head/sys/mips/sibyte/sb_machdep.c Wed Sep 15 04:51:07 2010 (r212631) +++ head/sys/mips/sibyte/sb_machdep.c Wed Sep 15 05:10:50 2010 (r212632) @@ -370,7 +370,7 @@ platform_init_ap(int cpuid) */ clock_int_mask = hard_int_mask(5); ipi_int_mask = hard_int_mask(platform_ipi_intrnum()); - set_intr_mask(MIPS_SR_INT_MASK & ~(ipi_int_mask | clock_int_mask)); + set_intr_mask(ipi_int_mask | clock_int_mask); } int ___ 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: r212633 - head/sys/mips/conf
Author: neel Date: Wed Sep 15 05:29:13 2010 New Revision: 212633 URL: http://svn.freebsd.org/changeset/base/212633 Log: Factor out the common parts of the swarm board in SWARM_COMMON and start including that in SWARM and SWARM_SMP kernel configs. Added: head/sys/mips/conf/SWARM_COMMON (contents, props changed) Modified: head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM_SMP Modified: head/sys/mips/conf/SWARM == --- head/sys/mips/conf/SWARMWed Sep 15 05:10:50 2010(r212632) +++ head/sys/mips/conf/SWARMWed Sep 15 05:29:13 2010(r212633) @@ -2,69 +2,11 @@ # $FreeBSD$ # -ident SWARM -optionsCPU_SB1 +includeSWARM_COMMON -files "../sibyte/files.sibyte" -hints "SWARM.hints" +ident SWARM -optionsCFE -optionsCFE_CONSOLE -optionsCFE_ENV -optionsALT_BREAK_TO_DEBUGGER +optionsISA_MIPS32 +makeoptionsARCH_FLAGS="-mabi=32 -march=mips32" makeoptionsLDSCRIPT_NAME= ldscript.mips.cfe - -#cpu CPU_MIPS64 -#options ISA_MIPS64 -#makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" -cpuCPU_MIPS32 -optionsISA_MIPS32 -makeoptionsARCH_FLAGS="-march=mips32" - -makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols -makeoptionsMODULES_OVERRIDE="" - -optionsDDB -optionsKDB - -optionsSCHED_4BSD #4BSD scheduler -optionsINET#InterNETworking -optionsNFSCLIENT #Network Filesystem Client -optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT -optionsPSEUDOFS#Pseudo-filesystem framework -options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions - -# Debugging for use in -current -#options DEADLKRES -optionsINVARIANTS -optionsINVARIANT_SUPPORT -optionsWITNESS - -optionsFFS #Fast filesystem - -optionsKTRACE - -device pci -device miibus -device bge -device loop -device ether -device md -device random - -optionsUSB_DEBUG -device usb -device ohci -device uhci -device ehci - -device umass - -device scbus -device da - -device ata -device atadisk -device atapicd -optionsATA_STATIC_ID Added: head/sys/mips/conf/SWARM_COMMON == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM_COMMON Wed Sep 15 05:29:13 2010 (r212633) @@ -0,0 +1,60 @@ +# +# $FreeBSD$ +# + +files "../sibyte/files.sibyte" +hints "SWARM.hints" + +optionsCFE +optionsCFE_CONSOLE +optionsCFE_ENV +optionsALT_BREAK_TO_DEBUGGER + +cpuCPU_SB1 + +makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols +makeoptionsMODULES_OVERRIDE="" + +optionsDDB +optionsKDB + +optionsSCHED_4BSD #4BSD scheduler +optionsINET#InterNETworking +optionsNFSCLIENT #Network Filesystem Client +optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsPSEUDOFS#Pseudo-filesystem framework +options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Debugging for use in -current +#options DEADLKRES +optionsINVARIANTS +optionsINVARIANT_SUPPORT +optionsWITNESS + +optionsFFS #Fast filesystem + +optionsKTRACE + +device pci +device miibus +device bge +device loop +device ether +device md +device random + +optionsUSB_DEBUG +device usb +device ohci +device uhci +device ehci + +device umass + +device scbus +device da + +device ata +device atadisk +device atapicd +optionsATA_STATIC_ID Modified: head/sys/mips/conf/SWARM_SMP == --- head/sys/mips/conf/SWARM_SMPWed Sep 15 05:10:50 2010 (r212632) +++ head/sys/mips/conf/SWARM_SMPWed Sep 15 05:29:13 2010 (r212633) @@ -1,7 +1,15 @@ # # $FreeBSD$ # + +includeSWARM_COMMON + +ident SWARM_SMP + optionsSMP optionsPRINTF_BUFR_SIZE=128 -includeSWARM +options
svn commit: r212634 - in head/sys: conf mips/conf
Author: neel Date: Wed Sep 15 05:32:10 2010 New Revision: 212634 URL: http://svn.freebsd.org/changeset/base/212634 Log: Add 64-bit SWARM board kernel configs. Added: head/sys/conf/ldscript.mips.64.cfe (contents, props changed) head/sys/mips/conf/SWARM64 (contents, props changed) head/sys/mips/conf/SWARM64_SMP (contents, props changed) Added: head/sys/conf/ldscript.mips.64.cfe == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.64.cfe Wed Sep 15 05:32:10 2010 (r212634) @@ -0,0 +1,320 @@ +/*- + * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Juniper Networks, Inc. nor the names of its + *contributors may be used to endorse or promote products derived from + *this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JUNIPER NETWORKS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JUNIPER NETWORKS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 + * $FreeBSD$ + */ + +/* + * This linker script is needed to build a kernel for use by Broadcom CFE + * when loaded over TFTP; its ELF loader does not support backwards seek + * on network I/O streams. + * Furthermore, CFE will only load PT_LOAD segments, therefore the dynamic + * sections must be placed in their own segment. + */ + +OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") + +OUTPUT_ARCH(mips) +ENTRY(_start) +SEARCH_DIR(/usr/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); +*/ + +PHDRS +{ + headers PT_PHDR FILEHDR PHDRS ; + interp PT_INTERP ; + text PT_LOAD ; + dynamic PT_LOAD ; + data PT_LOAD ; +} + +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = KERNLOADADDR ; + .interp : { *(.interp) } :interp + .hash : { *(.hash) } :text + .dynsym: { *(.dynsym)} + .dynstr: { *(.dynstr)} + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : +{ + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t.*) +} + .rela.text : +{ + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t.*) +} + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata: +{ + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r.*) +} + .rela.rodata : +{ + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r.*) +} + .rel.data : +{ + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d.*) +} + .rela.data : +{ + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d.*) +} + .rel.ctors : { *(.rel.ctors) } + .rela.ctors: { *(.rela.ctors)} + .rel.dtors : { *(.rel.dtors) } + .rela.dtors: { *(.rela.dtors)} + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : +{ + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s.*) +} + .rela.sdata : +{ + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s.*) +} + .rel.sbss : +{ + *(.rel.sbss) + *(.rel.sbss.*) + *(.rel.gnu.linkonce.sb.*) +} + .rela.sbss : +{ + *(.rela.sbss) + *(.rela.sbss.*) + *(.rel.gnu.linkonce.sb.*) +} + .rel.sdata2: