svn commit: r264038 - head/lib/libc/locale
Author: theraven Date: Wed Apr 2 11:10:46 2014 New Revision: 264038 URL: http://svnweb.freebsd.org/changeset/base/264038 Log: Fix an issue where the locale and rune locale could become out of sync, causing mb* functions (and similar) to be called with the wrong data (possibly a null pointer, causing a crash). PR: standards/188036 MFC after:1 week Modified: head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/xlocale.c Modified: head/lib/libc/locale/setrunelocale.c == --- head/lib/libc/locale/setrunelocale.cWed Apr 2 10:57:11 2014 (r264037) +++ head/lib/libc/locale/setrunelocale.cWed Apr 2 11:10:46 2014 (r264038) @@ -202,6 +202,8 @@ __set_thread_rune_locale(locale_t loc) if (loc == NULL) { _ThreadRuneLocale = _DefaultRuneLocale; + } else if (loc == LC_GLOBAL_LOCALE) { + _ThreadRuneLocale = 0; } else { _ThreadRuneLocale = XLOCALE_CTYPE(loc)-runes; } Modified: head/lib/libc/locale/xlocale.c == --- head/lib/libc/locale/xlocale.c Wed Apr 2 10:57:11 2014 (r264037) +++ head/lib/libc/locale/xlocale.c Wed Apr 2 11:10:46 2014 (r264038) @@ -154,23 +154,24 @@ __get_locale(void) static void set_thread_locale(locale_t loc) { + locale_t l = (loc == LC_GLOBAL_LOCALE) ? 0 : loc; _once(once_control, init_key); - if (NULL != loc) { - xlocale_retain((struct xlocale_refcounted*)loc); + if (NULL != l) { + xlocale_retain((struct xlocale_refcounted*)l); } locale_t old = pthread_getspecific(locale_info_key); - if ((NULL != old) (loc != old)) { + if ((NULL != old) (l != old)) { xlocale_release((struct xlocale_refcounted*)old); } if (fake_tls) { - thread_local_locale = loc; + thread_local_locale = l; } else { - pthread_setspecific(locale_info_key, loc); + pthread_setspecific(locale_info_key, l); } #ifndef __NO_TLS - __thread_locale = loc; + __thread_locale = l; __set_thread_rune_locale(loc); #endif } @@ -361,9 +362,6 @@ locale_t uselocale(locale_t loc) { locale_t old = get_thread_locale(); if (NULL != loc) { - if (LC_GLOBAL_LOCALE == loc) { - loc = NULL; - } set_thread_locale(loc); } return (old ? old : LC_GLOBAL_LOCALE); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264039 - head/sbin/geom/class/part
Author: ae Date: Wed Apr 2 11:12:48 2014 New Revision: 264039 URL: http://svnweb.freebsd.org/changeset/base/264039 Log: Document more parition types. Requested by: glebius MFC after:1 week Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Wed Apr 2 11:10:46 2014 (r264038) +++ head/sbin/geom/class/part/gpart.8 Wed Apr 2 11:12:48 2014 (r264039) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd July 1, 2013 +.Dd April 2, 2014 .Dt GPART 8 .Os .Sh NAME @@ -557,6 +557,16 @@ Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li !c12a7328-f81f-11d2-ba4b-00a0c93ec93b . +.It Cm fat16 +A partition that contains a FAT16 filesystem. +The scheme-specific type is +.Qq Li !6 +for MBR. +.It Cm fat32 +A partition that contains a FAT32 filesystem. +The scheme-specific type is +.Qq Li !11 +for MBR. .It Cm freebsd A .Fx @@ -620,6 +630,16 @@ A partition that is sub-partitioned by a This type is known as .Qq Li !024dee41-33e7-11d3-9d69-0008c781f39f by GPT. +.It Cm ms-basic-data +A basic data partition (BDP) for Microsoft operating systems. +In the GPT this type is the equivalent to partition types +.Cm fat16 , fat32 +and +.Cm ntfs +in MBR. +The scheme-specific type is +.Qq Li !ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 +for GPT. .It Cm ms-ldm-data A partition that contains Logical Disk Manager (LDM) volumes. The scheme-specific types are @@ -632,6 +652,11 @@ A partition that contains Logical Disk M The scheme-specific type is .Qq Li !5808c8aa-7e8f-42e0-85d2-e1e90434cfb3 for GPT. +.It Cm ntfs +A partition that contains a NTFS or exFAT filesystem. +The scheme-specific type is +.Qq Li !7 +for MBR. .El .Sh ATTRIBUTES The scheme-specific attributes for EBR: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264025 - head/sys/dev/iscsi
On Tue, 2014-04-01 at 22:03 +, Edward Tomasz Napierala wrote: Author: trasz Date: Tue Apr 1 22:03:03 2014 New Revision: 264025 URL: http://svnweb.freebsd.org/changeset/base/264025 Log: Get rid of the autoscaling, instead just set socket buffer sizes in the usual way. The only thing the old code did was making things less predictable. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c == --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:54:20 2014(r264024) +++ head/sys/dev/iscsi/icl.c Tue Apr 1 22:03:03 2014(r264025) @@ -68,6 +68,14 @@ TUNABLE_INT(kern.icl.partial_receive_le SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, partial_receive_len, 1 * 1024, Minimum read size for partially received data segment); +static int sendspace = 1048576; +TUNABLE_INT(kern.icl.sendspace, sendspace); +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, +sendspace, 1048576, Default send socket buffer size); +static int recvspace = 1048576; +TUNABLE_INT(kern.icl.recvspace, recvspace); +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, +recvspace, 1048576, Default receive socket buffer size); static uma_zone_t icl_conn_zone; static uma_zone_t icl_pdu_zone; @@ -1008,7 +1016,7 @@ icl_conn_free(struct icl_conn *ic) static int icl_conn_start(struct icl_conn *ic) { - size_t bufsize; + size_t minspace; struct sockopt opt; int error, one = 1; @@ -1029,18 +1037,28 @@ icl_conn_start(struct icl_conn *ic) ICL_CONN_UNLOCK(ic); /* - * Use max available sockbuf size for sending. Do it manually - * instead of sbreserve(9) to work around resource limits. + * For sendspace, this is required because the current code cannot + * send a PDU in pieces; thus, the minimum buffer size is equal + * to the maximum PDU size. +4 is to account for possible padding. * - * XXX: This kind of sucks. On one hand, we don't currently support - * sending a part of data segment; we always do it in one piece, - * so we have to make sure it can fit in the socket buffer. - * Once I've implemented partial send, we'll get rid of this - * and use autoscaling. + * What we should actually do here is to use autoscaling, but set + * some minimal buffer size to minspace. I don't know a way to do + * that, though. */ -bufsize = (sizeof(struct iscsi_bhs) + -ic-ic_max_data_segment_length) * 8; - error = soreserve(ic-ic_socket, bufsize, bufsize); + minspace = sizeof(struct iscsi_bhs) + ic-ic_max_data_segment_length + + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; + if (sendspace minspace) { + ICL_WARN(kern.icl.sendspace too low; must be at least %jd, + minspace); + sendspace = minspace; + } + if (recvspace minspace) { + ICL_WARN(kern.icl.recvspace too low; must be at least %jd, + minspace); + recvspace = minspace; + } + The %jd on these is causing build failures on 32-bit arches due to size_t being only 32 bits. -- Ian + error = soreserve(ic-ic_socket, sendspace, recvspace); if (error != 0) { ICL_WARN(soreserve failed with error %d, error); icl_conn_close(ic); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264040 - in head: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace
Author: pfg Date: Wed Apr 2 15:32:44 2014 New Revision: 264040 URL: http://svnweb.freebsd.org/changeset/base/264040 Log: MFV r258379; 4248 dtrace(1M) should never create DOF with empty probes section 4249 Only probes from the first DTrace object file will be included Illumos Revision: 4a20ab41aadcb81c53e72fc65886e964e9add59 Reference: https://www.illumos.org/issues/4248 https://www.illumos.org/issues/4249 Obtained from:Illumos MFC after:1 month Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Wed Apr 2 11:12:48 2014(r264039) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Wed Apr 2 15:32:44 2014(r264040) @@ -22,6 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include sys/types.h @@ -486,7 +487,7 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident return (0); } -static void +static int dof_add_provider(dt_dof_t *ddo, const dt_provider_t *pvp) { dtrace_hdl_t *dtp = ddo-ddo_hdl; @@ -497,8 +498,12 @@ dof_add_provider(dt_dof_t *ddo, const dt size_t sz; id_t i; - if (pvp-pv_flags DT_PROVIDER_IMPL) - return; /* ignore providers that are exported by dtrace(7D) */ + if (pvp-pv_flags DT_PROVIDER_IMPL) { + /* +* ignore providers that are exported by dtrace(7D) +*/ + return (0); + } nxr = dt_popcb(pvp-pv_xrefs, pvp-pv_xrmax); dofs = alloca(sizeof (dof_secidx_t) * (nxr + 1)); @@ -525,6 +530,9 @@ dof_add_provider(dt_dof_t *ddo, const dt (void) dt_idhash_iter(pvp-pv_probes, dof_add_probe, ddo); + if (dt_buf_len(ddo-ddo_probes) == 0) + return (dt_set_errno(dtp, EDT_NOPROBES)); + dofpv.dofpv_probes = dof_add_lsect(ddo, NULL, DOF_SECT_PROBES, sizeof (uint64_t), 0, sizeof (dof_probe_t), dt_buf_len(ddo-ddo_probes)); @@ -579,6 +587,8 @@ dof_add_provider(dt_dof_t *ddo, const dt sizeof (dof_secidx_t), 0, sizeof (dof_secidx_t), sizeof (dof_secidx_t) * (nxr + 1)); } + + return (0); } static int @@ -822,8 +832,10 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtr */ if (flags DTRACE_D_PROBES) { for (pvp = dt_list_next(dtp-dt_provlist); - pvp != NULL; pvp = dt_list_next(pvp)) - dof_add_provider(ddo, pvp); + pvp != NULL; pvp = dt_list_next(pvp)) { + if (dof_add_provider(ddo, pvp) != 0) + return (NULL); + } } /* Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Wed Apr 2 11:12:48 2014(r264039) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c Wed Apr 2 15:32:44 2014(r264040) @@ -26,6 +26,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include string.h @@ -109,7 +110,8 @@ static const struct { { EDT_BADSTACKPC, Invalid stack program counter size }, { EDT_BADAGGVAR, Invalid aggregation variable identifier }, { EDT_OVERSION, Client requested deprecated version of library }, - { EDT_ENABLING_ERR, Failed to enable probe } + { EDT_ENABLING_ERR, Failed to enable probe }, + { EDT_NOPROBES, No probe sites found for declared provider } }; static const int _dt_nerr = sizeof (_dt_errlist) / sizeof (_dt_errlist[0]); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h == --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.hWed Apr 2 11:12:48 2014(r264039) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.hWed Apr 2 15:32:44 2014(r264040) @@ -25,7 +25,7 @@ */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ @@ -535,7 +535,8 @@ enum { EDT_BADSTACKPC, /* invalid stack program counter size */
Re: svn commit: r264027 - in head: release share/man/man7
On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso: 64% smaller disc1.iso: 44% smaller memstick.img: 47% smaller mini-memstick.img: 65% smaller dvd1.iso: untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). -- Brooks pgps07xLqr9a4.pgp Description: PGP signature
Re: svn commit: r264027 - in head: release share/man/man7
On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen pgplqQlypc4zQ.pgp Description: PGP signature
svn commit: r264041 - in head: share/man/man9 sys/kern sys/sys
Author: ian Date: Wed Apr 2 15:56:11 2014 New Revision: 264041 URL: http://svnweb.freebsd.org/changeset/base/264041 Log: Add support for event timers whose clock frequency can change while running. Modified: head/share/man/man9/eventtimers.9 head/sys/kern/kern_clocksource.c head/sys/kern/kern_et.c head/sys/sys/systm.h head/sys/sys/timeet.h Modified: head/share/man/man9/eventtimers.9 == --- head/share/man/man9/eventtimers.9 Wed Apr 2 15:32:44 2014 (r264040) +++ head/share/man/man9/eventtimers.9 Wed Apr 2 15:56:11 2014 (r264041) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 25, 2013 +.Dd April 2, 2014 .Dt EVENTTIMERS 9 .Os .Sh NAME @@ -68,6 +68,8 @@ struct eventtimer { .Fn et_register struct eventtimer *et .Ft int .Fn et_deregister struct eventtimer *et +.Ft void +.Fn et_change_frequency struct eventtimer *et uint64_t newfreq .Fn ET_LOCK .Fn ET_UNLOCK .Ft struct eventtimer * @@ -176,6 +178,21 @@ methods control timers associated with t .Pp Driver may deregister its functionality by calling .Fn et_deregister . +.Pp +If the frequency of the clock hardware can change while it is +running (for example, during power-saving modes), the driver must call +.Fn et_change_frequency +on each change. +If the given event timer is the active timer, +.Fn et_change_frequency +stops the timer on all CPUs, updates +.Va et-frequency , +then restarts the timer on all CPUs so that all +current events are rescheduled using the new frequency. +If the given timer is not currently active, +.Fn et_change_frequency +simply updates +.Va et-frequency . .Sh CONSUMER API .Fn et_find allows consumer to find available event timer, optionally matching specific Modified: head/sys/kern/kern_clocksource.c == --- head/sys/kern/kern_clocksource.cWed Apr 2 15:32:44 2014 (r264040) +++ head/sys/kern/kern_clocksource.cWed Apr 2 15:56:11 2014 (r264041) @@ -799,6 +799,25 @@ cpu_activeclock(void) spinlock_exit(); } +/* + * Change the frequency of the given timer. This changes et-et_frequency and + * if et is the active timer it reconfigures the timer on all CPUs. This is + * intended to be a private interface for the use of et_change_frequency() only. + */ +void +cpu_et_frequency(struct eventtimer *et, uint64_t newfreq) +{ + + ET_LOCK(); + if (et == timer) { + configtimer(0); + et-et_frequency = newfreq; + configtimer(1); + } else + et-et_frequency = newfreq; + ET_UNLOCK(); +} + #ifdef KDTRACE_HOOKS void clocksource_cyc_set(const struct bintime *bt) Modified: head/sys/kern/kern_et.c == --- head/sys/kern/kern_et.c Wed Apr 2 15:32:44 2014(r264040) +++ head/sys/kern/kern_et.c Wed Apr 2 15:56:11 2014(r264041) @@ -113,6 +113,18 @@ et_deregister(struct eventtimer *et) } /* + * Change the frequency of the given timer. If it is the active timer, + * reconfigure it on all CPUs (reschedules all current events based on the new + * timer frequency). + */ +void +et_change_frequency(struct eventtimer *et, uint64_t newfreq) +{ + + cpu_et_frequency(et, newfreq); +} + +/* * Find free event timer hardware with specified parameters. */ struct eventtimer * Modified: head/sys/sys/systm.h == --- head/sys/sys/systm.hWed Apr 2 15:32:44 2014(r264040) +++ head/sys/sys/systm.hWed Apr 2 15:56:11 2014(r264041) @@ -168,6 +168,7 @@ struct ucred; struct uio; struct _jmp_buf; struct trapframe; +struct eventtimer; intsetjmp(struct _jmp_buf *) __returns_twice; void longjmp(struct _jmp_buf *, int) __dead2; @@ -286,6 +287,7 @@ voidcpu_stopprofclock(void); sbintime_t cpu_idleclock(void); void cpu_activeclock(void); void cpu_new_callout(int cpu, sbintime_t bt, sbintime_t bt_opt); +void cpu_et_frequency(struct eventtimer *et, uint64_t newfreq); extern int cpu_can_deep_sleep; extern int cpu_disable_deep_sleep; Modified: head/sys/sys/timeet.h == --- head/sys/sys/timeet.h Wed Apr 2 15:32:44 2014(r264040) +++ head/sys/sys/timeet.h Wed Apr 2 15:56:11 2014(r264041) @@ -89,6 +89,7 @@ extern struct mtx et_eventtimers_mtx; /* Driver API */ intet_register(struct eventtimer *et); intet_deregister(struct eventtimer *et); +void et_change_frequency(struct eventtimer *et, uint64_t newfreq); /* Consumer API */ struct eventtimer *et_find(const char *name, int check, int want); intet_init(struct eventtimer *et, et_event_cb_t *event,
Re: svn commit: r264027 - in head: release share/man/man7
On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. - Nikolai Lifanov ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264027 - in head: release share/man/man7
On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso: 64% smaller disc1.iso: 44% smaller memstick.img: 47% smaller mini-memstick.img: 65% smaller dvd1.iso: untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen pgpyfKDz6Cw7Z.pgp Description: PGP signature
svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib
Author: theraven Date: Wed Apr 2 16:07:48 2014 New Revision: 264042 URL: http://svnweb.freebsd.org/changeset/base/264042 Log: Add support for some block functions that come from OS X. These are intended to build with any C compiler. Reviewed by: pfg MFC after:3 weeks Added: head/lib/libc/gen/scandir_b.c (contents, props changed) head/lib/libc/include/block_abi.h (contents, props changed) head/lib/libc/stdlib/bsearch_b.c (contents, props changed) head/lib/libc/stdlib/heapsort_b.c (contents, props changed) head/lib/libc/stdlib/mergesort_b.c (contents, props changed) Modified: head/include/dirent.h head/include/stdlib.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/scandir.3 head/lib/libc/gen/scandir.c head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/atexit.3 head/lib/libc/stdlib/atexit.c head/lib/libc/stdlib/bsearch.c head/lib/libc/stdlib/heapsort.c head/lib/libc/stdlib/merge.c head/lib/libc/stdlib/qsort.3 head/lib/libc/stdlib/qsort_r.c Modified: head/include/dirent.h == --- head/include/dirent.h Wed Apr 2 15:56:11 2014(r264041) +++ head/include/dirent.h Wed Apr 2 16:07:48 2014(r264042) @@ -95,6 +95,11 @@ void rewinddir(DIR *); int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); +#ifdef __BLOCKS__ +int scandir_b(const char *, struct dirent ***, + int (^)(const struct dirent *), + int (^)(const struct dirent **, const struct dirent **)); +#endif #endif #if __XSI_VISIBLE voidseekdir(DIR *, long); Modified: head/include/stdlib.h == --- head/include/stdlib.h Wed Apr 2 15:56:11 2014(r264041) +++ head/include/stdlib.h Wed Apr 2 16:07:48 2014(r264042) @@ -82,6 +82,9 @@ extern int ___mb_cur_max(void); _Noreturn void abort(void); int abs(int) __pure2; int atexit(void (*)(void)); +#ifdef __BLOCKS__ +int atexit_b(void (^)(void)); +#endif double atof(const char *); int atoi(const char *); longatol(const char *); @@ -100,6 +103,10 @@ size_t mbstowcs(wchar_t * __restrict , int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); voidqsort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +voidqsort_b(void *, size_t, size_t, + int (^)(const void *, const void *)); +#endif int rand(void); void *realloc(void *, size_t); voidsrand(unsigned); @@ -280,8 +287,14 @@ const char * getprogname(void); int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +#endif int l64a_r(long, char *, int); int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +#endif int mkostemp(char *, int); int mkostemps(char *, int, int); voidqsort_r(void *, size_t, size_t, void *, Modified: head/lib/libc/gen/Symbol.map == --- head/lib/libc/gen/Symbol.mapWed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/gen/Symbol.mapWed Apr 2 16:07:48 2014 (r264042) @@ -349,6 +349,7 @@ FBSD_1.1 { posix_spawnattr_setsigdefault; posix_spawnattr_setsigmask; posix_spawnp; + scandir_b; semctl; tcgetsid; tcsetsid; Modified: head/lib/libc/gen/scandir.3 == --- head/lib/libc/gen/scandir.3 Wed Apr 2 15:56:11 2014(r264041) +++ head/lib/libc/gen/scandir.3 Wed Apr 2 16:07:48 2014(r264042) @@ -42,6 +42,8 @@ .Ft int .Fn scandir const char *dirname struct dirent ***namelist int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp .Ft int +.Fn scandir_b const char *dirname struct dirent ***namelist int \*(lp*select\^(rp\*(lpconst struct dirent *\*(rp int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp +.Ft int .Fn alphasort const struct dirent **d1 const struct dirent **d2 .Sh DESCRIPTION The @@ -87,6 +89,15 @@ argument to sort the array alphabeticall The memory allocated for the array can be deallocated with .Xr free 3 , by freeing each pointer in the array and then the array itself. +.Pp +The +.Fn scandir_b +function behaves in the same way as +.Fn scandir , +but takes blocks as arguments instead of function pointers and calls +.Fn qsort_b +rather than +.Fn
Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib
On Wed, Apr 02, 2014 at 04:07:48PM +, David Chisnall wrote: Modified: head/lib/libc/gen/Symbol.map == --- head/lib/libc/gen/Symbol.map Wed Apr 2 15:56:11 2014 (r264041) +++ head/lib/libc/gen/Symbol.map Wed Apr 2 16:07:48 2014 (r264042) @@ -349,6 +349,7 @@ FBSD_1.1 { posix_spawnattr_setsigdefault; posix_spawnattr_setsigmask; posix_spawnp; + scandir_b; semctl; tcgetsid; tcsetsid; This is completely wrong. You cannot modify FreeBSD 8.x namespace in 11.x HEAD time. Also, the ABI of the libc now depends on the compiler which was used to build the library, which is also wrong and ugly. pgpQRETzN_VtQ.pgp Description: PGP signature
Re: svn commit: r264027 - in head: release share/man/man7
On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso: 64% smaller disc1.iso: 44% smaller memstick.img: 47% smaller mini-memstick.img: 65% smaller dvd1.iso: untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. - Nikolai Lifanov ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib
On 2 Apr 2014, at 17:18, Konstantin Belousov kostik...@gmail.com wrote: This is completely wrong. You cannot modify FreeBSD 8.x namespace in 11.x HEAD time. That was an error, however we are using symbol versioning completely wrongly in FreeBSD anyway (see the last two DevSummit discussions and the wiki page). New entries should *always* go in the version 0 namespace (so that when they're MFCd the changes Just Work™) and only ever be moved out of there when they are replaced with versions with different semantics. The weird hybrid we have that tries to conflate symbol versions and OS releases manages to get the worst of both worlds. I've now moved it to the FBSD_1.3 namespace, but I would be more in favour of going with the consensus from the last DevSummit and using symbol versioning properly and move them all into the FBSD_1.0 namespace. Also, the ABI of the libc now depends on the compiler which was used to build the library, which is also wrong and ugly. No it doesn't. Read the patch. David ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264044 - head/share/mk
Author: imp Date: Wed Apr 2 16:33:02 2014 New Revision: 264044 URL: http://svnweb.freebsd.org/changeset/base/264044 Log: FreeBSD make (aka fmake) doesn't grok .MAKE.LEVEL. Failsafe and assume that it is OK to set MK_xxx flags. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk == --- head/share/mk/bsd.own.mkWed Apr 2 16:29:29 2014(r264043) +++ head/share/mk/bsd.own.mkWed Apr 2 16:33:02 2014(r264044) @@ -432,7 +432,7 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX .error WITH_${var} and WITHOUT_${var} can't both be set. .endif .if defined(MK_${var}) -.if ${.MAKE.LEVEL} == 0 +.if defined(.MAKE.LEVEL) ${.MAKE.LEVEL} == 0 .error MK_${var} can't be set by a user. .endif .else ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264045 - head/share/mk
Author: imp Date: Wed Apr 2 16:33:10 2014 New Revision: 264045 URL: http://svnweb.freebsd.org/changeset/base/264045 Log: Move setting of the MK_xxx variables based on NO_xxx to avoid triggering the you aren't allowed to set this warning when building stand alone in directories whose Makefile sets NO_MAN, for example. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk == --- head/share/mk/bsd.own.mkWed Apr 2 16:33:02 2014(r264044) +++ head/share/mk/bsd.own.mkWed Apr 2 16:33:10 2014(r264045) @@ -219,21 +219,6 @@ COMPRESS_EXT?= .gz # # -# Supported NO_* options (if defined, MK_* will be forced to no, -# regardless of user's setting). -# -.for var in \ -CTF \ -DEBUG_FILES \ -INSTALLLIB \ -MAN \ -PROFILE -.if defined(NO_${var}) -MK_${var}:=no -.endif -.endfor - -# # Older-style variables that enabled behaviour when set. # .if defined(YES_HESIOD) @@ -466,6 +451,22 @@ MK_${var}:=no .endfor .undef __DEFAULT_NO_OPTIONS + +# +# Supported NO_* options (if defined, MK_* will be forced to no, +# regardless of user's setting). +# +.for var in \ +CTF \ +DEBUG_FILES \ +INSTALLLIB \ +MAN \ +PROFILE +.if defined(NO_${var}) +MK_${var}:=no +.endif +.endfor + # # Force some options off if their dependencies are off. # Order is somewhat important. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264027 - in head: release share/man/man7
On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. Great, thank you for confirming. So, the question I have now is, considering the time it takes to compress the image with xz(1) compared to gzip(1), is that worth saving the 50MB space? I do not object to using xz(1), but the compression time difference was quite significant. (I do not have numbers off-hand, but can run the compression again.) Glen pgpipozRb4LxH.pgp Description: PGP signature
svn commit: r264043 - head/lib/libc/gen
Author: theraven Date: Wed Apr 2 16:29:29 2014 New Revision: 264043 URL: http://svnweb.freebsd.org/changeset/base/264043 Log: Move scandir_b to a later symbol version. Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map == --- head/lib/libc/gen/Symbol.mapWed Apr 2 16:07:48 2014 (r264042) +++ head/lib/libc/gen/Symbol.mapWed Apr 2 16:29:29 2014 (r264043) @@ -349,7 +349,6 @@ FBSD_1.1 { posix_spawnattr_setsigdefault; posix_spawnattr_setsigmask; posix_spawnp; - scandir_b; semctl; tcgetsid; tcsetsid; @@ -393,6 +392,7 @@ FBSD_1.3 { nvis; pwcache_userdb; pwcache_groupdb; + scandir_b; snvis; strenvisx; strnunvis; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264027 - in head: release share/man/man7
On 04/02/14 12:33, Glen Barber wrote: On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. Great, thank you for confirming. So, the question I have now is, considering the time it takes to compress the image with xz(1) compared to gzip(1), is that worth saving the 50MB space? I do not object to using xz(1), but the compression time difference was quite significant. (I do not have numbers off-hand, but can run the compression again.) Glen Compression is much more expensive. There are different levels too, so xz -9e my16Gfile.img on a 4 core i7 can take up to 8 hours. Other levels are cheaper. De-compression (for the end user) is as cheap or cheaper than gzip. Depending on the chosen compression level, the minimum amount of RAM required for decompression can also grow. The xz(1) explains these properties. - Nikolai Lifanov ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264027 - in head: release share/man/man7
On Wed, Apr 02, 2014 at 12:33:50PM -0400, Glen Barber wrote: On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso: 64% smaller disc1.iso: 44% smaller memstick.img: 47% smaller mini-memstick.img: 65% smaller dvd1.iso: untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. Great, thank you for confirming. So, the question I have now is, considering the time it takes to compress the image with xz(1) compared to gzip(1), is that worth saving the 50MB space? I do not object to using xz(1), but the compression time difference was quite significant. (I do not have numbers off-hand, but can run the compression again.) xz is quite slow, but who cares if it's something we do once for the benefit of many. One thing I did do in my build system is use pxz from ports. It speeds things up quite a bit on many-core machines with lots of ram. -- Brooks pgpheIa_SbbUg.pgp Description: PGP signature
Re: svn commit: r264027 - in head: release share/man/man7
On Wed, Apr 02, 2014 at 11:41:29AM -0500, Brooks Davis wrote: On Wed, Apr 02, 2014 at 12:33:50PM -0400, Glen Barber wrote: On Wed, Apr 02, 2014 at 12:23:46PM -0400, Nikolai Lifanov wrote: On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. Great, thank you for confirming. So, the question I have now is, considering the time it takes to compress the image with xz(1) compared to gzip(1), is that worth saving the 50MB space? I do not object to using xz(1), but the compression time difference was quite significant. (I do not have numbers off-hand, but can run the compression again.) xz is quite slow, but who cares if it's something we do once for the benefit of many. One thing I did do in my build system is use pxz from ports. It speeds things up quite a bit on many-core machines with lots of ram. Based on the feedback received on this, I think it's clear that xz(1) is the better choice, so I'll make the relevant changes shortly. I was more worried about Windows users needing to go through pain to decompress the images, which seems like a non-issue now. Thanks Brooks and Nikolai for the input. Glen pgpu0XV9ozEtM.pgp Description: PGP signature
Re: svn commit: r264027 - in head: release share/man/man7
On 2014-04-02 11:23, Nikolai Lifanov wrote: On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. - Nikolai Lifanov My concern was requiring a *specific* tool to extract the ISO. However I do see that Winzip and Winrar both now support XZ as well. -- Regards, Bryan Drewery ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264046 - in head: release share/man/man7
Author: gjb Date: Wed Apr 2 16:53:07 2014 New Revision: 264046 URL: http://svnweb.freebsd.org/changeset/base/264046 Log: Use xz(1) instead of gzip(1) to compress release images when WITH_COMPRESSED_IMAGES is used. Requested by: delphij, brooks, Nikolai Lifanov MFC After:1 week X-MFC-With: r264027,r264028,r264029,r264030 Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile head/share/man/man7/release.7 Modified: head/release/Makefile == --- head/release/Makefile Wed Apr 2 16:33:10 2014(r264045) +++ head/release/Makefile Wed Apr 2 16:53:07 2014(r264046) @@ -21,7 +21,7 @@ # NOSRC:if set, do not distribute source tree # NODOC:if set, do not generate release documentation # WITH_DVD: if set, generate dvd1.iso -# WITH_COMPRESSED_IMAGES: if set, compress installation images with gzip(1) +# WITH_COMPRESSED_IMAGES: if set, compress installation images with xz(1) # (uncompressed images are not removed) # TARGET/TARGET_ARCH: architecture of built release # @@ -96,7 +96,7 @@ IMAGES+= mini-memstick.img CLEANFILES=packagesystem *.txz MANIFEST system ${IMAGES} .if defined(WITH_COMPRESSED_IMAGES) !empty(WITH_COMPRESSED_IMAGES) . for I in ${IMAGES} -CLEANFILES+= ${I}.gz +CLEANFILES+= ${I}.xz . endfor .endif CLEANDIRS= dist ftp release bootonly dvd @@ -259,7 +259,7 @@ install: .for I in ${IMAGES} cp -p ${I} ${DESTDIR}/${OSRELEASE}-${I} . if defined(WITH_COMPRESSED_IMAGES) !empty(WITH_COMPRESSED_IMAGES) - gzip -k ${DESTDIR}/${OSRELEASE}-${I} + xz -k ${DESTDIR}/${OSRELEASE}-${I} . endif .endfor cd ${DESTDIR} sha256 ${OSRELEASE}* ${DESTDIR}/CHECKSUM.SHA256 Modified: head/share/man/man7/release.7 == --- head/share/man/man7/release.7 Wed Apr 2 16:33:10 2014 (r264045) +++ head/share/man/man7/release.7 Wed Apr 2 16:53:07 2014 (r264046) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd March 5, 2014 +.Dd April 2, 2014 .Dt RELEASE 7 .Os .Sh NAME @@ -252,7 +252,7 @@ Set to a non-empty value to include the target. .It Va WITH_COMPRESSED_IMAGES Set to a non-empty value to compress the release images with -.Xr gzip 1 . +.Xr xz 1 . The original .Pq uncompressed images are not removed. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264027 - in head: release share/man/man7
On Wed, Apr 02, 2014 at 11:52:44AM -0500, Bryan Drewery wrote: On 2014-04-02 11:23, Nikolai Lifanov wrote: On 04/02/14 12:06, Glen Barber wrote: On Wed, Apr 02, 2014 at 11:55:33AM -0400, Nikolai Lifanov wrote: On 04/02/14 11:51, Glen Barber wrote: On Wed, Apr 02, 2014 at 10:40:22AM -0500, Brooks Davis wrote: On Tue, Apr 01, 2014 at 10:41:27PM +, Glen Barber wrote: Author: gjb Date: Tue Apr 1 22:41:26 2014 New Revision: 264027 URL: http://svnweb.freebsd.org/changeset/base/264027 Log: Add a new release build variable, WITH_COMPRESSED_IMAGES. When set to a non-empty value, the installation medium is compressed with gzip(1) as part of the 'install' target in the release/ directory. With gzip(1) compression, downloadable image are reduced in size quite significantly. Build test against head@263927 shows the following: bootonly.iso:64% smaller disc1.iso: 44% smaller memstick.img:47% smaller mini-memstick.img: 65% smaller dvd1.iso:untested This option is off by default, I would eventually like to turn it on by default, and remove the '-k' flag to gzip(1) so only compressed images are published on FTP. I'd recommend testing xz compression as well. With UFS images of a full world the savings vs gzip are significant (more than 30% IIRC, but it's need more than a year since I checked so I'm a bit unsure of the exact numbers). delphij also brought this up. I have concerns with xz(1), since there was mention in IRC that Windows users may have problems decompressing xz-compressed images. So, gzip(1) is used because it seems to be the more commonly-supported archive mechanisms. The benefit of xz(1) over gzip(1) was only 50M-ish. -rw-r--r-- 1 root wheel 601M Mar 28 20:18 disc1.iso -rw-r--r-- 1 root wheel 381M Mar 28 20:18 disc1.iso.bz2 -rw-r--r-- 1 root wheel 392M Mar 28 20:18 disc1.iso.gz -rw-r--r-- 1 root wheel 348M Mar 28 20:18 disc1.iso.xz Glen How about 7zip (Windows program, not file format)? What would a Windows user use that can decompress gzip and not xz? It was a problem around ~2007, but xz support is no longer rare or exotic. I don't know, to be honest. I have no Windows machines to test, so I can only go by what I am told. Glen I just verified it with 7zip for Windows version 9.22. It extracts .tar.xz archives and decompresses .xz images. - Nikolai Lifanov My concern was requiring a *specific* tool to extract the ISO. However I do see that Winzip and Winrar both now support XZ as well. Indeed, this was another thing I wanted to avoid too (and meant to include that in the commit message). Glen pgpYMQndACjqx.pgp Description: PGP signature
svn commit: r264048 - head/sys/kern
Author: ian Date: Wed Apr 2 17:34:17 2014 New Revision: 264048 URL: http://svnweb.freebsd.org/changeset/base/264048 Log: Fix build breakage. Apparently all ARM configs build kern_et.c, but only a few of them also build kern_clocksource.c. That strikes me as insane, but maybe there's a good reason for it. Until I figure that out, un-break the build by not referencing functions in kern_clocksource if NO_EVENTTIMERS is defined. Modified: head/sys/kern/kern_et.c Modified: head/sys/kern/kern_et.c == --- head/sys/kern/kern_et.c Wed Apr 2 17:10:17 2014(r264047) +++ head/sys/kern/kern_et.c Wed Apr 2 17:34:17 2014(r264048) @@ -34,6 +34,8 @@ __FBSDID($FreeBSD$); #include sys/queue.h #include sys/timeet.h +#include opt_timer.h + SLIST_HEAD(et_eventtimers_list, eventtimer); static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers); @@ -121,7 +123,9 @@ void et_change_frequency(struct eventtimer *et, uint64_t newfreq) { +#ifndef NO_EVENTTIMERS cpu_et_frequency(et, newfreq); +#endif } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib
El 02/04/2014 12:24, Konstantin Belousov escribió: ... Also, the ABI of the libc now depends on the compiler which was used to build the library, which is also wrong and ugly. No it doesn't. Read the patch. It does, I read it. Now libc depends on the non-standard ABI of non-standard C extension, implemented by only one compiler. Hmm ... *two* compilers, and both are in the tree :). David will argue that it is not a dependency though. Pedro. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264049 - head/sys/arm/arm
Author: ian Date: Wed Apr 2 18:32:27 2014 New Revision: 264049 URL: http://svnweb.freebsd.org/changeset/base/264049 Log: Disable the timer and clear any pending bit, then setup the new counter register values, then restart the timer. This prevents a situation where an old event fires just as we're about to load a new value into the timer, when the start routine is called to change the time of the current event. Also re-nest the parens properly for casting the result of converting time and frequency to a count. This doesn't actually change the result of the calcs, but will some day prevent a loss-of-precision warning on the assignment, if that warning gets enabled. Modified: head/sys/arm/arm/mpcore_timer.c Modified: head/sys/arm/arm/mpcore_timer.c == --- head/sys/arm/arm/mpcore_timer.c Wed Apr 2 17:34:17 2014 (r264048) +++ head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:32:27 2014 (r264049) @@ -173,6 +173,9 @@ arm_tmr_start(struct eventtimer *et, sbi uint32_t load, count; uint32_t ctrl; + tmr_prv_write_4(PRV_TIMER_CTRL, 0); + tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); + ctrl = PRV_TIMER_CTRL_IRQ_ENABLE | PRV_TIMER_CTRL_TIMER_ENABLE; if (period != 0) { @@ -182,14 +185,14 @@ arm_tmr_start(struct eventtimer *et, sbi load = 0; if (first != 0) - count = ((uint32_t)et-et_frequency * first) 32; + count = (uint32_t)((et-et_frequency * first) 32); else count = load; tmr_prv_write_4(PRV_TIMER_LOAD, load); tmr_prv_write_4(PRV_TIMER_COUNT, count); - tmr_prv_write_4(PRV_TIMER_CTRL, ctrl); + return (0); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264050 - in head/sys/arm: arm ti/omap4
Author: ian Date: Wed Apr 2 18:43:56 2014 New Revision: 264050 URL: http://svnweb.freebsd.org/changeset/base/264050 Log: Added: head/sys/arm/arm/mpcore_timervar.h (contents, props changed) Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/ti/omap4/omap4_prcm_clks.c Modified: head/sys/arm/arm/mpcore_timer.c == --- head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:32:27 2014 (r264049) +++ head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:43:56 2014 (r264050) @@ -67,6 +67,8 @@ __FBSDID($FreeBSD$); #include machine/bus.h #include machine/fdt.h +#include arm/arm/mpcore_timervar.h + /* Private (per-CPU) timer register map */ #define PRV_TIMER_LOAD 0x #define PRV_TIMER_COUNT0x0004 @@ -100,7 +102,7 @@ struct arm_tmr_softc { bus_space_tag_t gbl_bst; bus_space_handle_t prv_bsh; bus_space_handle_t gbl_bsh; - uint32_tclkfreq; + uint64_tclkfreq; struct eventtimer et; }; @@ -114,7 +116,7 @@ static struct resource_spec arm_tmr_spec static struct arm_tmr_softc *arm_tmr_sc = NULL; -uint32_t platform_arm_tmr_freq = 0; +static uint64_t platform_arm_tmr_freq = 0; #definetmr_prv_read_4(reg) \ bus_space_read_4(arm_tmr_sc-prv_bst, arm_tmr_sc-prv_bsh, reg) @@ -209,6 +211,7 @@ static int arm_tmr_stop(struct eventtimer *et) { tmr_prv_write_4(PRV_TIMER_CTRL, 0); + tmr_prv_write_4(PRV_TIMER_INTR, PRV_TIMER_INTR_EVENT); return (0); } @@ -278,24 +281,29 @@ arm_tmr_attach(device_t dev) phandle_t node; pcell_t clock; void *ihl; + boolean_t fixed_freq; if (arm_tmr_sc) return (ENXIO); - if (platform_arm_tmr_freq != 0) - sc-clkfreq = platform_arm_tmr_freq; - else { - /* Get the base clock frequency */ - node = ofw_bus_get_node(dev); - if ((OF_getprop(node, clock-frequency, clock, - sizeof(clock))) = 0) { - device_printf(dev, missing clock-frequency attribute in FDT\n); - return (ENXIO); + if (platform_arm_tmr_freq == ARM_TMR_FREQUENCY_VARIES) { + fixed_freq = false; + } else { + fixed_freq = true; + if (platform_arm_tmr_freq != 0) { + sc-clkfreq = platform_arm_tmr_freq; + } else { + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getencprop(node, clock-frequency, clock, + sizeof(clock))) = 0) { + device_printf(dev, missing clock-frequency + attribute in FDT\n); + return (ENXIO); + } } - sc-clkfreq = fdt32_to_cpu(clock); } - if (bus_alloc_resources(dev, arm_tmr_spec, sc-tmr_res)) { device_printf(dev, could not allocate resources\n); return (ENXIO); @@ -315,14 +323,6 @@ arm_tmr_attach(device_t dev) tmr_prv_write_4(PRV_TIMER_CTRL, 0x); tmr_gbl_write_4(GBL_TIMER_CTRL, 0x); - /* Setup and enable the global timer to use as the timecounter */ - tmr_gbl_write_4(GBL_TIMER_CTRL, (0x00 GBL_TIMER_CTR_PRESCALER_SHIFT) | - GBL_TIMER_CTRL_TIMER_ENABLE); - - arm_tmr_timecount.tc_frequency = sc-clkfreq; - tc_init(arm_tmr_timecount); - - /* Setup and enable the timer */ if (bus_setup_intr(dev, sc-tmr_res[3], INTR_TYPE_CLK, arm_tmr_intr, NULL, sc, ihl) != 0) { bus_release_resources(dev, arm_tmr_spec, sc-tmr_res); @@ -330,13 +330,35 @@ arm_tmr_attach(device_t dev) return (ENXIO); } + /* +* If the clock is fixed-frequency, setup and enable the global timer to +* use as the timecounter. If it's variable frequency it won't work as +* a timecounter. We also can't use it for DELAY(), so hopefully the +* platform provides its own implementation. If it doesn't, ours will +* get used, but since the frequency isn't set, it will only use the +* bogus loop counter. +*/ + if (fixed_freq) { + tmr_gbl_write_4(GBL_TIMER_CTRL, GBL_TIMER_CTRL_TIMER_ENABLE); + arm_tmr_timecount.tc_frequency = sc-clkfreq; + tc_init(arm_tmr_timecount); + } + + /* +* Setup and register the eventtimer. Most event timers set their min +* and max period values to some value calculated from the clock +* frequency. We might not know yet what our runtime clock frequency +*
svn commit: r264051 - in head/sys/arm: arm ti/omap4
Author: ian Date: Wed Apr 2 18:49:50 2014 New Revision: 264051 URL: http://svnweb.freebsd.org/changeset/base/264051 Log: Trivial changes/forced-commit to document previous change r264050 whose description was eaten by the dog (or an editor crash or something). Add variable-frequency support to the arm mpcore eventtimer driver. This allows a platform's early init code to tell the mpcore driver that the clock frequency can vary. That causes the mpcore driver to register an eventtimer, but not a timecounter. The platform has to provide a time counter using some other fixed-frequency clock, but can still use the per-cpu goodness of the mpcore hardware for event timers. When the platform support code does something to change the frequency of the CPU clocks (power saving, thermal management) it must tell the mpcore driver code about it using arm_tmr_change_frequency(). Modified: head/sys/arm/arm/mpcore_timer.c head/sys/arm/arm/mpcore_timervar.h head/sys/arm/ti/omap4/omap4_prcm_clks.c Modified: head/sys/arm/arm/mpcore_timer.c == --- head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:43:56 2014 (r264050) +++ head/sys/arm/arm/mpcore_timer.c Wed Apr 2 18:49:50 2014 (r264051) @@ -30,16 +30,16 @@ */ /** - * The ARM Cortex-A9 core can support a global timer plus a private and - * watchdog timer per core. This driver reserves memory and interrupt - * resources for accessing both timer register sets, these resources are - * stored globally and used to setup the timecount and eventtimer. + * The ARM Cortex-A9 core can support a global timer plus a private and + * watchdog timer per core. This driver reserves memory and interrupt + * resources for accessing both timer register sets, these resources are + * stored globally and used to setup the timecount and eventtimer. * - * The timecount timer uses the global 64-bit counter, whereas the - * per-CPU eventtimer uses the private 32-bit counters. + * The timecount timer uses the global 64-bit counter, whereas the + * per-CPU eventtimer uses the private 32-bit counters. * * - * REF: ARM Cortex-A9 MPCore, Technical Reference Manual (rev. r2p2) + * REF: ARM Cortex-A9 MPCore, Technical Reference Manual (rev. r2p2) */ #include sys/cdefs.h Modified: head/sys/arm/arm/mpcore_timervar.h == --- head/sys/arm/arm/mpcore_timervar.h Wed Apr 2 18:43:56 2014 (r264050) +++ head/sys/arm/arm/mpcore_timervar.h Wed Apr 2 18:49:50 2014 (r264051) @@ -42,6 +42,6 @@ * Inform the mpcore timer driver of a new clock frequency. This can be called * both before and after the mpcore timer driver attaches. */ -void arm_tmr_change_frequency(uint64_t newfreq); +void arm_tmr_change_frequency(uint64_t newfreq); #endif Modified: head/sys/arm/ti/omap4/omap4_prcm_clks.c == --- head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 2 18:43:56 2014 (r264050) +++ head/sys/arm/ti/omap4/omap4_prcm_clks.c Wed Apr 2 18:49:50 2014 (r264051) @@ -86,7 +86,6 @@ __FBSDID($FreeBSD$); * OMAP4 devices are different from the previous OMAP3 devices in that there * is no longer a separate functional and interface clock for each module, * instead there is typically an interface clock that spans many modules. - * */ #define FREQ_96MHZ9600 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib
On 2 Apr 2014, at 18:24, Konstantin Belousov kostik...@gmail.com wrote: It does, I read it. Read the code again. Or even just read the comments. In particular the blocks_abi.h file contains a detailed description of why the rest of what you say is wrong. Now libc depends on the non-standard ABI Not true, the ABI is documented and is as standard as the C++ ABI. We have code in ports and in the base system that relies on this ABI already. of non-standard C extension, The extension is non-standard, however (if you'd read the code, or the comments in the code you'd already know that) the code in libc does not require this extension to exist. implemented by only one compiler. Actually, by two, both of which are in the base system. Well, three if you count Apple-GCC as different from FSF-GCC. Oh, and a couple of proprietary compilers. All of which are only required for *callers* of these functions. libc itself still builds correctly (and is tested building) with compilers that don't support blocks. If you have helpful comments, then I suggest you try to phrase them in a less confrontational tone. David ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264052 - head/sys/arm/freescale/imx
Author: ian Date: Wed Apr 2 19:06:53 2014 New Revision: 264052 URL: http://svnweb.freebsd.org/changeset/base/264052 Log: Don't call sdhci_init_slot() until after handling the FDT properties related to detecting card presence. This actually makes no difference now, but will when we get support for gpio-based card detection. Modified: head/sys/arm/freescale/imx/imx_sdhci.c Modified: head/sys/arm/freescale/imx/imx_sdhci.c == --- head/sys/arm/freescale/imx/imx_sdhci.c Wed Apr 2 18:49:50 2014 (r264051) +++ head/sys/arm/freescale/imx/imx_sdhci.c Wed Apr 2 19:06:53 2014 (r264052) @@ -730,9 +730,6 @@ imx_sdhci_attach(device_t dev) sc-baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); } - sdhci_init_slot(dev, sc-slot, 0); - callout_init(sc-r1bfix_callout, true); - /* * If the slot is flagged with the non-removable property, set our flag * to always force the SDHCI_CARD_PRESENT bit on. @@ -752,6 +749,9 @@ imx_sdhci_attach(device_t dev) sc-force_card_present = true; } + callout_init(sc-r1bfix_callout, true); + sdhci_init_slot(dev, sc-slot, 0); + bus_generic_probe(dev); bus_generic_attach(dev); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264054 - head/sys/conf
Author: ian Date: Wed Apr 2 19:51:29 2014 New Revision: 264054 URL: http://svnweb.freebsd.org/changeset/base/264054 Log: Change NO_EVENTTIMERS from an arm-specific to an MI option, so that it can be used in MI code. This is intended as a temporary measure to unbreak the build. The real fix is to write event timer drivers for legacy arm hardware, then get rid of this option completely. That's going to take a few days. Modified: head/sys/conf/options head/sys/conf/options.arm Modified: head/sys/conf/options == --- head/sys/conf/options Wed Apr 2 19:41:48 2014(r264053) +++ head/sys/conf/options Wed Apr 2 19:51:29 2014(r264054) @@ -159,6 +159,7 @@ NEW_PCIBopt_global.h NO_ADAPTIVE_MUTEXESopt_adaptive_mutexes.h NO_ADAPTIVE_RWLOCKS NO_ADAPTIVE_SX +NO_EVENTTIMERS opt_timer.h NO_SYSCTL_DESCRopt_global.h NSWBUF_MIN opt_swap.h MBUF_PACKET_ZONE_DISABLE opt_global.h Modified: head/sys/conf/options.arm == --- head/sys/conf/options.arm Wed Apr 2 19:41:48 2014(r264053) +++ head/sys/conf/options.arm Wed Apr 2 19:51:29 2014(r264054) @@ -30,7 +30,6 @@ KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h -NO_EVENTTIMERS opt_timer.h PHYSADDR opt_global.h SOCDEV_PA opt_global.h SOCDEV_VA opt_global.h ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264055 - head/usr.sbin/bhyve
Author: grehan Date: Wed Apr 2 20:18:17 2014 New Revision: 264055 URL: http://svnweb.freebsd.org/changeset/base/264055 Log: Add support for the virtio RNG entropy-source device. Call through to /dev/random synchronously to fill virtio buffers with RNG data. Tested with FreeBSD-CURRENT and Ubuntu guests. Submitted by: Leon Dang Discussed with: markm MFC after:3 weeks Sponsored by: Nahanni Systems Added: head/usr.sbin/bhyve/pci_virtio_rnd.c (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyve.8 head/usr.sbin/bhyve/virtio.h Modified: head/usr.sbin/bhyve/Makefile == --- head/usr.sbin/bhyve/MakefileWed Apr 2 19:51:29 2014 (r264054) +++ head/usr.sbin/bhyve/MakefileWed Apr 2 20:18:17 2014 (r264055) @@ -26,6 +26,7 @@ SRCS= \ pci_passthru.c \ pci_virtio_block.c \ pci_virtio_net.c\ + pci_virtio_rnd.c\ pci_uart.c \ pm.c\ pmtmr.c \ Modified: head/usr.sbin/bhyve/bhyve.8 == --- head/usr.sbin/bhyve/bhyve.8 Wed Apr 2 19:51:29 2014(r264054) +++ head/usr.sbin/bhyve/bhyve.8 Wed Apr 2 20:18:17 2014(r264055) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 27, 2014 +.Dd April 2, 2014 .Dt BHYVE 8 .Os .Sh NAME @@ -129,6 +129,8 @@ PCI pass-through device. Virtio network interface. .It Li virtio-blk Virtio block storage interface. +.It Li virtio-rnd +Virtio RNG interface. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd Added: head/usr.sbin/bhyve/pci_virtio_rnd.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/pci_virtio_rnd.cWed Apr 2 20:18:17 2014 (r264055) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2014 Nahanni Systems 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 + *in this position and unchanged. + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 THE AUTHOR 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. + */ + +/* + * virtio entropy device emulation. + * Randomness is sourced from /dev/random which does not block + * once it has been seeded at bootup. + */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/param.h +#include sys/linker_set.h +#include sys/uio.h + +#include errno.h +#include fcntl.h +#include stdio.h +#include stdlib.h +#include string.h +#include unistd.h +#include assert.h +#include pthread.h + +#include bhyverun.h +#include pci_emul.h +#include virtio.h + +#define VTRND_RINGSZ 64 + + +static int pci_vtrnd_debug; +#define DPRINTF(params) if (pci_vtrnd_debug) printf params +#define WPRINTF(params) printf params + +/* + * Per-device softc + */ +struct pci_vtrnd_softc { + struct virtio_softc vrsc_vs; + struct vqueue_info vrsc_vq; + pthread_mutex_t vrsc_mtx; + uint64_tvrsc_cfg; + int vrsc_fd; +}; + +static void pci_vtrnd_reset(void *); +static void pci_vtrnd_notify(void *, struct vqueue_info *); + +static struct virtio_consts vtrnd_vi_consts = { + vtrnd,/* our name */ + 1, /* we support 1 virtqueue */ + 0, /* config reg size */ + pci_vtrnd_reset,/* reset */ + pci_vtrnd_notify, /* device-wide qnotify */ + NULL, /* read virtio config */ + NULL, /* write virtio config */ + 0, /* our capabilities */ +}; + + +static
svn commit: r264057 - head/sys/arm/freescale/imx
Author: ian Date: Wed Apr 2 21:34:48 2014 New Revision: 264057 URL: http://svnweb.freebsd.org/changeset/base/264057 Log: Rework the cpu frequency management code for imx6. This adds the concept of operating points, combinations of frequency and voltage at which the cpu is known to work correctly. Some day these should come from FDT data, but for now the table is hard-coded. This also allows tuning the min and max operating frequencies. The min frequency is what the thermal management code will slow down to if the core temperature gets too high. The max frequency is what gets used if the temperature is okay. Normally the max cannot be set higher than the value burned into the ocotp fuses as the chip's rated max, but there is now a new sysctl+tunable cpu_overclock_enable; when set to non-zero it allows raising the frequency above the ocotp value: USE WITH CARE! (At least one of my imx6 boards has a cpu whose ocotp values never got set correctly; they claim a max of 792mhz, but the physical markings on the chip say it's good to 1ghz.) Because all these values affect the entire SoC, there is a new sysctl node, hw.imx6, where all these values live. The values that are currently under dev.imx6_anatop.0 should probably move to hw.imx6 too, because anatop doesn't even mean anything to me, let alone to an end user. Modified: head/sys/arm/freescale/imx/imx6_anatop.c Modified: head/sys/arm/freescale/imx/imx6_anatop.c == --- head/sys/arm/freescale/imx/imx6_anatop.cWed Apr 2 21:06:43 2014 (r264056) +++ head/sys/arm/freescale/imx/imx6_anatop.cWed Apr 2 21:34:48 2014 (r264057) @@ -57,6 +57,7 @@ __FBSDID($FreeBSD$); #include sys/systm.h #include sys/callout.h #include sys/kernel.h +#include sys/limits.h #include sys/sysctl.h #include sys/module.h #include sys/bus.h @@ -74,6 +75,8 @@ __FBSDID($FreeBSD$); #include arm/freescale/imx/imx6_anatopreg.h #include arm/freescale/imx/imx6_anatopvar.h +static SYSCTL_NODE(_hw, OID_AUTO, imx6, CTLFLAG_RW, NULL, i.MX6 container); + static struct resource_spec imx6_anatop_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -85,14 +88,15 @@ static struct resource_spec imx6_anatop_ struct imx6_anatop_softc { device_tdev; struct resource *res[2]; - uint32_tcpu_curhz; uint32_tcpu_curmhz; uint32_tcpu_curmv; - uint32_tcpu_minhz; + uint32_tcpu_minmhz; uint32_tcpu_minmv; - uint32_tcpu_maxhz; + uint32_tcpu_maxmhz; uint32_tcpu_maxmv; - uint32_trefosc_hz; + uint32_tcpu_maxmhz_hw; + boolean_t cpu_overclock_enable; + uint32_trefosc_mhz; void*temp_intrhand; uint32_ttemp_high_val; uint32_ttemp_high_cnt; @@ -108,16 +112,27 @@ struct imx6_anatop_softc { static struct imx6_anatop_softc *imx6_anatop_sc; /* - * Tables of CPU max frequencies and corresponding voltages. This is indexed by - * the max frequency value (0-3) from the ocotp CFG3 register. + * Table of operating points. + * These are combinations of frequency and voltage blessed by Freescale. */ -static uint32_t imx6_cpu_maxhz_tab[] = { -79200, 85200, 99600, 12 -}; -static uint32_t imx6_cpu_millivolt_tab[] = { - 1150, 1225, 1225, 1275 +static struct oppt { + uint32_tmhz; + uint32_tmv; +} imx6_oppt_table[] = { +/* { 396, 925}, XXX: need functional ccm code for this speed */ + { 792, 1150}, + { 852, 1225}, + { 996, 1225}, + {1200, 1275}, }; +/* + * Table of CPU max frequencies. This is used to translate the max frequency + * value (0-3) from the ocotp CFG3 register into a mhz value that can be looked + * up in the operating points table. + */ +static uint32_t imx6_ocotp_mhz_tab[] = {792, 852, 996, 1200}; + #defineTZ_ZEROC2732/* deci-Kelvin - deci-Celcius offset. */ uint32_t @@ -193,49 +208,58 @@ vdd_set(struct imx6_anatop_softc *sc, in imx6_anatop_write_4(IMX6_ANALOG_PMU_REG_CORE, pmureg); DELAY(delay); sc-cpu_curmv = newtarg * 25 + 700; - device_printf(sc-dev, voltage set to %u\n, sc-cpu_curmv); } static inline uint32_t -cpufreq_hz_from_div(struct imx6_anatop_softc *sc, uint32_t div) +cpufreq_mhz_from_div(struct imx6_anatop_softc *sc, uint32_t div) { - return (sc-refosc_hz * (div / 2)); + return (sc-refosc_mhz * (div / 2)); } static inline uint32_t -cpufreq_hz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_hz) +cpufreq_mhz_to_div(struct imx6_anatop_softc *sc, uint32_t cpu_mhz) { - return (cpu_hz / (sc-refosc_hz / 2)); + return (cpu_mhz /
svn commit: r264058 - head/sys/dev/iscsi
Author: trasz Date: Wed Apr 2 23:07:15 2014 New Revision: 264058 URL: http://svnweb.freebsd.org/changeset/base/264058 Log: Fix build, broken by r264025. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c == --- head/sys/dev/iscsi/icl.cWed Apr 2 21:34:48 2014(r264057) +++ head/sys/dev/iscsi/icl.cWed Apr 2 23:07:15 2014(r264058) @@ -1048,12 +1048,12 @@ icl_conn_start(struct icl_conn *ic) minspace = sizeof(struct iscsi_bhs) + ic-ic_max_data_segment_length + ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; if (sendspace minspace) { - ICL_WARN(kern.icl.sendspace too low; must be at least %jd, + ICL_WARN(kern.icl.sendspace too low; must be at least %zd, minspace); sendspace = minspace; } if (recvspace minspace) { - ICL_WARN(kern.icl.recvspace too low; must be at least %jd, + ICL_WARN(kern.icl.recvspace too low; must be at least %zd, minspace); recvspace = minspace; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264025 - head/sys/dev/iscsi
Wiadomość napisana przez Ian Lepore w dniu 2 kwi 2014, o godz. 15:24: On Tue, 2014-04-01 at 22:03 +, Edward Tomasz Napierala wrote: Author: trasz Date: Tue Apr 1 22:03:03 2014 New Revision: 264025 URL: http://svnweb.freebsd.org/changeset/base/264025 Log: Get rid of the autoscaling, instead just set socket buffer sizes in the usual way. The only thing the old code did was making things less predictable. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/icl.c Modified: head/sys/dev/iscsi/icl.c == --- head/sys/dev/iscsi/icl.c Tue Apr 1 21:54:20 2014(r264024) +++ head/sys/dev/iscsi/icl.c Tue Apr 1 22:03:03 2014(r264025) @@ -68,6 +68,14 @@ TUNABLE_INT(kern.icl.partial_receive_le SYSCTL_INT(_kern_icl, OID_AUTO, partial_receive_len, CTLFLAG_RW, partial_receive_len, 1 * 1024, Minimum read size for partially received data segment); +static int sendspace = 1048576; +TUNABLE_INT(kern.icl.sendspace, sendspace); +SYSCTL_INT(_kern_icl, OID_AUTO, sendspace, CTLFLAG_RW, +sendspace, 1048576, Default send socket buffer size); +static int recvspace = 1048576; +TUNABLE_INT(kern.icl.recvspace, recvspace); +SYSCTL_INT(_kern_icl, OID_AUTO, recvspace, CTLFLAG_RW, +recvspace, 1048576, Default receive socket buffer size); static uma_zone_t icl_conn_zone; static uma_zone_t icl_pdu_zone; @@ -1008,7 +1016,7 @@ icl_conn_free(struct icl_conn *ic) static int icl_conn_start(struct icl_conn *ic) { -size_t bufsize; +size_t minspace; struct sockopt opt; int error, one = 1; @@ -1029,18 +1037,28 @@ icl_conn_start(struct icl_conn *ic) ICL_CONN_UNLOCK(ic); /* - * Use max available sockbuf size for sending. Do it manually - * instead of sbreserve(9) to work around resource limits. + * For sendspace, this is required because the current code cannot + * send a PDU in pieces; thus, the minimum buffer size is equal + * to the maximum PDU size. +4 is to account for possible padding. * - * XXX: This kind of sucks. On one hand, we don't currently support - * sending a part of data segment; we always do it in one piece, - * so we have to make sure it can fit in the socket buffer. - * Once I've implemented partial send, we'll get rid of this - * and use autoscaling. + * What we should actually do here is to use autoscaling, but set + * some minimal buffer size to minspace. I don't know a way to do + * that, though. */ -bufsize = (sizeof(struct iscsi_bhs) + -ic-ic_max_data_segment_length) * 8; -error = soreserve(ic-ic_socket, bufsize, bufsize); +minspace = sizeof(struct iscsi_bhs) + ic-ic_max_data_segment_length + +ISCSI_HEADER_DIGEST_SIZE + ISCSI_DATA_DIGEST_SIZE + 4; +if (sendspace minspace) { +ICL_WARN(kern.icl.sendspace too low; must be at least %jd, +minspace); +sendspace = minspace; +} +if (recvspace minspace) { +ICL_WARN(kern.icl.recvspace too low; must be at least %jd, +minspace); +recvspace = minspace; +} + The %jd on these is causing build failures on 32-bit arches due to size_t being only 32 bits. Right. Should be fixed now, sorry for breakage. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264059 - head/bin/dd
Author: delphij Date: Thu Apr 3 00:55:16 2014 New Revision: 264059 URL: http://svnweb.freebsd.org/changeset/base/264059 Log: Implement GNU's extension of 'status' operand. The GNU syntax is borrowed where syntax status=noxfer means no transfer statistics and status=none means no status information at all. This feature is useful because the statistics information can sometimes be annoying, and redirecting stderr to /dev/null would mean error messages also gets silenced. Obtained from:OpenBSD MFC after:2 weeks Modified: head/bin/dd/args.c head/bin/dd/dd.1 head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h head/bin/dd/misc.c Modified: head/bin/dd/args.c == --- head/bin/dd/args.c Wed Apr 2 23:07:15 2014(r264058) +++ head/bin/dd/args.c Thu Apr 3 00:55:16 2014(r264059) @@ -66,6 +66,7 @@ static void f_obs(char *); static voidf_of(char *); static voidf_seek(char *); static voidf_skip(char *); +static voidf_status(char *); static uintmax_t get_num(const char *); static off_t get_off_t(const char *); @@ -88,6 +89,7 @@ static const struct arg { { oseek, f_seek, C_SEEK, C_SEEK }, { seek, f_seek, C_SEEK, C_SEEK }, { skip, f_skip, C_SKIP, C_SKIP }, + { status, f_status, C_STATUS,C_STATUS }, }; static char *oper; @@ -292,6 +294,18 @@ f_skip(char *arg) in.offset = get_off_t(arg); } +static void +f_status(char *arg) +{ + + if (strcmp(arg, none) == 0) + ddflags |= C_NOINFO; + else if (strcmp(arg, noxfer) == 0) + ddflags |= C_NOXFER; + else + errx(1, unknown status %s, arg); +} + static const struct conv { const char *name; u_int set, noset; Modified: head/bin/dd/dd.1 == --- head/bin/dd/dd.1Wed Apr 2 23:07:15 2014(r264058) +++ head/bin/dd/dd.1Thu Apr 3 00:55:16 2014(r264059) @@ -32,7 +32,7 @@ .\ @(#)dd.1 8.2 (Berkeley) 1/13/94 .\ $FreeBSD$ .\ -.Dd October 1, 2013 +.Dd April 2, 2014 .Dt DD 1 .Os .Sh NAME @@ -156,6 +156,17 @@ Otherwise, input data is read and discar For pipes, the correct number of bytes is read. For all other devices, the correct number of blocks is read without distinguishing between a partial or complete block being read. +.It Cm status Ns = Ns Ar value +Where +.Cm value +is one of the symbols from the following list. +.Bl -tag -width .Cm noxfer +.It Cm noxfer +Do not print the transfer statistics as the last line of status output. +.It Cm none +Do not print the status output. +Error messages are shown; informational messages are not. +.El .It Cm conv Ns = Ns Ar value Ns Op , Ns Ar value ... Where .Cm value @@ -410,7 +421,9 @@ utility is expected to be a superset of standard. The .Cm files -operand and the +and +.Cm status +operands and the .Cm ascii , .Cm ebcdic , .Cm ibm , Modified: head/bin/dd/dd.c == --- head/bin/dd/dd.cWed Apr 2 23:07:15 2014(r264058) +++ head/bin/dd/dd.cThu Apr 3 00:55:16 2014(r264059) @@ -76,7 +76,7 @@ STAT st; /* statistics */ void (*cfunc)(void); /* conversion function */ uintmax_t cpy_cnt; /* # of blocks to copy */ static off_t pending = 0;/* pending seek if sparse */ -u_int ddflags = 0;/* conversion options */ +u_int64_t ddflags = 0;/* conversion options */ size_t cbsz; /* conversion block size */ uintmax_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ Modified: head/bin/dd/dd.h == --- head/bin/dd/dd.hWed Apr 2 23:07:15 2014(r264058) +++ head/bin/dd/dd.hThu Apr 3 00:55:16 2014(r264059) @@ -68,32 +68,35 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#defineC_ASCII 0x1 -#defineC_BLOCK 0x2 -#defineC_BS0x4 -#defineC_CBS 0x8 -#defineC_COUNT 0x00010 -#defineC_EBCDIC0x00020 -#defineC_FILES 0x00040 -#defineC_IBS 0x00080 -#defineC_IF0x00100 -#defineC_LCASE 0x00200 -#defineC_NOERROR 0x00400 -#defineC_NOTRUNC 0x00800 -#defineC_OBS 0x01000 -#defineC_OF0x02000 -#defineC_OSYNC 0x04000 -#defineC_PAREVEN 0x08000 -#defineC_PARNONE 0x10 -#defineC_PARODD0x20 -#defineC_PARSET0x40 -#defineC_SEEK 0x80
svn commit: r264062 - head/sys/dev/usb/net
Author: yongari Date: Thu Apr 3 01:32:43 2014 New Revision: 264062 URL: http://svnweb.freebsd.org/changeset/base/264062 Log: Correct endianness handling in getting station address from EEPROM. While I'm here, remove aue_eeprom_getword() as its only usage is to read station address and make it more readable. This change is inspired by NetBSD. With this change, aue(4) should work on big endian architectures. PR: 188177 Modified: head/sys/dev/usb/net/if_aue.c Modified: head/sys/dev/usb/net/if_aue.c == --- head/sys/dev/usb/net/if_aue.c Thu Apr 3 01:02:14 2014 (r264061) +++ head/sys/dev/usb/net/if_aue.c Thu Apr 3 01:32:43 2014 (r264062) @@ -212,9 +212,7 @@ static uint8_t aue_csr_read_1(struct aue static uint16_taue_csr_read_2(struct aue_softc *, uint16_t); static voidaue_csr_write_1(struct aue_softc *, uint16_t, uint8_t); static voidaue_csr_write_2(struct aue_softc *, uint16_t, uint16_t); -static voidaue_eeprom_getword(struct aue_softc *, int, uint16_t *); -static voidaue_read_eeprom(struct aue_softc *, uint8_t *, uint16_t, - uint16_t); +static uint16_taue_eeprom_getword(struct aue_softc *, int); static voidaue_reset(struct aue_softc *); static voidaue_reset_pegasus_II(struct aue_softc *); @@ -376,11 +374,10 @@ aue_csr_write_2(struct aue_softc *sc, ui /* * Read a word of data stored in the EEPROM at address 'addr.' */ -static void -aue_eeprom_getword(struct aue_softc *sc, int addr, uint16_t *dest) +static uint16_t +aue_eeprom_getword(struct aue_softc *sc, int addr) { int i; - uint16_t word = 0; aue_csr_write_1(sc, AUE_EE_REG, addr); aue_csr_write_1(sc, AUE_EE_CTL, AUE_EECTL_READ); @@ -395,22 +392,23 @@ aue_eeprom_getword(struct aue_softc *sc, if (i == AUE_TIMEOUT) device_printf(sc-sc_ue.ue_dev, EEPROM read timed out\n); - word = aue_csr_read_2(sc, AUE_EE_DATA); - *dest = word; + return (aue_csr_read_2(sc, AUE_EE_DATA)); } /* - * Read a sequence of words from the EEPROM. + * Read station address(offset 0) from the EEPROM. */ static void -aue_read_eeprom(struct aue_softc *sc, uint8_t *dest, -uint16_t off, uint16_t len) +aue_read_mac(struct aue_softc *sc, uint8_t *eaddr) { - uint16_t *ptr = (uint16_t *)dest; - int i; + int i, offset; + uint16_t word; - for (i = 0; i != len; i++, ptr++) - aue_eeprom_getword(sc, off + i, ptr); + for (i = 0, offset = 0; i ETHER_ADDR_LEN / 2; i++) { + word = aue_eeprom_getword(sc, offset + i); + eaddr[i * 2] = (uint8_t)word; + eaddr[i * 2 + 1] = (uint8_t)(word 8); + } } static int @@ -636,7 +634,7 @@ aue_attach_post(struct usb_ether *ue) aue_reset(sc); /* get station address from the EEPROM */ - aue_read_eeprom(sc, ue-ue_eaddr, 0, 3); + aue_read_mac(sc, ue-ue_eaddr); } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264063 - head/sys/netinet
Author: hiren Date: Thu Apr 3 01:46:03 2014 New Revision: 264063 URL: http://svnweb.freebsd.org/changeset/base/264063 Log: Improve readability of comments for DELAY_ACK() macro. Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c == --- head/sys/netinet/tcp_input.cThu Apr 3 01:32:43 2014 (r264062) +++ head/sys/netinet/tcp_input.cThu Apr 3 01:46:03 2014 (r264063) @@ -503,13 +503,14 @@ do { \ /* * Indicate whether this ack should be delayed. We can delay the ack if - * - there is no delayed ack timer in progress and - * - our last ack wasn't a 0-sized window. We never want to delay - * the ack that opens up a 0-sized window and - * - delayed acks are enabled or - * - this is a half-synchronized T/TCP connection. - * - the segment size is not larger than the MSS and LRO wasn't used - * for this segment. + * following conditions are met: + * - There is no delayed ack timer in progress. + * - Our last ack wasn't a 0-sized window. We never want to delay + * the ack that opens up a 0-sized window. + * - LRO wasn't used for this segment. We make sure by checking that the + * segment size is not larger than the MSS. + * - Delayed acks are enabled or this is a half-synchronized T/TCP + * connection. */ #define DELAY_ACK(tp, tlen)\ ((!tcp_timer_active(tp, TT_DELACK)\ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r264059 - head/bin/dd
On Thu, 3 Apr 2014, Xin LI wrote: Log: Implement GNU's extension of 'status' operand. The GNU syntax is borrowed where syntax status=noxfer means no transfer statistics and status=none means no status information at all. This feature is useful because the statistics information can sometimes be annoying, and redirecting stderr to /dev/null would mean error messages also gets silenced. Obtained from: OpenBSD MFC after: 2 weeks ... Modified: head/bin/dd/dd.h == --- head/bin/dd/dd.hWed Apr 2 23:07:15 2014(r264058) +++ head/bin/dd/dd.hThu Apr 3 00:55:16 2014(r264059) @@ -68,32 +68,35 @@ typedef struct { } STAT; /* Flags (in ddflags). */ -#defineC_ASCII 0x1 -#defineC_BLOCK 0x2 The table should have been reformatted separately, or better not at all. -#defineC_BS0x4 -#defineC_CBS 0x8 -#defineC_COUNT 0x00010 -#defineC_EBCDIC0x00020 -#defineC_FILES 0x00040 -#defineC_IBS 0x00080 -#defineC_IF0x00100 -#defineC_LCASE 0x00200 -#defineC_NOERROR 0x00400 -#defineC_NOTRUNC 0x00800 -#defineC_OBS 0x01000 -#defineC_OF0x02000 -#defineC_OSYNC 0x04000 -#defineC_PAREVEN 0x08000 -#defineC_PARNONE 0x10 The previous formatting was not too good, and obfuscated a bug here. 4 bits are unused. Someone added this bug together with many others in 2004, and I missed it then when I committed a fix for the others. Most of the bugs that I fixed were unsorting of the table by adding to its end. Insertion sort tends to give large churn of the table by changing all the numbers, but for the 2004 fix there wasn't much churn except relative to the unsorted version because all the changes were near the end. -#defineC_PARODD0x20 -#defineC_PARSET0x40 -#defineC_SEEK 0x80 -#defineC_SKIP 0x100 -#defineC_SPARSE0x200 -#defineC_SWAB 0x400 -#defineC_SYNC 0x800 -#defineC_UCASE 0x1000 -#defineC_UNBLOCK 0x2000 -#defineC_FILL 0x4000 +#defineC_ASCII 0x1 +#defineC_BLOCK 0x2 +#defineC_BS0x4 +#defineC_CBS 0x8 +#defineC_COUNT 0x00010 +#defineC_EBCDIC0x00020 +#defineC_FILES 0x00040 +#defineC_IBS 0x00080 +#defineC_IF0x00100 +#defineC_LCASE 0x00200 +#defineC_NOERROR 0x00400 +#defineC_NOTRUNC 0x00800 +#defineC_OBS 0x01000 +#defineC_OF0x02000 +#defineC_OSYNC 0x04000 +#defineC_PAREVEN 0x08000 +#defineC_PARNONE 0x00010 +#defineC_PARODD0x00020 +#defineC_PARSET0x00040 +#defineC_SEEK 0x00080 +#defineC_SKIP 0x00100 +#defineC_SPARSE0x00200 +#defineC_SWAB 0x00400 +#defineC_SYNC 0x00800 +#defineC_UCASE 0x01000 +#defineC_UNBLOCK 0x02000 Unsorting of the table continued from here after I stopped policing the order. +#defineC_FILL 0x04000 +#defineC_STATUS0x08000 The above 2 unsorted entries are old, but reformatting in this commit obfuscates the change. +#defineC_NOXFER0x1 +#defineC_NOINFO0x2 Latest unsorting. The 2 values above UINT_MAX also won't compile with compilers that warn that 'integer constant is too large for long type'. Mainly gcc without -std=c99. clang is too incompatible to warn about this even with -std=c89 -Wall. The fix is not to further churn the table by adding a ULL suffix to all entries. #define C_PARITY(C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) Modified: head/bin/dd/extern.h == --- head/bin/dd/extern.hWed Apr 2 23:07:15 2014(r264058) +++ head/bin/dd/extern.hThu Apr 3 00:55:16 2014(r264059) @@ -53,7 +53,7 @@ extern STAT st; extern void (*cfunc)(void); extern uintmax_t cpy_cnt; extern size_t cbsz; -extern u_int ddflags; +extern u_int64_t ddflags; Not needed when the unused bits in the first 32 are used. There are only 30 flags now. extern uintmax_t files_cnt; extern const u_char *ctab; extern const u_char a2e_32V[], a2e_POSIX[]; Bruce
svn commit: r264065 - in head/sys: arm/arm boot/fdt/dts/arm
Author: br Date: Thu Apr 3 05:48:56 2014 New Revision: 264065 URL: http://svnweb.freebsd.org/changeset/base/264065 Log: - Setup both secure and non-secure timer IRQs. We don't know our ARM security state, so one of them will operate. - Don't set frequency, since it's unpossible in non-secure state. Only rely on DTS clock-frequency value or get clock from timer. Discussed with: ian, cognet Modified: head/sys/arm/arm/generic_timer.c head/sys/boot/fdt/dts/arm/exynos5250.dtsi Modified: head/sys/arm/arm/generic_timer.c == --- head/sys/arm/arm/generic_timer.cThu Apr 3 05:48:28 2014 (r264064) +++ head/sys/arm/arm/generic_timer.cThu Apr 3 05:48:56 2014 (r264065) @@ -73,16 +73,23 @@ __FBSDID($FreeBSD$); #defineGT_CNTKCTL_PL0VCTEN (1 1) /* PL0 CNTVCT and CNTFRQ access */ #defineGT_CNTKCTL_PL0PCTEN (1 0) /* PL0 CNTPCT and CNTFRQ access */ -#defineGT_CNTPSIRQ 29 - struct arm_tmr_softc { - struct resource *irq_res; + struct resource *res[4]; + void*ihl[4]; uint32_tclkfreq; struct eventtimer et; }; static struct arm_tmr_softc *arm_tmr_sc = NULL; +static struct resource_spec timer_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE },/* Secure */ + { SYS_RES_IRQ, 1, RF_ACTIVE },/* Non-secure */ + { SYS_RES_IRQ, 2, RF_ACTIVE },/* Virt */ + { SYS_RES_IRQ, 3, RF_ACTIVE },/* Hyp */ + { -1, 0 } +}; + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -261,9 +268,8 @@ arm_tmr_attach(device_t dev) struct arm_tmr_softc *sc; phandle_t node; pcell_t clock; - void *ihl; - int rid; int error; + int i; sc = device_get_softc(dev); if (arm_tmr_sc) @@ -272,29 +278,37 @@ arm_tmr_attach(device_t dev) /* Get the base clock frequency */ node = ofw_bus_get_node(dev); error = OF_getprop(node, clock-frequency, clock, sizeof(clock)); - if (error = 0) { - device_printf(dev, missing clock-frequency - attribute in FDT\n); + if (error 0) { + sc-clkfreq = fdt32_to_cpu(clock); + } + + if (sc-clkfreq == 0) { + /* Try to get clock frequency from timer */ + sc-clkfreq = get_freq(); + } + + if (sc-clkfreq == 0) { + device_printf(dev, No clock frequency specified\n); return (ENXIO); } - sc-clkfreq = fdt32_to_cpu(clock); - rid = 0; - sc-irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, rid, - GT_CNTPSIRQ, GT_CNTPSIRQ, - 1, RF_SHAREABLE | RF_ACTIVE); + if (bus_alloc_resources(dev, timer_spec, sc-res)) { + device_printf(dev, could not allocate resources\n); + return (ENXIO); + }; arm_tmr_sc = sc; - /* Setup and enable the timer */ - if (bus_setup_intr(dev, sc-irq_res, INTR_TYPE_CLK, arm_tmr_intr, - NULL, sc, ihl) != 0) { - bus_release_resource(dev, SYS_RES_IRQ, rid, sc-irq_res); - device_printf(dev, Unable to setup the CLK irq handler.\n); - return (ENXIO); + /* Setup secure and non-secure IRQs handler */ + for (i = 0; i 2; i++) { + error = bus_setup_intr(dev, sc-res[i], INTR_TYPE_CLK, + arm_tmr_intr, NULL, sc, sc-ihl[i]); + if (error) { + device_printf(dev, Unable to alloc int resource.\n); + return (ENXIO); + } } - set_freq(sc-clkfreq); disable_user_access(); arm_tmr_timecount.tc_frequency = sc-clkfreq; Modified: head/sys/boot/fdt/dts/arm/exynos5250.dtsi == --- head/sys/boot/fdt/dts/arm/exynos5250.dtsi Thu Apr 3 05:48:28 2014 (r264064) +++ head/sys/boot/fdt/dts/arm/exynos5250.dtsi Thu Apr 3 05:48:56 2014 (r264065) @@ -81,6 +81,8 @@ generic_timer { compatible = arm,armv7-timer; clock-frequency = 2400; + interrupts = 29 30 27 26 ; + interrupt-parent = GIC; }; pwm { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264064 - head/bin/ls
Author: grog Date: Thu Apr 3 05:48:28 2014 New Revision: 264064 URL: http://svnweb.freebsd.org/changeset/base/264064 Log: Make -f set -a, as required by the standard. From the original OpenBSD commit message: restore the traditional behavior of -f implying -a; apparently Keith Bostic forgot to restore it when the -f flag was put back on 2nd of September 1989, after being removed on 16th of August as a consequence of issues getting it working over NFS, so deviation from traditional UNIX behavior in all BSDs looks like an historical accident; as a side effect, this change accommodates behavior of this option to IEEE Std 1003.1-2008 (``POSIX.1''). joint work with jmc@ (who found the inaccuracy in our implementation), schwarze@ (who provided a detailed tracking of historical facts) and millert@ Submitted by: Igor Sobrado Discussed with: mckusick Obtained from: OpenBSD project MFC after: 2 weeks Modified: head/bin/ls/ls.1 head/bin/ls/ls.c Modified: head/bin/ls/ls.1 == --- head/bin/ls/ls.1Thu Apr 3 01:46:03 2014(r264063) +++ head/bin/ls/ls.1Thu Apr 3 05:48:28 2014(r264064) @@ -194,6 +194,8 @@ Use time when file status was last chang Directories are listed as plain files (not searched recursively). .It Fl f Output is not sorted. +This option turns on +.Fl a . .It Fl g This option is deprecated and is only available for compatibility with Modified: head/bin/ls/ls.c == --- head/bin/ls/ls.cThu Apr 3 01:46:03 2014(r264063) +++ head/bin/ls/ls.cThu Apr 3 05:48:28 2014(r264064) @@ -226,6 +226,9 @@ main(int argc, char *argv[]) f_accesstime = 0; f_statustime = 0; break; + case 'f': + f_nosort = 1; + /* FALLTHROUGH */ case 'a': fts_options |= FTS_SEEDOT; /* FALLTHROUGH */ @@ -300,9 +303,6 @@ main(int argc, char *argv[]) f_listdir = 1; f_recursive = 0; break; - case 'f': - f_nosort = 1; - break; case 'g': /* Compatibility with 4.3BSD. */ break; case 'h': ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r264066 - head/bin/ls
Author: grog Date: Thu Apr 3 05:49:28 2014 New Revision: 264066 URL: http://svnweb.freebsd.org/changeset/base/264066 Log: Add information on standards compliance of many options. MFC after:2 weeks Modified: head/bin/ls/ls.1 Modified: head/bin/ls/ls.1 == --- head/bin/ls/ls.1Thu Apr 3 05:48:56 2014(r264065) +++ head/bin/ls/ls.1Thu Apr 3 05:49:28 2014(r264066) @@ -87,6 +87,8 @@ and current locale settings) in file nam where .Va xxx is the numeric value of the character in octal. +This option is not defined in +.St -p1003.1-2001 . .It Fl C Force multi-column output; this is the default when output is to a terminal. .It Fl D Ar format @@ -104,6 +106,8 @@ different number of columns in the outpu This option overrides the .Fl T option. +This option is not defined in +.St -p1003.1-2001 . .It Fl F Display a slash .Pq Ql / @@ -132,6 +136,8 @@ in the environment. (See below.) This functionality can be compiled out by removing the definition of .Ev COLORLS . +This option is not defined in +.St -p1003.1-2001 . .It Fl H Symbolic links on the command line are followed. This option is assumed if @@ -144,6 +150,8 @@ options are specified. Prevent .Fl A from being automatically set for the super-user. +This option is not defined in +.St -p1003.1-2001 . .It Fl L If argument is a symbolic link, list the file or directory the link references rather than the link itself. @@ -171,13 +179,21 @@ month, day, hour, minute, second, and ye The .Fl D option gives even more control over the output format. +This option is not defined in +.St -p1003.1-2001 . .It Fl U Use time when file was created for sorting or printing. +This option is not defined in +.St -p1003.1-2001 . .It Fl W Display whiteouts when scanning directories. +This option is not defined in +.St -p1003.1-2001 . .It Fl Z Display each file's MAC label; see .Xr maclabel 7 . +This option is not defined in +.St -p1003.1-2001 . .It Fl a Include directory entries whose names begin with a dot @@ -188,6 +204,8 @@ As but use .Tn C escape codes whenever possible. +This option is not defined in +.St -p1003.1-2001 . .It Fl c Use time when file status was last changed for sorting or printing. .It Fl d @@ -196,19 +214,38 @@ Directories are listed as plain files (n Output is not sorted. This option turns on .Fl a . +It also negates the effect of the +.Fl r , +.Fl S +and +.Fl t +options. +As allowd by +.St -p1003.1-2001 , +this option has no effect on the +.Fl d , +.Fl l , +.Fl R +and +.Fl s +options. .It Fl g -This option is deprecated and is only available for compatibility -with -.Bx 4.3 ; -it was used to display the group name in the long +This option has no effect. +It is only available for compatibility with +.Bx 4.3 , +where it was used to display the group name in the long .Pq Fl l format output. +This option is incompatible with +.St -p1003.1-2001 . .It Fl h When used with the .Fl l option, use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the number of digits to four or fewer using base 2 for sizes. +This option is not defined in +.St -p1003.1-2001 . .It Fl i For each file, print the file's file serial number (inode number). .It Fl k @@ -217,6 +254,8 @@ This has the same effect as setting envi to 1024, except that it also nullifies any .Fl h options to its left. +This option is not defined in +.St -p1003.1-2001 . .It Fl l (The lowercase letter .Dq ell . ) @@ -234,6 +273,8 @@ output. Include the file flags in a long .Pq Fl l output. +This option is incompatible with +.St -p1003.1-2001 . See .Xr chflags 1 for a list of file flags and their meanings. @@ -293,6 +334,8 @@ or printing Force raw printing of non-printable characters. This is the default when output is not to a terminal. +This option is not defined in +.St -p1003.1-2001 . .It Fl x The same as .Fl C , @@ -307,6 +350,8 @@ This has the same effect as setting See the description of the .Fl t option for more details. +This option is not defined in +.St -p1003.1-2001 . .It Fl 1 (The numeric digit .Dq one . ) @@ -323,6 +368,8 @@ non-monetary separator returned by typically a comma or period. If no locale is set, or the locale does not have a non-monetary separator, this option has no effect. +This option is not defined in +.St -p1003.1-2001 . .El .Pp The @@ -762,13 +809,19 @@ specification. .Xr getfmac 8 .Sh STANDARDS With the exception of options -.Fl I , g , n +.Fl g , n and .Fl o , the .Nm utility conforms to .St -p1003.1-2001 . +The options +.Fl B , D , G , I , T , U , W , Z , b , h , k , w , y +and +.Fl , +are compatible extensions not defined in +.St -p1003.1-2001 . .Pp The ACL support is compatible with .Tn IEEE ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To