svn commit: r270870 - head/sys/net
Author: glebius Date: Sun Aug 31 06:46:21 2014 New Revision: 270870 URL: http://svnweb.freebsd.org/changeset/base/270870 Log: o Remove struct if_data from struct ifnet. Now it is merely API structure for route(4) socket and ifmib(4) sysctl. o Move fields from if_data to ifnet, but keep all statistic counters separate, since they should disappear later. o Provide function if_data_copy() to fill if_data, utilize it in routing socket and ifmib handler. o Provide overridable ifnet(9) method to fetch counters. If no provided, if_get_counters_compat() would be used, that returns old counters. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_mib.c head/sys/net/if_var.h head/sys/net/rtsock.c Modified: head/sys/net/if.c == --- head/sys/net/if.c Sun Aug 31 06:30:50 2014(r270869) +++ head/sys/net/if.c Sun Aug 31 06:46:21 2014(r270870) @@ -605,8 +605,7 @@ if_attach_internal(struct ifnet *ifp, in if_addgroup(ifp, IFG_ALL); getmicrotime(ifp-if_lastchange); - ifp-if_data.ifi_epoch = time_uptime; - ifp-if_data.ifi_datalen = sizeof(struct if_data); + ifp-if_epoch = time_uptime; KASSERT((ifp-if_transmit == NULL ifp-if_qflush == NULL) || (ifp-if_transmit != NULL ifp-if_qflush != NULL), @@ -615,7 +614,10 @@ if_attach_internal(struct ifnet *ifp, in ifp-if_transmit = if_transmit; ifp-if_qflush = if_qflush; } - + + if (ifp-if_get_counter == NULL) + ifp-if_get_counter = if_get_counter_compat; + if (!vmove) { #ifdef MAC mac_ifnet_create(ifp); @@ -1384,6 +1386,77 @@ if_rtdel(struct radix_node *rn, void *ar } /* + * Return counter values from old racy non-pcpu counters. + */ +uint64_t +if_get_counter_compat(struct ifnet *ifp, ifnet_counter cnt) +{ + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (ifp-if_ipackets); + case IFCOUNTER_IERRORS: + return (ifp-if_ierrors); + case IFCOUNTER_OPACKETS: + return (ifp-if_opackets); + case IFCOUNTER_OERRORS: + return (ifp-if_oerrors); + case IFCOUNTER_COLLISIONS: + return (ifp-if_collisions); + case IFCOUNTER_IBYTES: + return (ifp-if_ibytes); + case IFCOUNTER_OBYTES: + return (ifp-if_obytes); + case IFCOUNTER_IMCASTS: + return (ifp-if_imcasts); + case IFCOUNTER_OMCASTS: + return (ifp-if_omcasts); + case IFCOUNTER_IQDROPS: + return (ifp-if_iqdrops); + case IFCOUNTER_OQDROPS: + return (ifp-if_oqdrops); + case IFCOUNTER_NOPROTO: + return (ifp-if_noproto); + } + panic(%s: unknown counter %d, __func__, cnt); +} + +/* + * Copy data from ifnet to userland API structure if_data. + */ +void +if_data_copy(struct ifnet *ifp, struct if_data *ifd) +{ + + ifd-ifi_type = ifp-if_type; + ifd-ifi_physical = 0; + ifd-ifi_addrlen = ifp-if_addrlen; + ifd-ifi_hdrlen = ifp-if_hdrlen; + ifd-ifi_link_state = ifp-if_link_state; + ifd-ifi_vhid = 0; + ifd-ifi_datalen = sizeof(struct if_data); + ifd-ifi_mtu = ifp-if_mtu; + ifd-ifi_metric = ifp-if_metric; + ifd-ifi_baudrate = ifp-if_baudrate; + ifd-ifi_hwassist = ifp-if_hwassist; + ifd-ifi_epoch = ifp-if_epoch; + ifd-ifi_lastchange = ifp-if_lastchange; + + ifd-ifi_ipackets = ifp-if_get_counter(ifp, IFCOUNTER_IPACKETS); + ifd-ifi_ierrors = ifp-if_get_counter(ifp, IFCOUNTER_IERRORS); + ifd-ifi_opackets = ifp-if_get_counter(ifp, IFCOUNTER_OPACKETS); + ifd-ifi_oerrors = ifp-if_get_counter(ifp, IFCOUNTER_OERRORS); + ifd-ifi_collisions = ifp-if_get_counter(ifp, IFCOUNTER_COLLISIONS); + ifd-ifi_ibytes = ifp-if_get_counter(ifp, IFCOUNTER_IBYTES); + ifd-ifi_obytes = ifp-if_get_counter(ifp, IFCOUNTER_OBYTES); + ifd-ifi_imcasts = ifp-if_get_counter(ifp, IFCOUNTER_IMCASTS); + ifd-ifi_omcasts = ifp-if_get_counter(ifp, IFCOUNTER_OMCASTS); + ifd-ifi_iqdrops = ifp-if_get_counter(ifp, IFCOUNTER_IQDROPS); + ifd-ifi_oqdrops = ifp-if_get_counter(ifp, IFCOUNTER_OQDROPS); + ifd-ifi_noproto = ifp-if_get_counter(ifp, IFCOUNTER_NOPROTO); +} + +/* * Wrapper functions for struct ifnet address list locking macros. These are * used by kernel modules to avoid encoding programming interface or binary * interface assumptions that may be violated when kernel-internal locking @@ -2167,7 +2240,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, break; case
Re: svn commit: r270870 - head/sys/net
On 31.08.2014 10:46, Gleb Smirnoff wrote: Author: glebius Date: Sun Aug 31 06:46:21 2014 New Revision: 270870 URL: http://svnweb.freebsd.org/changeset/base/270870 Log: o Remove struct if_data from struct ifnet. Now it is merely API structure for route(4) socket and ifmib(4) sysctl. o Move fields from if_data to ifnet, but keep all statistic counters separate, since they should disappear later. o Provide function if_data_copy() to fill if_data, utilize it in routing socket and ifmib handler. o Provide overridable ifnet(9) method to fetch counters. If no provided, if_get_counters_compat() would be used, that returns old counters. Thanks! Sponsored by: Netflix Sponsored by:Nginx, Inc. Modified: head/sys/net/if.c head/sys/net/if_mib.c head/sys/net/if_var.h head/sys/net/rtsock.c Modified: head/sys/net/if.c == --- head/sys/net/if.c Sun Aug 31 06:30:50 2014(r270869) +++ head/sys/net/if.c Sun Aug 31 06:46:21 2014(r270870) @@ -605,8 +605,7 @@ if_attach_internal(struct ifnet *ifp, in if_addgroup(ifp, IFG_ALL); getmicrotime(ifp-if_lastchange); - ifp-if_data.ifi_epoch = time_uptime; - ifp-if_data.ifi_datalen = sizeof(struct if_data); + ifp-if_epoch = time_uptime; KASSERT((ifp-if_transmit == NULL ifp-if_qflush == NULL) || (ifp-if_transmit != NULL ifp-if_qflush != NULL), @@ -615,7 +614,10 @@ if_attach_internal(struct ifnet *ifp, in ifp-if_transmit = if_transmit; ifp-if_qflush = if_qflush; } - + + if (ifp-if_get_counter == NULL) + ifp-if_get_counter = if_get_counter_compat; + if (!vmove) { #ifdef MAC mac_ifnet_create(ifp); @@ -1384,6 +1386,77 @@ if_rtdel(struct radix_node *rn, void *ar } /* + * Return counter values from old racy non-pcpu counters. + */ +uint64_t +if_get_counter_compat(struct ifnet *ifp, ifnet_counter cnt) +{ + + switch (cnt) { + case IFCOUNTER_IPACKETS: + return (ifp-if_ipackets); + case IFCOUNTER_IERRORS: + return (ifp-if_ierrors); + case IFCOUNTER_OPACKETS: + return (ifp-if_opackets); + case IFCOUNTER_OERRORS: + return (ifp-if_oerrors); + case IFCOUNTER_COLLISIONS: + return (ifp-if_collisions); + case IFCOUNTER_IBYTES: + return (ifp-if_ibytes); + case IFCOUNTER_OBYTES: + return (ifp-if_obytes); + case IFCOUNTER_IMCASTS: + return (ifp-if_imcasts); + case IFCOUNTER_OMCASTS: + return (ifp-if_omcasts); + case IFCOUNTER_IQDROPS: + return (ifp-if_iqdrops); + case IFCOUNTER_OQDROPS: + return (ifp-if_oqdrops); + case IFCOUNTER_NOPROTO: + return (ifp-if_noproto); + } + panic(%s: unknown counter %d, __func__, cnt); +} + +/* + * Copy data from ifnet to userland API structure if_data. + */ +void +if_data_copy(struct ifnet *ifp, struct if_data *ifd) +{ + + ifd-ifi_type = ifp-if_type; + ifd-ifi_physical = 0; + ifd-ifi_addrlen = ifp-if_addrlen; + ifd-ifi_hdrlen = ifp-if_hdrlen; + ifd-ifi_link_state = ifp-if_link_state; + ifd-ifi_vhid = 0; + ifd-ifi_datalen = sizeof(struct if_data); + ifd-ifi_mtu = ifp-if_mtu; + ifd-ifi_metric = ifp-if_metric; + ifd-ifi_baudrate = ifp-if_baudrate; + ifd-ifi_hwassist = ifp-if_hwassist; + ifd-ifi_epoch = ifp-if_epoch; + ifd-ifi_lastchange = ifp-if_lastchange; + + ifd-ifi_ipackets = ifp-if_get_counter(ifp, IFCOUNTER_IPACKETS); + ifd-ifi_ierrors = ifp-if_get_counter(ifp, IFCOUNTER_IERRORS); + ifd-ifi_opackets = ifp-if_get_counter(ifp, IFCOUNTER_OPACKETS); + ifd-ifi_oerrors = ifp-if_get_counter(ifp, IFCOUNTER_OERRORS); + ifd-ifi_collisions = ifp-if_get_counter(ifp, IFCOUNTER_COLLISIONS); + ifd-ifi_ibytes = ifp-if_get_counter(ifp, IFCOUNTER_IBYTES); + ifd-ifi_obytes = ifp-if_get_counter(ifp, IFCOUNTER_OBYTES); + ifd-ifi_imcasts = ifp-if_get_counter(ifp, IFCOUNTER_IMCASTS); + ifd-ifi_omcasts = ifp-if_get_counter(ifp, IFCOUNTER_OMCASTS); + ifd-ifi_iqdrops = ifp-if_get_counter(ifp, IFCOUNTER_IQDROPS); + ifd-ifi_oqdrops = ifp-if_get_counter(ifp, IFCOUNTER_OQDROPS); + ifd-ifi_noproto = ifp-if_get_counter(ifp, IFCOUNTER_NOPROTO); +} + +/* * Wrapper functions for struct ifnet address list locking macros. These are * used by kernel modules to avoid encoding programming interface or binary * interface assumptions that may be violated when kernel-internal locking @@ -2167,7 +2240,8 @@
Re: svn commit: r270861 - in head/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs
On 30 Aug 2014, at 21:44 , Steven Hartland s...@freebsd.org wrote: Author: smh Date: Sat Aug 30 21:44:32 2014 New Revision: 270861 URL: http://svnweb.freebsd.org/changeset/base/270861 Log: Ensure that ZFS ARC free memory checks include cached pages Also restore kmem_used() check for i386 as it has KVA limits that the raw page counts above don’t consider I see this on pc98 and i386 buildworld: === cddl/usr.bin/zinject (all) /storage/head/obj//pc98.i386/scratch/tmp/bz/head.svn/tmp/usr/lib/libzpool.so: undefined reference to `kmem_used' cc: error: linker command failed with exit code 1 (use -v to see invocation) --- zinject --- *** [zinject] Error code 1 PR: 187594 Reviewed by: peter X-MFC-With: r270759 Review: D700 Sponsored by:Multiplay Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c == --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Aug 30 20:26:30 2014(r270860) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Sat Aug 30 21:44:32 2014(r270861) @@ -152,7 +152,7 @@ u_int kmem_free_count(void) { - return (vm_cnt.v_free_count); + return (vm_cnt.v_free_count + vm_cnt.v_cache_count); } u_int @@ -169,6 +169,13 @@ kmem_size(void) return (kmem_size_val); } +uint64_t +kmem_used(void) +{ + + return (vmem_size(kmem_arena, VMEM_ALLOC)); +} + static int kmem_std_constructor(void *mem, int size __unused, void *private, int flags) { Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h == --- head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 20:26:30 2014(r270860) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Sat Aug 30 21:44:32 2014(r270861) @@ -66,6 +66,7 @@ typedef struct kmem_cache { void *zfs_kmem_alloc(size_t size, int kmflags); void zfs_kmem_free(void *buf, size_t size); uint64_t kmem_size(void); +uint64_t kmem_used(void); u_int kmem_page_count(void); /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 30 20:26:30 2014(r270860) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Aug 30 21:44:32 2014(r270861) @@ -2563,6 +2563,14 @@ arc_reclaim_needed(void) #endif/* sun */ #else +#ifdef __i386__ + /* i386 has KVA limits that the raw page counts above don't consider */ + if (kmem_used() (kmem_size() * 3) / 4) { + DTRACE_PROBE2(arc__reclaim_used, uint64_t, + kmem_used(), uint64_t, (kmem_size() * 3) / 4); + return (1); + } +#endif if (spa_get_random(100) == 0) return (1); #endif — Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983 ___ 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: r270862 - head/sys/arm/arm
On 30 Aug 2014, at 22:21 , Ian Lepore i...@freebsd.org wrote: Author: ian Date: Sat Aug 30 22:21:57 2014 New Revision: 270862 URL: http://svnweb.freebsd.org/changeset/base/270862 Log: Fix the handling of MMU type in the AP entry code. The ARM_MMU_V6/V7 symbols are always #defined to 0 or 1, so use #if SYM not #if defined(SYM). Also, it helps if you include the header file that defines the symbols. I can only assume it’s been due to this commit: 22 warnings generated. linking kernel.debug locore.o: In function `mpentry': (.text+0x1ec): undefined reference to `armv6_idcache_inv_all' --- kernel.debug --- *** [kernel.debug] Error code 1 bmake: stopped in /storage/head/obj/arm.armv6/scratch/tmp/bz/head.svn/sys/ARMADAXP Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S == --- head/sys/arm/arm/locore.S Sat Aug 30 21:44:32 2014(r270861) +++ head/sys/arm/arm/locore.S Sat Aug 30 22:21:57 2014(r270862) @@ -37,6 +37,7 @@ #include sys/syscall.h #include machine/asm.h #include machine/armreg.h +#include machine/cpuconf.h #include machine/pte.h __FBSDID($FreeBSD$); @@ -389,9 +390,9 @@ ASENTRY_NP(mpentry) nop CPWAIT(r0) -#if defined(ARM_MMU_V6) +#if ARM_MMU_V6 bl armv6_idcache_inv_all /* Modifies r0 only */ -#elif defined(ARM_MMU_V7) +#elif ARM_MMU_V7 bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ #endif — Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983 ___ 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: r270871 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: peter Date: Sun Aug 31 09:05:02 2014 New Revision: 270871 URL: http://svnweb.freebsd.org/changeset/base/270871 Log: Move the restored #ifdef i386 test back inside the #ifdef _KERNEL block where it originally was. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 31 06:46:21 2014(r270870) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Aug 31 09:05:02 2014(r270871) @@ -2560,9 +2560,7 @@ arc_reclaim_needed(void) (btop(vmem_size(heap_arena, VMEM_FREE | VMEM_ALLOC)) 2)) return (1); #endif -#endif /* sun */ - -#else +#else /* sun */ #ifdef __i386__ /* i386 has KVA limits that the raw page counts above don't consider */ if (kmem_used() (kmem_size() * 3) / 4) { @@ -2571,6 +2569,9 @@ arc_reclaim_needed(void) return (1); } #endif +#endif /* sun */ + +#else if (spa_get_random(100) == 0) return (1); #endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r270872 - head/sbin/camcontrol
Author: gavin Date: Sun Aug 31 10:28:31 2014 New Revision: 270872 URL: http://svnweb.freebsd.org/changeset/base/270872 Log: Fix character case in examples for camcontrol security - should be -U user not -u user. PR: 193179 Submitted by: milios ccsys com MFC after:3 days Modified: head/sbin/camcontrol/camcontrol.8 Modified: head/sbin/camcontrol/camcontrol.8 == --- head/sbin/camcontrol/camcontrol.8 Sun Aug 31 09:05:02 2014 (r270871) +++ head/sbin/camcontrol/camcontrol.8 Sun Aug 31 10:28:31 2014 (r270872) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd November 20, 2013 +.Dd August 31, 2014 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -1884,12 +1884,12 @@ camcontrol security ada0 .Pp Report security support and settings for ada0 .Bd -literal -offset indent -camcontrol security ada0 -u user -s MyPass +camcontrol security ada0 -U user -s MyPass .Ed .Pp Enable security on device ada0 with the password MyPass .Bd -literal -offset indent -camcontrol security ada0 -u user -e MyPass +camcontrol security ada0 -U user -e MyPass .Ed .Pp Secure erase ada0 which has had security enabled with user password MyPass ___ 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: r270858 - head/sys/arm/conf
On Sat, 30 Aug 2014 20:00:18 + (UTC) Michael Tuexen tue...@freebsd.org wrote: Author: tuexen Date: Sat Aug 30 20:00:18 2014 New Revision: 270858 URL: http://svnweb.freebsd.org/changeset/base/270858 Log: Remove FDT option, since it is in every file, which includes this one. It should be the other way around, i.e. in this file and removed from all that include it. FDT is required for armv6 and this is still a valid kernel config. Andrew ___ 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: r270874 - in head/sys: dev/netmap net
Author: glebius Date: Sun Aug 31 11:33:19 2014 New Revision: 270874 URL: http://svnweb.freebsd.org/changeset/base/270874 Log: Provide pointer from struct ifnet to struct netmap_adapter, instead of abusing spare field. Modified: head/sys/dev/netmap/netmap_kern.h head/sys/net/if_var.h Modified: head/sys/dev/netmap/netmap_kern.h == --- head/sys/dev/netmap/netmap_kern.h Sun Aug 31 10:42:52 2014 (r270873) +++ head/sys/dev/netmap/netmap_kern.h Sun Aug 31 11:33:19 2014 (r270874) @@ -1187,7 +1187,7 @@ extern int netmap_generic_rings; * WNA is used to write it. */ #ifndef WNA -#defineWNA(_ifp) (_ifp)-if_pspare[0] +#defineWNA(_ifp) (_ifp)-if_netmap #endif #defineNA(_ifp)((struct netmap_adapter *)WNA(_ifp)) Modified: head/sys/net/if_var.h == --- head/sys/net/if_var.h Sun Aug 31 10:42:52 2014(r270873) +++ head/sys/net/if_var.h Sun Aug 31 11:33:19 2014(r270874) @@ -67,6 +67,7 @@ struct ifvlantrunk; struct route; /* if_output */ struct vnet; struct ifmedia; +struct netmap_adapter; #ifdef _KERNEL #include sys/mbuf.h /* ifqueue only? */ @@ -202,6 +203,7 @@ struct ifnet { void*if_pf_kif; /* pf glue */ struct carp_if *if_carp; /* carp interface structure */ struct label *if_label;/* interface MAC label */ + struct netmap_adapter *if_netmap; /* netmap(4) softc */ /* Various procedures of the layer2 encapsulation and drivers. */ int (*if_output)/* output routine (enqueue) */ ___ 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: r270877 - head/sys/net
On 31 Aug 2014, at 13:58 , Bjoern A. Zeeb b...@freebsd.org wrote: On 31 Aug 2014, at 13:30 , Gleb Smirnoff gleb...@freebsd.org wrote: Author: glebius Date: Sun Aug 31 13:30:54 2014 New Revision: 270877 URL: http://svnweb.freebsd.org/changeset/base/270877 Log: Toss fields so that no padding field is required to achieve alignment. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h == --- head/sys/net/if_var.hSun Aug 31 12:48:13 2014(r270876) +++ head/sys/net/if_var.hSun Aug 31 13:30:54 2014(r270877) @@ -146,11 +146,11 @@ struct ifnet { /* Variable fields that are touched by the stack and drivers. */ int if_flags; /* up/down, broadcast, etc. */ +int if_drv_flags; /* driver-managed status flags */ int if_capabilities;/* interface features capabilities */ int if_capenable; /* enabled features capabilities */ void*if_linkmib;/* link-type-specific MIB data */ size_t if_linkmiblen; /* length of above data */ -int if_drv_flags; /* driver-managed status flags */ u_int if_refcount;/* reference count */ /* These fields are shared with struct if_data. */ @@ -158,7 +158,6 @@ struct ifnet { uint8_t if_addrlen; /* media address length */ uint8_t if_hdrlen; /* media header length */ uint8_t if_link_state; /* current link state */ -uint32_tif_spare32; Doesn’t this leave a gap on 64bit alignment now again? Disregard. It’s fine. uint32_tif_mtu; /* maximum transmission unit */ uint32_tif_metric; /* routing metric (external only) */ uint64_tif_baudrate;/* linespeed */ — Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983 — Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983 ___ 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: r270878 - head/sys/arm/include
Author: ian Date: Sun Aug 31 15:23:49 2014 New Revision: 270878 URL: http://svnweb.freebsd.org/changeset/base/270878 Log: The Marvell PJ4B cpu family is armv7, not armv6. Modified: head/sys/arm/include/cpuconf.h Modified: head/sys/arm/include/cpuconf.h == --- head/sys/arm/include/cpuconf.h Sun Aug 31 13:30:54 2014 (r270877) +++ head/sys/arm/include/cpuconf.h Sun Aug 31 15:23:49 2014 (r270878) @@ -135,13 +135,13 @@ #defineARM_MMU_GENERIC 0 #endif -#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) +#if defined(CPU_ARM1136) || defined(CPU_ARM1176) #define ARM_MMU_V6 1 #else #define ARM_MMU_V6 0 #endif -#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) +#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) || defined(CPU_MV_PJ4B) #define ARM_MMU_V7 1 #else #define ARM_MMU_V7 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
Re: svn commit: r270862 - head/sys/arm/arm
On Sun, 2014-08-31 at 08:58 +, Bjoern A. Zeeb wrote: On 30 Aug 2014, at 22:21 , Ian Lepore i...@freebsd.org wrote: Author: ian Date: Sat Aug 30 22:21:57 2014 New Revision: 270862 URL: http://svnweb.freebsd.org/changeset/base/270862 Log: Fix the handling of MMU type in the AP entry code. The ARM_MMU_V6/V7 symbols are always #defined to 0 or 1, so use #if SYM not #if defined(SYM). Also, it helps if you include the header file that defines the symbols. I can only assume it’s been due to this commit: 22 warnings generated. linking kernel.debug locore.o: In function `mpentry': (.text+0x1ec): undefined reference to `armv6_idcache_inv_all' --- kernel.debug --- *** [kernel.debug] Error code 1 bmake: stopped in /storage/head/obj/arm.armv6/scratch/tmp/bz/head.svn/sys/ARMADAXP Yes, apparently this change exposed a long-standing bug in another header file. Fixed in r270878. -- Ian Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S == --- head/sys/arm/arm/locore.S Sat Aug 30 21:44:32 2014 (r270861) +++ head/sys/arm/arm/locore.S Sat Aug 30 22:21:57 2014 (r270862) @@ -37,6 +37,7 @@ #include sys/syscall.h #include machine/asm.h #include machine/armreg.h +#include machine/cpuconf.h #include machine/pte.h __FBSDID($FreeBSD$); @@ -389,9 +390,9 @@ ASENTRY_NP(mpentry) nop CPWAIT(r0) -#if defined(ARM_MMU_V6) +#if ARM_MMU_V6 bl armv6_idcache_inv_all /* Modifies r0 only */ -#elif defined(ARM_MMU_V7) +#elif ARM_MMU_V7 bl armv7_idcache_inv_all /* Modifies r0-r3, ip */ #endif — Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983 ___ 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: r270879 - head/sys/arm/conf
Author: ian Date: Sun Aug 31 15:25:40 2014 New Revision: 270879 URL: http://svnweb.freebsd.org/changeset/base/270879 Log: Put option FDT into the base IMX6 config and remove it from the config of boards based on IMX6. Modified: head/sys/arm/conf/IMX6 head/sys/arm/conf/WANDBOARD-DUAL head/sys/arm/conf/WANDBOARD-QUAD head/sys/arm/conf/WANDBOARD-SOLO Modified: head/sys/arm/conf/IMX6 == --- head/sys/arm/conf/IMX6 Sun Aug 31 15:23:49 2014(r270878) +++ head/sys/arm/conf/IMX6 Sun Aug 31 15:25:40 2014(r270879) @@ -147,6 +147,7 @@ device u3g # USB modems optionsROOTDEVNAME=\ufs:mmcsd0s2a\ # ARM and SoC-specific options +optionsFDT # Configure using FDT/DTB data. optionsSMP # Enable multiple cores optionsVFP # Enable floating point hardware support optionsFREEBSD_BOOT_LOADER # Process metadata passed from loader(8) Modified: head/sys/arm/conf/WANDBOARD-DUAL == --- head/sys/arm/conf/WANDBOARD-DUALSun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/WANDBOARD-DUALSun Aug 31 15:25:40 2014 (r270879) @@ -23,7 +23,6 @@ include IMX6 ident WANDBOARD-DUAL # Flattened Device Tree -optionsFDT optionsFDT_DTB_STATIC makeoptionsFDT_DTS_FILE=wandboard-dual.dts Modified: head/sys/arm/conf/WANDBOARD-QUAD == --- head/sys/arm/conf/WANDBOARD-QUADSun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/WANDBOARD-QUADSun Aug 31 15:25:40 2014 (r270879) @@ -23,7 +23,6 @@ include IMX6 ident WANDBOARD-QUAD # Flattened Device Tree -optionsFDT optionsFDT_DTB_STATIC makeoptionsFDT_DTS_FILE=wandboard-quad.dts Modified: head/sys/arm/conf/WANDBOARD-SOLO == --- head/sys/arm/conf/WANDBOARD-SOLOSun Aug 31 15:23:49 2014 (r270878) +++ head/sys/arm/conf/WANDBOARD-SOLOSun Aug 31 15:25:40 2014 (r270879) @@ -23,7 +23,6 @@ include IMX6 ident WANDBOARD-SOLO # Flattened Device Tree -optionsFDT optionsFDT_DTB_STATIC makeoptionsFDT_DTS_FILE=wandboard-solo.dts ___ 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: r270858 - head/sys/arm/conf
On Sun, 2014-08-31 at 12:07 +0100, Andrew Turner wrote: On Sat, 30 Aug 2014 20:00:18 + (UTC) Michael Tuexen tue...@freebsd.org wrote: Author: tuexen Date: Sat Aug 30 20:00:18 2014 New Revision: 270858 URL: http://svnweb.freebsd.org/changeset/base/270858 Log: Remove FDT option, since it is in every file, which includes this one. It should be the other way around, i.e. in this file and removed from all that include it. FDT is required for armv6 and this is still a valid kernel config. Andrew I agree, we're going to have more configs soon I think based on IMX6. I changed it in r270879. -- Ian ___ 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: r270870 - head/sys/net
On Sun, Aug 31, 2014 at 12:20:07PM +0400, Alexander V. Chernikov wrote: A On 31.08.2014 10:46, Gleb Smirnoff wrote: A Author: glebius A Date: Sun Aug 31 06:46:21 2014 A New Revision: 270870 A URL: http://svnweb.freebsd.org/changeset/base/270870 A A Log: A o Remove struct if_data from struct ifnet. Now it is merely API structure A for route(4) socket and ifmib(4) sysctl. A o Move fields from if_data to ifnet, but keep all statistic counters A separate, since they should disappear later. A o Provide function if_data_copy() to fill if_data, utilize it in routing A socket and ifmib handler. A o Provide overridable ifnet(9) method to fetch counters. If no provided, A if_get_counters_compat() would be used, that returns old counters. A Thanks! This isn't yet finished, but you see the direction. :) -- Totus tuus, Glebius. ___ 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: r270882 - in head/lib/libc/arm: gen string sys
Author: ian Date: Sun Aug 31 17:21:51 2014 New Revision: 270882 URL: http://svnweb.freebsd.org/changeset/base/270882 Log: In ARM asm code, ensure that every ENTRY(foo) has a matching END(foo). The EABI unwind info requires a .fnend for every .fnstart, and newer binutils will complain about seeing two .fnstart in a row. This change allows newer tools to compile our code. Reported by: bapt Reviewed by: imp Modified: head/lib/libc/arm/gen/__aeabi_read_tp.S head/lib/libc/arm/gen/_ctx_start.S head/lib/libc/arm/gen/_setjmp.S head/lib/libc/arm/gen/alloca.S head/lib/libc/arm/gen/divsi3.S head/lib/libc/arm/gen/setjmp.S head/lib/libc/arm/gen/sigsetjmp.S head/lib/libc/arm/string/ffs.S head/lib/libc/arm/string/memcmp.S head/lib/libc/arm/string/memcpy_arm.S head/lib/libc/arm/string/memcpy_xscale.S head/lib/libc/arm/string/memmove.S head/lib/libc/arm/string/memset.S head/lib/libc/arm/string/strcmp.S head/lib/libc/arm/string/strlen.S head/lib/libc/arm/string/strncmp.S head/lib/libc/arm/sys/Ovfork.S head/lib/libc/arm/sys/brk.S head/lib/libc/arm/sys/cerror.S head/lib/libc/arm/sys/pipe.S head/lib/libc/arm/sys/ptrace.S head/lib/libc/arm/sys/sbrk.S Modified: head/lib/libc/arm/gen/__aeabi_read_tp.S == --- head/lib/libc/arm/gen/__aeabi_read_tp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/__aeabi_read_tp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -38,6 +38,7 @@ ENTRY(__aeabi_read_tp) mrc p15, 0, r0, c13, c0, 3 #endif RET +END(__aeabi_read_tp) #ifdef ARM_TP_ADDRESS .Larm_tp_address: Modified: head/lib/libc/arm/gen/_ctx_start.S == --- head/lib/libc/arm/gen/_ctx_start.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/_ctx_start.S Sun Aug 31 17:21:51 2014 (r270882) @@ -7,3 +7,4 @@ ENTRY(_ctx_start) mov r0, r5 bl _C_LABEL(ctx_done) bl _C_LABEL(abort) +END(_ctx_start) Modified: head/lib/libc/arm/gen/_setjmp.S == --- head/lib/libc/arm/gen/_setjmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/_setjmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -89,6 +89,7 @@ ENTRY(_setjmp) movr0, #0x RET +END(_setjmp) .L_setjmp_magic: .word _JB_MAGIC__SETJMP @@ -140,3 +141,4 @@ botch: #else b . #endif +END(_longjmp) Modified: head/lib/libc/arm/gen/alloca.S == --- head/lib/libc/arm/gen/alloca.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/alloca.S Sun Aug 31 17:21:51 2014 (r270882) @@ -43,3 +43,4 @@ ENTRY(alloca) sub sp, sp, r0 /* Adjust the stack pointer */ mov r0, sp /* r0 = base of new space */ RET +END(alloca) Modified: head/lib/libc/arm/gen/divsi3.S == --- head/lib/libc/arm/gen/divsi3.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/divsi3.S Sun Aug 31 17:21:51 2014 (r270882) @@ -29,6 +29,7 @@ ENTRY(__umodsi3) add sp, sp, #4 /* unalign stack */ mov r0, r1 ldmfd sp!, {pc} +END(__umodsi3) ENTRY(__modsi3) stmfd sp!, {lr} @@ -48,6 +49,7 @@ ENTRY(__modsi3) mvn r0, #0 #endif RET +END(__modsi3) ENTRY(__udivsi3) .L_udivide:/* r0 = r0 / r1; r1 = r0 % r1 */ @@ -70,6 +72,7 @@ ENTRY(__udivsi3) mov r0, r1 mov r1, #0 RET +END(__udivsi3) ENTRY(__divsi3) .L_divide: /* r0 = r0 / r1; r1 = r0 % r1 */ @@ -385,3 +388,4 @@ ENTRY(__divsi3) addhs r3, r3, r2 mov r0, r3 RET +END(__divsi3) Modified: head/lib/libc/arm/gen/setjmp.S == --- head/lib/libc/arm/gen/setjmp.S Sun Aug 31 16:37:41 2014 (r270881) +++ head/lib/libc/arm/gen/setjmp.S Sun Aug 31 17:21:51 2014 (r270882) @@ -101,7 +101,7 @@ ENTRY(setjmp) .Lfpu_present: .word PIC_SYM(_libc_arm_fpu_present, GOTOFF) #endif /* __ARM_EABI__ */ - +END(setjmp) .weak _C_LABEL(longjmp) .set _C_LABEL(longjmp), _C_LABEL(__longjmp) @@ -150,3 +150,4 @@ ENTRY(__longjmp) bl PIC_SYM(_C_LABEL(longjmperror), PLT) bl PIC_SYM(_C_LABEL(abort), PLT) b . - 8 /* Cannot get here */ +END(__longjmp) Modified: head/lib/libc/arm/gen/sigsetjmp.S == --- head/lib/libc/arm/gen/sigsetjmp.S Sun Aug 31 16:37:41 2014
svn commit: r270883 - head/sys/kern
Author: alc Date: Sun Aug 31 17:38:41 2014 New Revision: 270883 URL: http://svnweb.freebsd.org/changeset/base/270883 Log: Automatically prefault a limited number of mappings to resident pages in shmat(2), just like mmap(2). MFC after:5 days Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c == --- head/sys/kern/sysv_shm.cSun Aug 31 17:21:51 2014(r270882) +++ head/sys/kern/sysv_shm.cSun Aug 31 17:38:41 2014(r270883) @@ -410,9 +410,9 @@ kern_shmat(td, shmid, shmaddr, shmflg) } vm_object_reference(shmseg-object); - rv = vm_map_find(p-p_vmspace-vm_map, shmseg-object, - 0, attach_va, size, 0, shmaddr != NULL ? VMFS_NO_SPACE : - VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE); + rv = vm_map_find(p-p_vmspace-vm_map, shmseg-object, 0, attach_va, + size, 0, shmaddr != NULL ? VMFS_NO_SPACE : VMFS_OPTIMAL_SPACE, + prot, prot, MAP_INHERIT_SHARE | MAP_PREFAULT_PARTIAL); if (rv != KERN_SUCCESS) { vm_object_deallocate(shmseg-object); error = ENOMEM; ___ 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: r270884 - head/sys/arm/include
Author: br Date: Sun Aug 31 17:40:19 2014 New Revision: 270884 URL: http://svnweb.freebsd.org/changeset/base/270884 Log: GIC (Cortex A's interrupt controller) supports up to 1020 IRQs. Modified: head/sys/arm/include/intr.h Modified: head/sys/arm/include/intr.h == --- head/sys/arm/include/intr.h Sun Aug 31 17:38:41 2014(r270883) +++ head/sys/arm/include/intr.h Sun Aug 31 17:40:19 2014(r270884) @@ -51,7 +51,7 @@ defined(CPU_XSCALE_IXP435) #define NIRQ 64 #elif defined(CPU_CORTEXA) -#define NIRQ 160 +#define NIRQ 1020 #elif defined(CPU_KRAIT) #define NIRQ 288 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) ___ 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: r270885 - head/sys/dev/sdhci
Author: marius Date: Sun Aug 31 17:56:54 2014 New Revision: 270885 URL: http://svnweb.freebsd.org/changeset/base/270885 Log: - Nuke unused sdhci_softc. - Static'ize sdhci_debug local to sdhci.c. - Const'ify PCI device description strings. - Nuke redundant resource ID members from sdhci_pci_softc. - Nuke unused hw.sdhci_pci.debug tunable. - Add support for using MSI instead of INTx, controllable via the tunable hw.sdhci.enable_msi (defaulting to on) and tested with a RICOH R5CE823 SD controller. - Use NULL instead of 0 for pointers. MFC after:3 days Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_if.m head/sys/dev/sdhci/sdhci_pci.c Modified: head/sys/dev/sdhci/sdhci.c == --- head/sys/dev/sdhci/sdhci.c Sun Aug 31 17:40:19 2014(r270884) +++ head/sys/dev/sdhci/sdhci.c Sun Aug 31 17:56:54 2014(r270885) @@ -52,21 +52,9 @@ __FBSDID($FreeBSD$); #include sdhci.h #include sdhci_if.h -struct sdhci_softc; +SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, sdhci driver); -struct sdhci_softc { - device_tdev;/* Controller device */ - struct resource *irq_res; /* IRQ resource */ - int irq_rid; - void*intrhand; /* Interrupt handle */ - - int num_slots; /* Number of slots on this controller */ - struct sdhci_slot slots[6]; -}; - -static SYSCTL_NODE(_hw, OID_AUTO, sdhci, CTLFLAG_RD, 0, sdhci driver); - -intsdhci_debug = 0; +static int sdhci_debug; SYSCTL_INT(_hw_sdhci, OID_AUTO, debug, CTLFLAG_RWTUN, sdhci_debug, 0, Debug level); #define RD1(slot, off) SDHCI_READ_1((slot)-bus, (slot), (off)) Modified: head/sys/dev/sdhci/sdhci.h == --- head/sys/dev/sdhci/sdhci.h Sun Aug 31 17:40:19 2014(r270884) +++ head/sys/dev/sdhci/sdhci.h Sun Aug 31 17:56:54 2014(r270885) @@ -223,6 +223,8 @@ #defineSDHCI_SPEC_200 1 #defineSDHCI_SPEC_300 2 +SYSCTL_DECL(_hw_sdhci); + struct sdhci_slot { u_int quirks; /* Chip specific quirks */ u_int caps; /* Override SDHCI_CAPABILITIES */ Modified: head/sys/dev/sdhci/sdhci_fdt.c == --- head/sys/dev/sdhci/sdhci_fdt.c Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci_fdt.c Sun Aug 31 17:56:54 2014 (r270885) @@ -180,7 +180,6 @@ sdhci_fdt_probe(device_t dev) if ((OF_getencprop(node, max-frequency, cid, sizeof(cid))) 0) sc-max_clk = cid; - return (0); } @@ -189,7 +188,7 @@ sdhci_fdt_attach(device_t dev) { struct sdhci_fdt_softc *sc = device_get_softc(dev); int err, slots, rid, i; - + sc-dev = dev; /* Allocate IRQ. */ @@ -241,7 +240,7 @@ sdhci_fdt_attach(device_t dev) struct sdhci_slot *slot = sc-slots[i]; sdhci_start_slot(slot); } - + return (0); } @@ -305,5 +304,6 @@ static driver_t sdhci_fdt_driver = { }; static devclass_t sdhci_fdt_devclass; -DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, 0,0); +DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, +NULL, NULL); MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); Modified: head/sys/dev/sdhci/sdhci_if.m == --- head/sys/dev/sdhci/sdhci_if.m Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci_if.m Sun Aug 31 17:56:54 2014 (r270885) @@ -62,6 +62,7 @@ #include sys/systm.h #include sys/lock.h #include sys/mutex.h +#include sys/sysctl.h #include sys/taskqueue.h #include machine/bus.h Modified: head/sys/dev/sdhci/sdhci_pci.c == --- head/sys/dev/sdhci/sdhci_pci.c Sun Aug 31 17:40:19 2014 (r270884) +++ head/sys/dev/sdhci/sdhci_pci.c Sun Aug 31 17:56:54 2014 (r270885) @@ -78,7 +78,7 @@ __FBSDID($FreeBSD$); static const struct sdhci_device { uint32_tmodel; uint16_tsubvendor; - char*desc; + const char *desc; u_int quirks; } sdhci_devices[] = { { 0x08221180, 0x, RICOH R5C822 SD, @@ -112,19 +112,16 @@ struct sdhci_pci_softc { device_tdev;/* Controller device */ u_int quirks; /* Chip specific quirks */ struct resource *irq_res; /* IRQ resource */ - int irq_rid; void*intrhand; /* Interrupt handle */ int
svn commit: r270893 - head/lib/msun/src
Author: kargl Date: Sun Aug 31 21:38:03 2014 New Revision: 270893 URL: http://svnweb.freebsd.org/changeset/base/270893 Log: Compute sin(pi*x) without actually doing the pi*x multiplication. sin_pi(x) is only called for x 0 and |x| 2**(p-1) where p is the precision of x. The new argument reduction is an optimization compared to the old code, and it removes a chunk of dead code. Accuracy tests in the intervals (-21,-20), (-20,-19), ... (-1,0) show no differences between the old and new code. Obtained from:bde Modified: head/lib/msun/src/e_lgamma_r.c head/lib/msun/src/e_lgammaf_r.c Modified: head/lib/msun/src/e_lgamma_r.c == --- head/lib/msun/src/e_lgamma_r.c Sun Aug 31 21:18:23 2014 (r270892) +++ head/lib/msun/src/e_lgamma_r.c Sun Aug 31 21:38:03 2014 (r270893) @@ -156,37 +156,35 @@ w6 = -1.63092934096575273989e-03; /* 0x static const double zero= 0.e+00; - static double sin_pi(double x) +/* + * Compute sin(pi*x) without actually doing the pi*x multiplication. + * sin_pi(x) is only called for x 0 and |x| 2**(p-1) where p is + * the precision of x. + */ +static double +sin_pi(double x) { + volatile double vz; double y,z; - int n,ix; + int n; - GET_HIGH_WORD(ix,x); - ix = 0x7fff; + y = -x; - if(ix0x3fd0) return __kernel_sin(pi*x,zero,0); - y = -x; /* x is assume negative */ + vz = y+0x1p52; /* depend on 0 = y 0x1p52 */ +z = vz-0x1p52; /* rint(y) for the above range */ + if (z == y) + return (zero); + + vz = y+0x1p50; + GET_LOW_WORD(n,vz); /* bits for rounded y (units 0.25) */ + z = vz-0x1p50; /* y rounded to a multiple of 0.25 */ + if (z y) { + z -= 0.25; /* adjust to round down */ + n--; + } + n = 7; /* octant of y mod 2 */ + y = y - z + n * 0.25; /* y mod 2 */ -/* - * argument reduction, make sure inexact flag not raised if input - * is an integer - */ - z = floor(y); - if(z!=y) { /* inexact anyway */ - y *= 0.5; - y = 2.0*(y - floor(y)); /* y = |x| mod 2.0 */ - n = (int) (y*4.0); - } else { -if(ix=0x4340) { -y = zero; n = 0; /* y must be even */ -} else { -if(ix0x4330) z = y+two52; /* exact */ - GET_LOW_WORD(n,z); - n = 1; -y = n; -n= 2; -} -} switch (n) { case 0: y = __kernel_sin(pi*y,zero,0); break; case 1: Modified: head/lib/msun/src/e_lgammaf_r.c == --- head/lib/msun/src/e_lgammaf_r.c Sun Aug 31 21:18:23 2014 (r270892) +++ head/lib/msun/src/e_lgammaf_r.c Sun Aug 31 21:38:03 2014 (r270893) @@ -89,37 +89,35 @@ w6 = -1.6309292987e-03; /* 0xbad5c4e8 * static const float zero= 0.00e+00; - static float sin_pif(float x) +/* + * Compute sin(pi*x) without actually doing the pi*x multiplication. + * sin_pi(x) is only called for x 0 and |x| 2**(p-1) where p is + * the precision of x. + */ +static float +sin_pi(float x) { + volatile float vz; float y,z; - int n,ix; + int n; - GET_FLOAT_WORD(ix,x); - ix = 0x7fff; + y = -x; - if(ix0x3e80) return __kernel_sindf(pi*x); - y = -x; /* x is assume negative */ + vz = y+0x1p23F; /* depend on 0 = y 0x1p23 */ + z = vz-0x1p23F; /* rintf(y) for the above range */ + if (z == y) + return (zero); + + vz = y+0x1p21F; + GET_FLOAT_WORD(n,vz); /* bits for rounded y (units 0.25) */ + z = vz-0x1p21F; /* y rounded to a multiple of 0.25 */ + if (z y) { + z -= 0.25F; /* adjust to round down */ + n--; + } + n = 7; /* octant of y mod 2 */ + y = y - z + n * 0.25F; /* y mod 2 */ -/* - * argument reduction, make sure inexact flag not raised if input - * is an integer - */ - z = floorf(y); - if(z!=y) { /* inexact anyway */ - y *= (float)0.5; - y = (float)2.0*(y - floorf(y)); /* y = |x| mod 2.0 */ - n = (int) (y*(float)4.0); - } else { -if(ix=0x4b80) { -y = zero; n = 0; /* y must be even */ -} else { -if(ix0x4b00) z = y+two23; /* exact */ - GET_FLOAT_WORD(n,z);