svn commit: r299110 - head/sys/dev/bwn
Author: adrian Date: Thu May 5 07:04:38 2016 New Revision: 299110 URL: https://svnweb.freebsd.org/changeset/base/299110 Log: [bwn] implement firmware tx/rx versioning and fix RSSI calculation. Different versions of firmware have different requirments for TX/RX packet layouts (and other things, of course.) Currently the driver checks between 3xx and 4xx firmware by using the BWN_ISOLDFMT() macro, which doesn't take into account the 5xx firmware (which I think I need for the HT and N series PHY chips. I'll know when I do the port.) BWN_HDRSIZE() also needs to learn about the 5xx series firmware as well. So: * add a firmware version enum * populate it based on the firmware version we read at load time * don't finish loading if the firmware is the 5xx firmware; any code using BWN_ISOLDFMT or BWN_HDRSIZE needs updating (most notably the TX and RX bits.) Then, for RX RSSI: * write down and reimplement the b43 rssi calculation method; * use it for the correct PHYs (which are all the ones we support); * do the RSSI calculation before radiotap, not after. Tested: * Broadcom BCM4312, STA mode Obtained from:Linux b43 (careful writing and reimplementing; lots of integer math..) Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwnvar.h Modified: head/sys/dev/bwn/if_bwn.c == --- head/sys/dev/bwn/if_bwn.c Thu May 5 06:58:30 2016(r299109) +++ head/sys/dev/bwn/if_bwn.c Thu May 5 07:04:38 2016(r299110) @@ -3987,6 +3987,33 @@ bwn_fw_loaducode(struct bwn_mac *mac) error = EOPNOTSUPP; goto error; } + + /* +* Determine firmware header version; needed for TX/RX packet +* handling. +*/ + if (mac->mac_fw.rev >= 598) + mac->mac_fw.fw_hdr_format = BWN_FW_HDR_598; + else if (mac->mac_fw.rev >= 410) + mac->mac_fw.fw_hdr_format = BWN_FW_HDR_410; + else + mac->mac_fw.fw_hdr_format = BWN_FW_HDR_351; + + /* +* We don't support rev 598 or later; that requires +* another round of changes to the TX/RX descriptor +* and status layout. +* +* So, complain this is the case and exit out, rather +* than attaching and then failing. +*/ + if (mac->mac_fw.fw_hdr_format == BWN_FW_HDR_598) { + device_printf(sc->sc_dev, + "firmware is too new (>=598); not supported\n"); + error = EOPNOTSUPP; + goto error; + } + mac->mac_fw.patch = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_UCODE_PATCH); date = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_UCODE_DATE); @@ -5401,6 +5428,63 @@ bwn_hwrate2ieeerate(int rate) } } +/* + * Post process the RX provided RSSI. + * + * Valid for A, B, G, LP PHYs. + */ +static int8_t +bwn_rx_rssi_calc(struct bwn_mac *mac, int8_t in_rssi, +int ofdm, int adjust_2053, int adjust_2050) +{ + struct bwn_phy *phy = &mac->mac_phy; + struct bwn_phy_g *gphy = &phy->phy_g; + int tmp; + + switch (phy->rf_ver) { + case 0x2050: + if (ofdm) { + tmp = in_rssi; + if (tmp > 127) + tmp -= 256; + tmp = tmp * 73 / 64; + if (adjust_2050) + tmp += 25; + else + tmp -= 3; + } else { + if (siba_sprom_get_bf_lo(mac->mac_sc->sc_dev) + & BWN_BFL_RSSI) { + if (in_rssi > 63) + in_rssi = 63; + tmp = gphy->pg_nrssi_lt[in_rssi]; + tmp = (31 - tmp) * -131 / 128 - 57; + } else { + tmp = in_rssi; + tmp = (31 - tmp) * -149 / 128 - 68; + } + if (phy->type == BWN_PHYTYPE_G && adjust_2050) + tmp += 25; + } + break; + case 0x2060: + if (in_rssi > 127) + tmp = in_rssi - 256; + else + tmp = in_rssi; + break; + default: + tmp = in_rssi; + tmp = (tmp - 11) * 103 / 64; + if (adjust_2053) + tmp -= 109; + else + tmp -= 83; + } + + return (tmp); +} + static void bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const void *_rxhdr) { @@ -5420,8 +5504,11 @@ bwn_rxeof(struct bwn_mac *mac, struct mb phystat0 = le16toh(rxhdr->phy_status0); phystat3 = le16toh(rxhdr->phy
Re: svn commit: r299108 - head/sys/sys
> On May 4, 2016, at 20:17, John Baldwin wrote: > > On Thursday, May 05, 2016 02:51:31 AM Garrett Cooper wrote: >> Author: ngie >> Date: Thu May 5 02:51:31 2016 >> New Revision: 299108 >> URL: https://svnweb.freebsd.org/changeset/base/299108 >> >> Log: >> Revert r299096 >> >> The change broke buildworld when building lib/libkvm >> >> This change likely needs to be run through a ports -exp run as a sanity >> check, as it might break downstream consumers. >> >> Pointyhat to: adrian >> Reported by: kargl (confirmed on $work workstation) >> Sponsored by: EMC / Isilon Storage Division > > 'struct foo *' can be use with a simple forward declare in headers without > requiring header pollution (and is often done for that reason). device_t > should be used in any .c files, but headers might need to stick with > 'struct device *' in a few cases for that reason. I suspect both of these > fall into that category. I agree based on the technical point (I didn’t dig into the why, but it makes sense), but this commit wasn’t even compile tested. I would rather figure out what the effects are before reintroducing the change. If this is being done to address compatibility issues with linuxkpi, I see two paths forward with this (there are probably more..): 1. Convert everything over to device_t (which bde@ disagrees with), after doing a full tinderbox run and exp- run 2. Localize the “shim”/typedef to linuxkpi so device_t is used there, or struct device* is used there. Thoughts? -Ngie ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299111 - stable/10/lib/libcam
Author: ngie Date: Thu May 5 08:11:36 2016 New Revision: 299111 URL: https://svnweb.freebsd.org/changeset/base/299111 Log: MFC r297999: Clean up trailing whitespace in lib/libcam; no functional change Modified: stable/10/lib/libcam/camlib.c stable/10/lib/libcam/camlib.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/camlib.c == --- stable/10/lib/libcam/camlib.c Thu May 5 07:04:38 2016 (r299110) +++ stable/10/lib/libcam/camlib.c Thu May 5 08:11:36 2016 (r299111) @@ -102,7 +102,7 @@ cam_freeccb(union ccb *ccb) * /dev/foo0 * foo0 * nfoo0 - * + * * Some peripheral drivers create separate device nodes with 'n' prefix for * non-rewind operations. Currently only sa(4) tape driver has this feature. * We extract pure peripheral name as device name for this special case. @@ -194,7 +194,7 @@ cam_get_device(const char *path, char *d /* * At this point, if the last character of the string isn't a -* number, we know the user either didn't give us a device number, +* number, we know the user either didn't give us a device number, * or he gave us a device name/number format we don't recognize. */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { @@ -275,7 +275,7 @@ cam_open_btl(path_id_t path_id, target_i int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -292,7 +292,7 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc match buffer", func_name); close(fd); return(NULL); @@ -305,14 +305,14 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.patterns = (struct dev_match_pattern *)malloc( sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); close(fd); return(NULL); } ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; - match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; + match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; /* * We're looking for the passthrough device associated with this @@ -421,7 +421,7 @@ cam_lookup_pass(const char *dev_name, in * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -435,7 +435,7 @@ cam_lookup_pass(const char *dev_name, in ccb.cgdl.unit_number = unit; /* -* Attempt to get the passthrough device. This ioctl will fail if +* Attempt to get the passthrough device. This ioctl will fail if * the device name is null, if the device doesn't exist, or if the * passthrough driver isn't in the kernel. */ @@ -512,7 +512,7 @@ cam_real_open_device(const char *path, i } device->fd = -1; malloced_device = 1; - } + } /* * If the user passed in a path, save it for him. @@ -551,7 +551,7 @@ cam_real_open_device(const char *path, i * we don't have to set any fields. */ ccb.ccb_h.func_code = XPT_GDEVLIST; - + /* * We're only doing this to get some information on the device in * question. Otherwise, we'd have to pass in yet another @@ -611,7 +611,7 @@ cam_real_open_device(const char *path, i goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); - bcopy(&ccb.cgd.inq_data, &device->inq_data, + bcopy(&ccb.cgd.inq_data, &device->inq_data, sizeof(struct scsi_inquiry_data)); device->serial_num_len = ccb.cgd.serial_num_len; bcopy(&ccb.cgd.serial_num, &device->serial_num, device->serial_num_len); @@ -719,7 +719,7 @@ cam_device_dup(struct cam_device *device newdev = malloc(sizeof(struct cam_device)); if (newdev == NU
svn commit: r299112 - stable/9/lib/libcam
Author: ngie Date: Thu May 5 08:17:55 2016 New Revision: 299112 URL: https://svnweb.freebsd.org/changeset/base/299112 Log: MFstable/10 r299111: MFC r297999: Clean up trailing whitespace in lib/libcam; no functional change Modified: stable/9/lib/libcam/camlib.c stable/9/lib/libcam/camlib.h Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libcam/ (props changed) Modified: stable/9/lib/libcam/camlib.c == --- stable/9/lib/libcam/camlib.cThu May 5 08:11:36 2016 (r299111) +++ stable/9/lib/libcam/camlib.cThu May 5 08:17:55 2016 (r299112) @@ -101,7 +101,7 @@ cam_freeccb(union ccb *ccb) * /dev/foo0 * foo0 * nfoo0 - * + * * Some peripheral drivers create separate device nodes with 'n' prefix for * non-rewind operations. Currently only sa(4) tape driver has this feature. * We extract pure peripheral name as device name for this special case. @@ -193,7 +193,7 @@ cam_get_device(const char *path, char *d /* * At this point, if the last character of the string isn't a -* number, we know the user either didn't give us a device number, +* number, we know the user either didn't give us a device number, * or he gave us a device name/number format we don't recognize. */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { @@ -274,7 +274,7 @@ cam_open_btl(path_id_t path_id, target_i int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -291,7 +291,7 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc match buffer", func_name); close(fd); return(NULL); @@ -304,14 +304,14 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.patterns = (struct dev_match_pattern *)malloc( sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't malloc pattern buffer", func_name); free(ccb.cdm.matches); close(fd); return(NULL); } ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; - match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; + match_pat = &ccb.cdm.patterns[0].pattern.periph_pattern; /* * We're looking for the passthrough device associated with this @@ -420,7 +420,7 @@ cam_lookup_pass(const char *dev_name, in * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, CAM_ERRBUF_SIZE, + snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, func_name, strerror(errno)); return(NULL); @@ -434,7 +434,7 @@ cam_lookup_pass(const char *dev_name, in ccb.cgdl.unit_number = unit; /* -* Attempt to get the passthrough device. This ioctl will fail if +* Attempt to get the passthrough device. This ioctl will fail if * the device name is null, if the device doesn't exist, or if the * passthrough driver isn't in the kernel. */ @@ -511,7 +511,7 @@ cam_real_open_device(const char *path, i } device->fd = -1; malloced_device = 1; - } + } /* * If the user passed in a path, save it for him. @@ -550,7 +550,7 @@ cam_real_open_device(const char *path, i * we don't have to set any fields. */ ccb.ccb_h.func_code = XPT_GDEVLIST; - + /* * We're only doing this to get some information on the device in * question. Otherwise, we'd have to pass in yet another @@ -610,7 +610,7 @@ cam_real_open_device(const char *path, i goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); - bcopy(&ccb.cgd.inq_data, &device->inq_data, + bcopy(&ccb.cgd.inq_data, &device->inq_data, sizeof(struct scsi_inquiry_data)); device->serial_num_len = ccb.cgd.serial_num_len; bcopy(&ccb.cgd.serial_num, &device->serial_num, device->serial_num_len); @@ -718,7 +718,7 @@ cam_device_dup(struct
Re: svn commit: r299108 - head/sys/sys
On 5/05/2016 4:08 PM, Ngie Cooper (yaneurabeya) wrote: On May 4, 2016, at 20:17, John Baldwin wrote: On Thursday, May 05, 2016 02:51:31 AM Garrett Cooper wrote: Author: ngie Date: Thu May 5 02:51:31 2016 New Revision: 299108 URL: https://svnweb.freebsd.org/changeset/base/299108 Log: Revert r299096 The change broke buildworld when building lib/libkvm This change likely needs to be run through a ports -exp run as a sanity check, as it might break downstream consumers. Pointyhat to: adrian Reported by: kargl (confirmed on $work workstation) Sponsored by: EMC / Isilon Storage Division 'struct foo *' can be use with a simple forward declare in headers without requiring header pollution (and is often done for that reason). device_t should be used in any .c files, but headers might need to stick with 'struct device *' in a few cases for that reason. I suspect both of these fall into that category. I agree based on the technical point (I didn’t dig into the why, but it makes sense), but this commit wasn’t even compile tested. I would rather figure out what the effects are before reintroducing the change. If this is being done to address compatibility issues with linuxkpi, I see two paths forward with this (there are probably more..): 1. Convert everything over to device_t (which bde@ disagrees with), after doing a full tinderbox run and exp- run 2. Localize the “shim”/typedef to linuxkpi so device_t is used there, or struct device* is used there. Thoughts? -Ngie it seems a bit silly to change out code because there is symbol/type of the same name in Linux. there must be some symbol munging possibility? ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86
On Wed, May 04, 2016 at 09:17:50PM -0700, John Baldwin wrote: > On Tuesday, May 03, 2016 11:19:44 AM John Baldwin wrote: > > On Wednesday, May 04, 2016 03:58:40 AM Bruce Evans wrote: > > > On Tue, 3 May 2016, John Baldwin wrote: > > > > I would be happy to fix _bitset.h and _cpuset.h to not need sys/param.h. > > > > However, they also use NBBY which is defined in sys/param.h. _sigset.h > > > > gets around this because it uses an array of uint32_t and hardcodes a > > > > shift count of 5 in _SIG_WORD() and a mask of 31 in _SIG_BIT(). If you > > > > think it is fine to hardcode '8' instead of 'NBBY' I'll do that. Hmm, > > > > sys/select.h hardcodes '8' for _NFDBITS, so I guess that is fine. > > > > > > NBBY can be cleaned up too. I rather like it, but it is bogus in C90 > > > since it is spelled CHAR_BIT there, and it is now more bogus in POSIX > > > since POSIX started specifying 8-bit bytes in 2001. Thus 8 is the > > > correct spelling of it in the implementation where you don't want to > > > expose a macro that makes it clearer what this magic 8 is. > > > > Ok. > > > > > BTW, I don't like select's and bitset's use of longs. Using unsigned > > > for select is a historical mistake. Bitset apparently copied select > > > except it unimproved to signed long. Bitstring uses unsigned char with > > > no optimizations. Sigset uses uint32_t with no obvious optimizations, > > > but compilers do a good job with with it due to its fixed size. I doubt > > > that the manual optimization of using a wider size is important. > > > > I agree, but cpuset_t is already part of the ABI in existing releases. :( > > Changing it to uint32_t would break the ABI for big-endian platforms. > > How about this: > > diff --git a/sys/arm/arm/genassym.c b/sys/arm/arm/genassym.c > index f9cb23e..9c67018 100644 > --- a/sys/arm/arm/genassym.c > +++ b/sys/arm/arm/genassym.c > @@ -28,6 +28,7 @@ > #include > __FBSDID("$FreeBSD$"); > #include > +#include > #include > #include > #include > diff --git a/sys/sys/_bitset.h b/sys/sys/_bitset.h > index 26a8848..89dd7b6 100644 > --- a/sys/sys/_bitset.h > +++ b/sys/sys/_bitset.h > @@ -36,26 +36,15 @@ > * Macros addressing word and bit within it, tuned to make compiler > * optimize cases when SETSIZE fits into single machine word. > */ > -#define _BITSET_BITS(sizeof(long) * NBBY) > +#define _BITSET_BITS(sizeof(long) * 8) > > -#define __bitset_words(_s) (howmany(_s, _BITSET_BITS)) > +#define _howmany(x, y) (((x) + ((y) - 1)) / (y)) The _howmany symbol is still in the user namespace. Implementation-reserved names are __.* and _[A-Z].* . ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299113 - in head/sys: arm/allwinner arm/allwinner/a83t arm/allwinner/clk arm/conf conf
Author: jmcneill Date: Thu May 5 09:41:57 2016 New Revision: 299113 URL: https://svnweb.freebsd.org/changeset/base/299113 Log: Add support for the Allwinner A83T (sun8iw6p1) SoC. Clocks, GPIO, UART, SD card / eMMC, USB, watchdog, and ethernet are supported. Note that the A83T contains two clusters of four Cortex-A7 CPUs, and only CPUs in first cluster are started for now. Tested on a Sinovoip Banana Pi BPI-M3. Added: head/sys/arm/allwinner/a83t/ head/sys/arm/allwinner/a83t/a83t_padconf.c (contents, props changed) head/sys/arm/allwinner/a83t/a83t_r_padconf.c (contents, props changed) head/sys/arm/allwinner/a83t/files.a83t (contents, props changed) head/sys/arm/allwinner/a83t/std.a83t (contents, props changed) head/sys/arm/allwinner/clk/aw_cpusclk.c (contents, props changed) Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/allwinner_machdep.h head/sys/arm/allwinner/aw_ccu.c head/sys/arm/allwinner/aw_mp.c head/sys/arm/allwinner/aw_mp.h head/sys/arm/allwinner/aw_usbphy.c head/sys/arm/allwinner/clk/aw_ahbclk.c head/sys/arm/allwinner/clk/aw_apbclk.c head/sys/arm/allwinner/clk/aw_gate.c head/sys/arm/allwinner/clk/aw_gmacclk.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/clk/aw_usbclk.c head/sys/arm/allwinner/files.allwinner head/sys/arm/allwinner/std.allwinner head/sys/arm/conf/ALLWINNER head/sys/conf/options.arm Modified: head/sys/arm/allwinner/a10_ehci.c == --- head/sys/arm/allwinner/a10_ehci.c Thu May 5 08:17:55 2016 (r299112) +++ head/sys/arm/allwinner/a10_ehci.c Thu May 5 09:41:57 2016 (r299113) @@ -112,6 +112,7 @@ static struct ofw_compat_data compat_dat { "allwinner,sun4i-a10-ehci", (uintptr_t)&a10_ehci_conf }, { "allwinner,sun6i-a31-ehci", (uintptr_t)&a31_ehci_conf }, { "allwinner,sun7i-a20-ehci", (uintptr_t)&a10_ehci_conf }, + { "allwinner,sun8i-a83t-ehci", (uintptr_t)&a31_ehci_conf }, { NULL, (uintptr_t)NULL } }; Modified: head/sys/arm/allwinner/a10_gpio.c == --- head/sys/arm/allwinner/a10_gpio.c Thu May 5 08:17:55 2016 (r299112) +++ head/sys/arm/allwinner/a10_gpio.c Thu May 5 09:41:57 2016 (r299113) @@ -99,6 +99,12 @@ extern const struct allwinner_padconf a3 extern const struct allwinner_padconf a31_r_padconf; #endif +/* Defined in a83t_padconf.c */ +#ifdef SOC_ALLWINNER_A83T +extern const struct allwinner_padconf a83t_padconf; +extern const struct allwinner_padconf a83t_r_padconf; +#endif + static struct ofw_compat_data compat_data[] = { #ifdef SOC_ALLWINNER_A10 {"allwinner,sun4i-a10-pinctrl", (uintptr_t)&a10_padconf}, @@ -115,6 +121,10 @@ static struct ofw_compat_data compat_dat #if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) {"allwinner,sun6i-a31-r-pinctrl", (uintptr_t)&a31_r_padconf}, #endif +#ifdef SOC_ALLWINNER_A83T + {"allwinner,sun8i-a83t-pinctrl",(uintptr_t)&a83t_padconf}, + {"allwinner,sun8i-a83t-r-pinctrl", (uintptr_t)&a83t_r_padconf}, +#endif {NULL, 0} }; Added: head/sys/arm/allwinner/a83t/a83t_padconf.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a83t/a83t_padconf.c Thu May 5 09:41:57 2016 (r299113) @@ -0,0 +1,162 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Re: svn commit: r299109 - head/sys/modules/bhnd/bhndb
On Thu, 5 May 2016 06:58:30 + (UTC) Adrian Chadd wrote: > Author: adrian > Date: Thu May 5 06:58:30 2016 > New Revision: 299109 > URL: https://svnweb.freebsd.org/changeset/base/299109 > > Log: > [bhnd] add missing bus file. > > Modified: > head/sys/modules/bhnd/bhndb/Makefile > > Modified: head/sys/modules/bhnd/bhndb/Makefile > == > --- head/sys/modules/bhnd/bhndb/Makefile Thu May 5 02:51:31 > 2016 (r299108) +++ head/sys/modules/bhnd/bhndb/Makefile > Thu May 5 06:58:30 2016 (r299109) @@ -8,6 +8,6 @@ > SRCS= bhndb.c bhndb_subr.c bhndb_hwdata. bhndb_if.c bhndb_if.h > \ bhnd_bus_if.h > > -SRCS+= device_if.h bus_if.h > +SRCS+= device_if.h bus_if.h pci_if.h > > .include > ___ Hello. Should also ? /sys/modules/bhnd/bhndb_pci/Makefile --- Makefile.orig 2016-05-05 12:47:52.477048000 +0300 +++ Makefile2016-05-05 12:44:36.370741000 +0300 @@ -6,6 +6,6 @@ SRCS= bhndb_pci.c bhndb_pci_hwdata.c SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h -SRCS+= device_if.h bus_if.h +SRCS+= device_if.h bus_if.h pci_if.h .include = ... --- if_bwi_pci.o --- /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin -O2 -pipe -mmmx -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul -march=native -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /media/da0s1/obj/usr/src/sys/mk11/opt_global.h -I. -I/usr/src/sys -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/media/da0s1/obj/usr/src/sys/mk11 -MD -MF.depend.if_bwi_pci.o -MTif_bwi_pci.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-erro r-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Ofast -fvectorize -fslp-vectorize -fblocks -fcolor-diagnostics -mno-aes -mno-avx -std=iso9899:1999 -c /usr/src/sys/modules/bwi/../../dev/bwi/if_bwi_pci.c -o if_bwi_pci.o --- all_subdir_ata --- objcopy --strip-debug atajmicron.ko --- all_subdir_bhnd --- --- all_subdir_bhnd/bhndb_pci --- In file included from /usr/src/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci_hwdata.c:46: /usr/src/sys/dev/pci/pcivar.h:271:10: fatal error: 'pci_if.h' file not found #include "pci_if.h" ^ --- all_subdir_ata --- --- all_subdir_ata/atapci/chipsets/atamarvell --- ===> ata/atapci/chipsets/atamarvell (all) --- all_subdir_bhnd --- 1 error generated. *** [bhndb_pci_hwdata.o] Error code 1 make[5]: stopped in /usr/src/sys/modules/bhnd/bhndb_pci 1 error make[5]: stopped in /usr/src/sys/modules/bhnd/bhndb_pci *** [all_subdir_bhnd/bhndb_pci] Error code 2 make[4]: stopped in /usr/src/sys/modules/bhnd --- all_subdir_ata --- A failure has been detected in another branch of the parallel make make[7]: stopped in /usr/src/sys/modules/ata/atapci/chipsets/atamarvell *** [all_subdir_ata/atapci/chipsets/atamarvell] Error code 2 make[6]: stopped in /usr/src/sys/modules/ata/atapci/chipsets 1 error make[6]: stopped in /usr/src/sys/modules/ata/atapci/chipsets *** [all_subdir_ata/atapci/chipsets] Error code 2 make[5]: stopped in /usr/src/sys/modules/ata/atapci 1 error make[5]: stopped in /usr/src/sys/modules/ata/atapci *** [all_subdir_ata/atapci] Error code 2 make[4]: stopped in /usr/src/sys/modules/ata 1 error make[4]: stopped in /usr/src/sys/modules/ata *** [all_subdir_ata] Error code 2 make[3]: stopped in /usr/src/sys/modules --- all_subdir_bhnd --- --- all_subdir_bhnd/bhndb --- A failure has been detected in another branch of the parallel make make[5]: stopped in /usr/src/sys/modules/bhnd/bhndb *** [all_subdir_bhnd/bhndb] Error code 2 make[4]: stopped in /usr/src/sys/modules/bhnd 2 errors make[4]: stopped in /usr/src/sys/modules/bhnd *** [all_subdir_bhnd] Error code 2 make[3]: stopped in /usr/src/sys/modules --- all_subdir_ath --- /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ar5210/ar5210_reset.c:503:12: warning: shifting a negative signed value is undefined [-Wshift-negative-value] ((-1 << FIRPWR_S) & FIRPWR_M)); ~~ ^ /usr/src/sys/modules/ath/../../dev/ath/ah_osdep.h:137:68: note: expanded from macro 'OS_REG_WRITE' #define OS_REG_WRITE(_ah, _reg, _val) ath_hal_reg_write(_ah, _reg, _val)
svn commit: r299114 - head/lib/libthr/thread
Author: kib Date: Thu May 5 10:20:22 2016 New Revision: 299114 URL: https://svnweb.freebsd.org/changeset/base/299114 Log: Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume cycle. The flag currently is cleared by the resumed thread. If next suspend request comes before the thread was able to clean the flag, in which case suspender skip the thread. Instead, clear the THR_FLAGS_SUSPEND flag in resume_common(), we do not care how much code was executed in the resumed thread when the pthread_resume_*np(s) functions returned. PR: 209233 Reported by: Lawrence Esswood MFC after:1 week Modified: head/lib/libthr/thread/thr_resume_np.c head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_resume_np.c == --- head/lib/libthr/thread/thr_resume_np.c Thu May 5 09:41:57 2016 (r299113) +++ head/lib/libthr/thread/thr_resume_np.c Thu May 5 10:20:22 2016 (r299114) @@ -91,7 +91,7 @@ static void resume_common(struct pthread *thread) { /* Clear the suspend flag: */ - thread->flags &= ~THR_FLAGS_NEED_SUSPEND; + thread->flags &= ~(THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED); thread->cycle++; _thr_umtx_wake(&thread->cycle, 1, 0); } Modified: head/lib/libthr/thread/thr_sig.c == --- head/lib/libthr/thread/thr_sig.cThu May 5 09:41:57 2016 (r299113) +++ head/lib/libthr/thread/thr_sig.cThu May 5 10:20:22 2016 (r299114) @@ -374,8 +374,7 @@ check_suspend(struct pthread *curthread) */ curthread->critical_count++; THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - while ((curthread->flags & (THR_FLAGS_NEED_SUSPEND | - THR_FLAGS_SUSPENDED)) == THR_FLAGS_NEED_SUSPEND) { + while ((curthread->flags & THR_FLAGS_NEED_SUSPEND) != 0) { curthread->cycle++; cycle = curthread->cycle; @@ -392,7 +391,6 @@ check_suspend(struct pthread *curthread) THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); _thr_umtx_wait_uint(&curthread->cycle, cycle, NULL, 0); THR_UMUTEX_LOCK(curthread, &(curthread)->lock); - curthread->flags &= ~THR_FLAGS_SUSPENDED; } THR_UMUTEX_UNLOCK(curthread, &(curthread)->lock); curthread->critical_count--; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299115 - head/share/man/man3
Author: kib Date: Thu May 5 10:22:19 2016 New Revision: 299115 URL: https://svnweb.freebsd.org/changeset/base/299115 Log: Warn about consequences of suspending threads in arbitrary state of execution. While there, fix minor nits in markup. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/share/man/man3/pthread_resume_np.3 head/share/man/man3/pthread_suspend_all_np.3 head/share/man/man3/pthread_suspend_np.3 Modified: head/share/man/man3/pthread_resume_np.3 == --- head/share/man/man3/pthread_resume_np.3 Thu May 5 10:20:22 2016 (r299114) +++ head/share/man/man3/pthread_resume_np.3 Thu May 5 10:22:19 2016 (r299115) @@ -57,7 +57,7 @@ function will fail if: The value specified by the .Fa tid argument is invalid. -.It Bq ESRC +.It Bq Er ESRC No thread could be found corresponding to the thread ID specified by the .Fa tid argument. Modified: head/share/man/man3/pthread_suspend_all_np.3 == --- head/share/man/man3/pthread_suspend_all_np.3Thu May 5 10:20:22 2016(r299114) +++ head/share/man/man3/pthread_suspend_all_np.3Thu May 5 10:22:19 2016(r299115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd May 5, 2016 .Dt PTHREAD_SUSPEND_ALL_NP 3 .Os .Sh NAME @@ -44,6 +44,13 @@ The only exception is the current thread the thread that called the .Fn pthread_suspend_all_np function. +.Pp +It is not safe for the caller of the +.Fn pthread_suspend_all_np +function to use any non-async signal safe functions, besides +.Xr pthread_resume_all_np 3 , +until threads are resumed, unless measures are taken to ensure +that all threads are suspended at safe points. .Sh SEE ALSO .Xr pthread_resume_all_np 3 , .Xr pthread_resume_np 3 , Modified: head/share/man/man3/pthread_suspend_np.3 == --- head/share/man/man3/pthread_suspend_np.3Thu May 5 10:20:22 2016 (r299114) +++ head/share/man/man3/pthread_suspend_np.3Thu May 5 10:22:19 2016 (r299115) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd May 5, 2016 .Dt PTHREAD_SUSPEND_NP 3 .Os .Sh NAME @@ -40,6 +40,13 @@ The .Fn pthread_suspend_np function, called on an active thread, causes it to suspend. +.Pp +It is not safe for the caller of the +.Fn pthread_suspend_np +function to use any non-async signal safe functions, except +.Xr pthread_resume_np 3 , +until suspended thread is resumed, unless measures are taken to ensure +that the thread is suspended at a safe point. .Sh RETURN VALUES If successful, .Fn pthread_suspend_np @@ -56,7 +63,7 @@ An attempt was made to suspend the curre The value specified by the .Fa tid argument is invalid. -.It Bq ESRC +.It Bq Er ESRC No thread could be found corresponding to the thread ID specified by the .Fa tid argument. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86
On Thu, 5 May 2016, Konstantin Belousov wrote: On Wed, May 04, 2016 at 09:17:50PM -0700, John Baldwin wrote: ... How about this: ... diff --git a/sys/sys/_bitset.h b/sys/sys/_bitset.h index 26a8848..89dd7b6 100644 --- a/sys/sys/_bitset.h +++ b/sys/sys/_bitset.h @@ -36,26 +36,15 @@ * Macros addressing word and bit within it, tuned to make compiler * optimize cases when SETSIZE fits into single machine word. */ -#define_BITSET_BITS(sizeof(long) * NBBY) +#define_BITSET_BITS(sizeof(long) * 8) -#define__bitset_words(_s) (howmany(_s, _BITSET_BITS)) +#define_howmany(x, y) (((x) + ((y) - 1)) / (y)) The _howmany symbol is still in the user namespace. Implementation-reserved names are __.* and _[A-Z].* . The names _.* also are reserved at file scope. sys/select.h also uses _howmany(), and that is correct there since it is only used in inner scopes that the application cannot conflict with (except possibly via -Wshadow warnings). I haven't checked this in the patch yet, but it is probably the same. In select.h, the inner scopes are one inside a struct declaration and one inside a compound statement in a statement-like macro. I like to use minimal underscores since 2 underscores are uglier. select.h does this perfectly or almost perfectly. An example of this is the __fd_mask typedef. This is used in non-inner scopes so it needs 2 underscores. The above fixes the bogus underscore on _s. 1 underscore is also ugly, and this one shows lack of understanding of namespaces. Underscores are never needed for macro parameters since they create their their own namespace. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r298933 - in head: share/man/man9 sys/amd64/include sys/dev/acpica sys/dev/drm2 sys/dev/drm2/i915 sys/kern sys/sys sys/x86/acpica sys/x86/x86
On Wed, 4 May 2016, John Baldwin wrote: On Tuesday, May 03, 2016 11:19:44 AM John Baldwin wrote: On Wednesday, May 04, 2016 03:58:40 AM Bruce Evans wrote: BTW, I don't like select's and bitset's use of longs. Using unsigned for select is a historical mistake. Bitset apparently copied select except it unimproved to signed long. Bitstring uses unsigned char with no optimizations. Sigset uses uint32_t with no obvious optimizations, but compilers do a good job with with it due to its fixed size. I doubt that the manual optimization of using a wider size is important. I agree, but cpuset_t is already part of the ABI in existing releases. :( Changing it to uint32_t would break the ABI for big-endian platforms. How about this: It seems reasonable. I didn't check many details. diff --git a/sys/sys/_bitset.h b/sys/sys/_bitset.h index 26a8848..89dd7b6 100644 --- a/sys/sys/_bitset.h +++ b/sys/sys/_bitset.h @@ -36,26 +36,15 @@ * Macros addressing word and bit within it, tuned to make compiler * optimize cases when SETSIZE fits into single machine word. */ -#define_BITSET_BITS(sizeof(long) * NBBY) +#define_BITSET_BITS(sizeof(long) * 8) -#define__bitset_words(_s) (howmany(_s, _BITSET_BITS)) +#define_howmany(x, y) (((x) + ((y) - 1)) / (y)) -#define__bitset_mask(_s, n) \ - (1L << ((__bitset_words((_s)) == 1) ? \ - (__size_t)(n) : ((n) % _BITSET_BITS))) - -#define__bitset_word(_s, n) \ - ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) +#define__bitset_words(_s) (_howmany(_s, _BITSET_BITS)) This still has a bogus underscore on _s. Unfortunately, the problem pointed out by kib does apply here, and in select.h too, not like I said before. Our select implemenation breaks user code like: #include // for its undocumented nested pollution void foo(void) { static void *_howmany(void); } Change it to use upper case instead of adding an underscore. Lower case should indicate a safe (function-like) macro. #define BITSET_DEFINE(t, _s)\ struct t { \ long__bits[__bitset_words((_s))]; \ } -#defineBITSET_T_INITIALIZER(x) \ - { .__bits = { x } } - -#defineBITSET_FSET(n) \ - [ 0 ... ((n) - 1) ] = (-1L) - I didn't expect you to clean the layering too, but this reminds me that I don't like the layering. Little _foo.h heads may be the cleanest way to reduce namespace pollution, but they are bad for readabilty and efficiency. New header should be designed to be clean from the start and not need multiple layers. For bitsets, we now have _bitset.h, bitset.h, _cpuset.h, cpuset.h and bitstring.h. Since yesterday we have had gibbs' improved bitstring.h. It is too over-engineered for me, but it s now just as optimal as bitset.h (perhaps more). gibbs used bitstrings instead of bitsets since he thought bitsets were too kernel-ish. We still have much larger messes using little headers cleaning time types. This was used mainly to clean sys/stat.h, but that cleaning is mostly broken now, and sys/time.h and time.h remain a mess of pollution. sys/stat.h now uses timespecs unconditionally, but they only exist in POSIX >= 2001. Old versions used __timespec (which was declared in the little headers) in the !_BSD_VISIBLE case. We still have the little headers -- _timespec.h, timespec.h and _timeval.h. _timespec existed solely to declare struct __timespec and timespec.h existed solely to declare struct timespec and some pollution. Now _timespec.h exists solely to declare struct timespec, and timespec.h grew more pollution. _timeval.h always declared solely to declare struct timeval and associated types. The little time headers do serve the purpose providing a single place to declare 1 struct with minor collateral pollution, but since the struct is so simple it is better to repeat its definition (ifdefed). diff --git a/sys/sys/bitset.h b/sys/sys/bitset.h index d130522..f1c7bf8 100644 --- a/sys/sys/bitset.h +++ b/sys/sys/bitset.h @@ -32,6 +32,13 @@ #ifndef _SYS_BITSET_H_ #define _SYS_BITSET_H_ +#define__bitset_mask(_s, n) \ + (1L << ((__bitset_words((_s)) == 1) ? \ + (__size_t)(n) : ((n) % _BITSET_BITS))) + The longs should be u_longs. Compilers would warn about shifting this 1L the sign bit. Maybe the expression is too complicated for them to see that. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To u
svn commit: r299116 - head/sys/kern
Author: skra Date: Thu May 5 13:23:38 2016 New Revision: 299116 URL: https://svnweb.freebsd.org/changeset/base/299116 Log: Remove superfluous check. The pic_dev member of struct pic is never NULL on PIC found by pic_lookup(). Modified: head/sys/kern/subr_intr.c Modified: head/sys/kern/subr_intr.c == --- head/sys/kern/subr_intr.c Thu May 5 10:22:19 2016(r299115) +++ head/sys/kern/subr_intr.c Thu May 5 13:23:38 2016(r299116) @@ -971,7 +971,7 @@ intr_map_irq(device_t dev, intptr_t xref return (EINVAL); pic = pic_lookup(dev, xref); - if (pic == NULL || pic->pic_dev == NULL) + if (pic == NULL) return (ESRCH); error = PIC_MAP_INTR(pic->pic_dev, data, &isrc); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299117 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/freescale/imx arm/mv arm/nvidia arm/ti kern mips/mediatek mips/mips sys
Author: skra Date: Thu May 5 13:31:19 2016 New Revision: 299117 URL: https://svnweb.freebsd.org/changeset/base/299117 Log: INTRNG - redefine struct intr_map_data to avoid headers pollution. Each struct associated with some type defined in enum intr_map_data_type must have struct intr_map_data on the top of its own definition now. When such structs are used, correct type and size must be filled in. There are three such structs defined in sys/intr.h now. Their definitions should be moved to corresponding headers by follow-up commits. While this change was propagated to all INTRNG like PICs, pic_map_intr() method implementations were corrected on some places. For this specific method, it's ensured by a caller that the 'data' argument passed to this method is never NULL. Also, the return error values were standardized there. Modified: head/sys/arm/allwinner/a10/a10_intc.c head/sys/arm/allwinner/aw_nmi.c head/sys/arm/arm/gic.c head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c head/sys/arm/broadcom/bcm2835/bcm2835_intr.c head/sys/arm/broadcom/bcm2835/bcm2836.c head/sys/arm/freescale/imx/imx_gpio.c head/sys/arm/mv/mpic.c head/sys/arm/nvidia/tegra_gpio.c head/sys/arm/ti/aintc.c head/sys/arm/ti/ti_gpio.c head/sys/kern/subr_intr.c head/sys/mips/mediatek/mtk_gpio_v1.c head/sys/mips/mediatek/mtk_gpio_v2.c head/sys/mips/mediatek/mtk_intr_gic.c head/sys/mips/mediatek/mtk_intr_v1.c head/sys/mips/mediatek/mtk_intr_v2.c head/sys/mips/mips/mips_pic.c head/sys/sys/intr.h Modified: head/sys/arm/allwinner/a10/a10_intc.c == --- head/sys/arm/allwinner/a10/a10_intc.c Thu May 5 13:23:38 2016 (r299116) +++ head/sys/arm/allwinner/a10/a10_intc.c Thu May 5 13:31:19 2016 (r299117) @@ -298,14 +298,18 @@ static int a10_intr_map_intr(device_t dev, struct intr_map_data *data, struct intr_irqsrc **isrcp) { + struct intr_map_data_fdt *daf; struct a10_aintc_softc *sc; - if (data->type != INTR_MAP_DATA_FDT || data->fdt.ncells != 1 || - data->fdt.cells[0] >= A10_INTR_MAX_NIRQS) + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 1 || daf->cells[0] >= A10_INTR_MAX_NIRQS) return (EINVAL); sc = device_get_softc(dev); - *isrcp = &sc->isrcs[data->fdt.cells[0]].isrc; + *isrcp = &sc->isrcs[daf->cells[0]].isrc; return (0); } Modified: head/sys/arm/allwinner/aw_nmi.c == --- head/sys/arm/allwinner/aw_nmi.c Thu May 5 13:23:38 2016 (r299116) +++ head/sys/arm/allwinner/aw_nmi.c Thu May 5 13:31:19 2016 (r299117) @@ -188,16 +188,18 @@ static int aw_nmi_map_intr(device_t dev, struct intr_map_data *data, struct intr_irqsrc **isrcp) { + struct intr_map_data_fdt *daf; struct aw_nmi_softc *sc; int error; u_int irq; - sc = device_get_softc(dev); if (data->type != INTR_MAP_DATA_FDT) return (ENOTSUP); - error = aw_nmi_map_fdt(dev, data->fdt.ncells, data->fdt.cells, &irq, - NULL, NULL); + sc = device_get_softc(dev); + daf = (struct intr_map_data_fdt *)data; + + error = aw_nmi_map_fdt(dev, daf->ncells, daf->cells, &irq, NULL, NULL); if (error == 0) *isrcp = &sc->intr.isrc; @@ -208,6 +210,7 @@ static int aw_nmi_setup_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { + struct intr_map_data_fdt *daf; struct aw_nmi_softc *sc; struct aw_nmi_intr *nmi_intr; int error, icfg; @@ -215,14 +218,15 @@ aw_nmi_setup_intr(device_t dev, struct i enum intr_trigger trig; enum intr_polarity pol; - sc = device_get_softc(dev); - nmi_intr = (struct aw_nmi_intr *)isrc; - /* Get config for interrupt. */ if (data == NULL || data->type != INTR_MAP_DATA_FDT) return (ENOTSUP); - error = aw_nmi_map_fdt(dev, data->fdt.ncells, data->fdt.cells, &irq, - &pol, &trig); + + sc = device_get_softc(dev); + nmi_intr = (struct aw_nmi_intr *)isrc; + daf = (struct intr_map_data_fdt *)data; + + error = aw_nmi_map_fdt(dev, daf->ncells, daf->cells, &irq, &pol, &trig); if (error != 0) return (error); if (nmi_intr->irq != irq) Modified: head/sys/arm/arm/gic.c == --- head/sys/arm/arm/gic.c Thu May 5 13:23:38 2016(r299116) +++ head/sys/arm/arm/gic.c Thu May 5 13:31:19 2016(r299117) @@ -1006,18 +1006,22 @@ gic_map_intr(device_t dev, struct intr_m enum intr_polarity pol; enum intr_trigger trig;
svn commit: r299118 - in head/sys: cddl/contrib/opensolaris/uts/common/sys cddl/dev/dtrace/mips cddl/dev/fbt/mips conf mips/mips
Author: br Date: Thu May 5 13:54:50 2016 New Revision: 299118 URL: https://svnweb.freebsd.org/changeset/base/299118 Log: Implement FBT provider (MD part) for DTrace on MIPS. Tested on MIPS64. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/cddl/dev/fbt/mips/ head/sys/cddl/dev/fbt/mips/fbt_isa.c (contents, props changed) head/sys/cddl/dev/fbt/mips/fbt_isa.h (contents, props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h head/sys/cddl/dev/dtrace/mips/dtrace_asm.S head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/conf/files.mips head/sys/mips/mips/exception.S head/sys/mips/mips/trap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h == --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Thu May 5 13:31:19 2016(r299117) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Thu May 5 13:54:50 2016(r299118) @@ -2483,6 +2483,18 @@ extern void dtrace_helpers_destroy(proc_ #defineDTRACE_INVOP_RET2 #defineDTRACE_INVOP_B 3 +#elif defined(__mips__) + +#defineINSN_SIZE 4 + +/* Load/Store double RA to/from SP */ +#defineLDSD_RA_SP_MASK 0x +#defineLDSD_DATA_MASK 0x +#defineSD_RA_SP0xffbf +#defineLD_RA_SP0xdfbf + +#defineDTRACE_INVOP_SD 1 +#defineDTRACE_INVOP_LD 2 #endif #ifdef __cplusplus Modified: head/sys/cddl/dev/dtrace/mips/dtrace_asm.S == --- head/sys/cddl/dev/dtrace/mips/dtrace_asm.S Thu May 5 13:31:19 2016 (r299117) +++ head/sys/cddl/dev/dtrace/mips/dtrace_asm.S Thu May 5 13:54:50 2016 (r299118) @@ -28,7 +28,6 @@ #define _ASM #define _LOCORE -#define LOCORE #include #include @@ -227,28 +226,6 @@ LEAF(dtrace_copystr) END(dtrace_copystr) /* -void dtrace_invop_init(void) -*/ -LEAF(dtrace_invop_init) - /* XXX: impement it properly */ - PTR_LA t0, dtrace_invop_jump_addr - /* dla t1, dtrace_invop_start */ - PTR_S zero, 0(t0) - j ra - nop -END(dtrace_invop_init) - -/* -void dtrace_invop_uninit(void) -*/ -LEAF(dtrace_invop_uninit) - PTR_LA t0, dtrace_invop_jump_addr - PTR_S zero, 0(t0) - j ra - nop -END(dtrace_invop_uninit) - -/* uintptr_t dtrace_caller(int aframes) */ Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c == --- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Thu May 5 13:31:19 2016 (r299117) +++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Thu May 5 13:54:50 2016 (r299118) @@ -45,13 +45,14 @@ __FBSDID("$FreeBSD$"); #include #defineDELAYBRANCH(x) ((int)(x) < 0) - + +extern int (*dtrace_invop_jump_addr)(struct trapframe *); extern dtrace_id_t dtrace_probeid_error; int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); typedef struct dtrace_invop_hdlr { - int (*dtih_func)(uintptr_t, uintptr_t *, uintptr_t); + int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); struct dtrace_invop_hdlr *dtih_next; } dtrace_invop_hdlr_t; @@ -70,6 +71,46 @@ dtrace_invop(uintptr_t addr, struct trap return (0); } +void +dtrace_invop_add(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) +{ + dtrace_invop_hdlr_t *hdlr; + + hdlr = kmem_alloc(sizeof (dtrace_invop_hdlr_t), KM_SLEEP); + hdlr->dtih_func = func; + hdlr->dtih_next = dtrace_invop_hdlr; + dtrace_invop_hdlr = hdlr; +} + +void +dtrace_invop_remove(int (*func)(uintptr_t, struct trapframe *, uintptr_t)) +{ + dtrace_invop_hdlr_t *hdlr, *prev; + + hdlr = dtrace_invop_hdlr; + prev = NULL; + + for (;;) { + if (hdlr == NULL) + panic("attempt to remove non-existent invop handler"); + + if (hdlr->dtih_func == func) + break; + + prev = hdlr; + hdlr = hdlr->dtih_next; + } + + if (prev == NULL) { + ASSERT(dtrace_invop_hdlr == hdlr); + dtrace_invop_hdlr = hdlr->dtih_next; + } else { + ASSERT(dtrace_invop_hdlr != hdlr); + prev->dtih_next = hdlr->dtih_next; + } + + kmem_free(hdlr, 0); +} /*ARGSUSED*/ void @@ -199,3 +240,45 @@ dtrace_probe_error(dtrace_state_t *state (uintptr_t)epid, (uintptr_t)which, (uintptr_t)fault, (uintptr_t)fltoffs); } + +static int +dtrace_invop_start(struct trapframe *frame) +{ + register_t *sp; + int16_t offs; + int invop; + + invop = dtrace_invop(frame->pc, frame, frame->pc); + offs = (invo
Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol
On 4 May 2016 at 18:34, Alan Somers wrote: > Author: asomers > Date: Wed May 4 22:34:11 2016 > New Revision: 299090 > URL: https://svnweb.freebsd.org/changeset/base/299090 > > Log: > Improve performance and functionality of the bitstring(3) api tinderbox is failing on (at least) powerpc now with: --- all_subdir_tests --- cc1: warnings being treated as errors /scratch/tmp/emaste/freebsd/sys/kern/subr_unit.c: In function 'main': /scratch/tmp/emaste/freebsd/sys/kern/subr_unit.c:1029: warning: format '%lu' expects type 'long unsigned int', but argument 2 has type 'unsigned int' *** [subr_unit.o] Error code 1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299119 - head/sys/dev/bhnd
Author: emaste Date: Thu May 5 15:07:40 2016 New Revision: 299119 URL: https://svnweb.freebsd.org/changeset/base/299119 Log: bhnd: fix build on gcc architectures "make tinderbox" fails on sparc64 GENERIC-NODEBUG with: bhnd_subr.c:188: warning: control reaches end of non-void function Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/bhnd_subr.c Modified: head/sys/dev/bhnd/bhnd_subr.c == --- head/sys/dev/bhnd/bhnd_subr.c Thu May 5 13:54:50 2016 (r299118) +++ head/sys/dev/bhnd/bhnd_subr.c Thu May 5 15:07:40 2016 (r299119) @@ -184,6 +184,8 @@ bhnd_port_type_name(bhnd_port_type port_ return ("bridge"); case BHND_PORT_AGENT: return ("agent"); + default: + return "unknown"; } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299097 - in head: share/man/man4 sys/conf sys/dev/bhnd/bhndb sys/dev/bwn sys/modules sys/modules/bwn_pci
On 4 May 2016 at 19:38, Adrian Chadd wrote: > Author: adrian > Date: Wed May 4 23:38:27 2016 > New Revision: 299097 > URL: https://svnweb.freebsd.org/changeset/base/299097 > > Log: > [bwn] [bhnd] initial support for using bhnd for if_bwn devices. Today sparc64 GENERIC-NODEBUG is failing with: /scratch/tmp/emaste/freebsd/sys/modules/bhnd/../../dev/bhnd/bhnd_subr.c: In function 'bhnd_port_type_name': /scratch/tmp/emaste/freebsd/sys/modules/bhnd/../../dev/bhnd/bhnd_subr.c:188: warning: control reaches end of non-void function *** [bhnd_subr.o] Error code 1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299120 - head/sys/kern
Author: emaste Date: Thu May 5 15:21:33 2016 New Revision: 299120 URL: https://svnweb.freebsd.org/changeset/base/299120 Log: Add explicit cast to fix mips and powerpc build after r299090 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/subr_unit.c Modified: head/sys/kern/subr_unit.c == --- head/sys/kern/subr_unit.c Thu May 5 15:07:40 2016(r299119) +++ head/sys/kern/subr_unit.c Thu May 5 15:21:33 2016(r299120) @@ -1026,7 +1026,7 @@ main(int argc, char **argv) printf("sizeof(struct unr) %zu\n", sizeof(struct unr)); printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb)); printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); - printf("NBITS %lu\n", NBITS); + printf("NBITS %lu\n", (unsigned long)NBITS); x = 1; for (m = 0; m < count * reps; m++) { j = random(); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299121 - in head/sys/dev: mpr mps
Author: asomers Date: Thu May 5 15:32:47 2016 New Revision: 299121 URL: https://svnweb.freebsd.org/changeset/base/299121 Log: mpr(4) and mps(4) shouldn't indefinitely retry for "terminated ioc" errors Submitted by: ken Reviewed by: slm MFC after:4 weeks Sponsored by: Spectra Logic Corp Differential Revision:https://reviews.freebsd.org/D6210 Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c == --- head/sys/dev/mpr/mpr_sas.c Thu May 5 15:21:33 2016(r299120) +++ head/sys/dev/mpr/mpr_sas.c Thu May 5 15:32:47 2016(r299121) @@ -2465,11 +2465,20 @@ mprsas_scsiio_complete(struct mpr_softc case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: /* -* Since these are generally external (i.e. hopefully -* transient transport-related) errors, retry these without -* decrementing the retry count. +* These can sometimes be transient transport-related +* errors, and sometimes persistent drive-related errors. +* We used to retry these without decrementing the retry +* count by returning CAM_REQUEUE_REQ. Unfortunately, if +* we hit a persistent drive problem that returns one of +* these error codes, we would retry indefinitely. So, +* return CAM_REQ_CMP_ERROR so that we decrement the retry +* count and avoid infinite retries. We're taking the +* potential risk of flagging false failures in the event +* of a topology-related error (e.g. a SAS expander problem +* causes a command addressed to a drive to fail), but +* avoiding getting into an infinite retry loop. */ - mprsas_set_ccbstatus(ccb, CAM_REQUEUE_REQ); + mprsas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mprsas_log_command(cm, MPR_INFO, "terminated ioc %x scsi %x state %x xfer %u\n", le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState, Modified: head/sys/dev/mps/mps_sas.c == --- head/sys/dev/mps/mps_sas.c Thu May 5 15:21:33 2016(r299120) +++ head/sys/dev/mps/mps_sas.c Thu May 5 15:32:47 2016(r299121) @@ -2408,11 +2408,20 @@ mpssas_scsiio_complete(struct mps_softc case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: /* -* Since these are generally external (i.e. hopefully -* transient transport-related) errors, retry these without -* decrementing the retry count. +* These can sometimes be transient transport-related +* errors, and sometimes persistent drive-related errors. +* We used to retry these without decrementing the retry +* count by returning CAM_REQUEUE_REQ. Unfortunately, if +* we hit a persistent drive problem that returns one of +* these error codes, we would retry indefinitely. So, +* return CAM_REQ_CMP_ERROR so that we decrement the retry +* count and avoid infinite retries. We're taking the +* potential risk of flagging false failures in the event +* of a topology-related error (e.g. a SAS expander problem +* causes a command addressed to a drive to fail), but +* avoiding getting into an infinite retry loop. */ - mpssas_set_ccbstatus(ccb, CAM_REQUEUE_REQ); + mpssas_set_ccbstatus(ccb, CAM_REQ_CMP_ERR); mpssas_log_command(cm, MPS_INFO, "terminated ioc %x scsi %x state %x xfer %u\n", le16toh(rep->IOCStatus), rep->SCSIStatus, rep->SCSIState, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299122 - in head/sys: arm/arm sys
Author: jhb Date: Thu May 5 15:43:26 2016 New Revision: 299122 URL: https://svnweb.freebsd.org/changeset/base/299122 Log: Fix and to not require . - Hardcode '8' instead of NBBY in _BITSET_BITS. - Define a private version of 'howmany' for use in __bitset_words(). - While here, move a few more things out of _bitset.h and _cpuset.h to bitset.h and cpuset.h, respectively. The only things left in _bitset.h and _cpuset.h are the bits needed to define a bitset structure. Reviewed by: bde, kib (ish) Modified: head/sys/arm/arm/genassym.c head/sys/sys/_bitset.h head/sys/sys/_cpuset.h head/sys/sys/bitset.h head/sys/sys/cpuset.h Modified: head/sys/arm/arm/genassym.c == --- head/sys/arm/arm/genassym.c Thu May 5 15:32:47 2016(r299121) +++ head/sys/arm/arm/genassym.c Thu May 5 15:43:26 2016(r299122) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); #include +#include #include #include #include Modified: head/sys/sys/_bitset.h == --- head/sys/sys/_bitset.h Thu May 5 15:32:47 2016(r299121) +++ head/sys/sys/_bitset.h Thu May 5 15:43:26 2016(r299122) @@ -36,26 +36,15 @@ * Macros addressing word and bit within it, tuned to make compiler * optimize cases when SETSIZE fits into single machine word. */ -#define_BITSET_BITS(sizeof(long) * NBBY) +#define_BITSET_BITS(sizeof(long) * 8) -#define__bitset_words(_s) (howmany(_s, _BITSET_BITS)) +#define__howmany(x, y) (((x) + ((y) - 1)) / (y)) -#define__bitset_mask(_s, n) \ - (1L << ((__bitset_words((_s)) == 1) ? \ - (__size_t)(n) : ((n) % _BITSET_BITS))) - -#define__bitset_word(_s, n) \ - ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) +#define__bitset_words(_s) (__howmany(_s, _BITSET_BITS)) #defineBITSET_DEFINE(t, _s) \ struct t { \ long__bits[__bitset_words((_s))]; \ } -#defineBITSET_T_INITIALIZER(x) \ - { .__bits = { x } } - -#defineBITSET_FSET(n) \ - [ 0 ... ((n) - 1) ] = (-1L) - #endif /* !_SYS__BITSET_H_ */ Modified: head/sys/sys/_cpuset.h == --- head/sys/sys/_cpuset.h Thu May 5 15:32:47 2016(r299121) +++ head/sys/sys/_cpuset.h Thu May 5 15:43:26 2016(r299122) @@ -44,13 +44,7 @@ #defineCPU_SETSIZE CPU_MAXSIZE #endif -#define_NCPUBITS _BITSET_BITS -#define_NCPUWORDS __bitset_words(CPU_SETSIZE) - BITSET_DEFINE(_cpuset, CPU_SETSIZE); typedef struct _cpuset cpuset_t; -#defineCPUSET_FSET BITSET_FSET(_NCPUWORDS) -#defineCPUSET_T_INITIALIZERBITSET_T_INITIALIZER - #endif /* !_SYS__CPUSET_H_ */ Modified: head/sys/sys/bitset.h == --- head/sys/sys/bitset.h Thu May 5 15:32:47 2016(r299121) +++ head/sys/sys/bitset.h Thu May 5 15:43:26 2016(r299122) @@ -32,6 +32,13 @@ #ifndef _SYS_BITSET_H_ #define_SYS_BITSET_H_ +#define__bitset_mask(_s, n) \ + (1L << ((__bitset_words((_s)) == 1) ? \ + (__size_t)(n) : ((n) % _BITSET_BITS))) + +#define__bitset_word(_s, n) \ + ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) + #defineBIT_CLR(_s, n, p) \ ((p)->__bits[__bitset_word(_s, n)] &= ~__bitset_mask((_s), (n))) @@ -185,5 +192,11 @@ __count += __bitcountl((p)->__bits[__i]); \ __count;\ }) - + +#defineBITSET_T_INITIALIZER(x) \ + { .__bits = { x } } + +#defineBITSET_FSET(n) \ + [ 0 ... ((n) - 1) ] = (-1L) + #endif /* !_SYS_BITSET_H_ */ Modified: head/sys/sys/cpuset.h == --- head/sys/sys/cpuset.h Thu May 5 15:32:47 2016(r299121) +++ head/sys/sys/cpuset.h Thu May 5 15:43:26 2016(r299122) @@ -35,6 +35,10 @@ #include #include +#include + +#define_NCPUBITS _BITSET_BITS +#define_N
Re: svn commit: r299119 - head/sys/dev/bhnd
Thanks! Sorry! -a On 5 May 2016 at 08:07, Ed Maste wrote: > Author: emaste > Date: Thu May 5 15:07:40 2016 > New Revision: 299119 > URL: https://svnweb.freebsd.org/changeset/base/299119 > > Log: > bhnd: fix build on gcc architectures > > "make tinderbox" fails on sparc64 GENERIC-NODEBUG with: > bhnd_subr.c:188: warning: control reaches end of non-void function > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/dev/bhnd/bhnd_subr.c > > Modified: head/sys/dev/bhnd/bhnd_subr.c > == > --- head/sys/dev/bhnd/bhnd_subr.c Thu May 5 13:54:50 2016 > (r299118) > +++ head/sys/dev/bhnd/bhnd_subr.c Thu May 5 15:07:40 2016 > (r299119) > @@ -184,6 +184,8 @@ bhnd_port_type_name(bhnd_port_type port_ > return ("bridge"); > case BHND_PORT_AGENT: > return ("agent"); > + default: > + return "unknown"; > } > } > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299109 - head/sys/modules/bhnd/bhndb
I'll check. I've done full kernel builds with this though, I wonder why it's not showing up here. -adrian On 5 May 2016 at 02:58, Ivan Klymenko wrote: > On Thu, 5 May 2016 06:58:30 + (UTC) > Adrian Chadd wrote: > >> Author: adrian >> Date: Thu May 5 06:58:30 2016 >> New Revision: 299109 >> URL: https://svnweb.freebsd.org/changeset/base/299109 >> >> Log: >> [bhnd] add missing bus file. >> >> Modified: >> head/sys/modules/bhnd/bhndb/Makefile >> >> Modified: head/sys/modules/bhnd/bhndb/Makefile >> == >> --- head/sys/modules/bhnd/bhndb/Makefile Thu May 5 02:51:31 >> 2016 (r299108) +++ head/sys/modules/bhnd/bhndb/Makefile >> Thu May 5 06:58:30 2016 (r299109) @@ -8,6 +8,6 @@ >> SRCS= bhndb.c bhndb_subr.c bhndb_hwdata. bhndb_if.c bhndb_if.h >> \ bhnd_bus_if.h >> >> -SRCS+= device_if.h bus_if.h >> +SRCS+= device_if.h bus_if.h pci_if.h >> >> .include >> ___ > > Hello. > > Should also ? /sys/modules/bhnd/bhndb_pci/Makefile > > --- Makefile.orig 2016-05-05 12:47:52.477048000 +0300 > +++ Makefile2016-05-05 12:44:36.370741000 +0300 > @@ -6,6 +6,6 @@ > SRCS= bhndb_pci.c bhndb_pci_hwdata.c > SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h > > -SRCS+= device_if.h bus_if.h > +SRCS+= device_if.h bus_if.h pci_if.h > > .include > > = > ... > --- if_bwi_pci.o --- > /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 > --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin > -O2 -pipe -mmmx -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx > -maes -mpclmul -march=native -fno-strict-aliasing -Werror -D_KERNEL > -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include > /media/da0s1/obj/usr/src/sys/mk11/opt_global.h -I. -I/usr/src/sys -fno-common > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > -I/media/da0s1/obj/usr/src/sys/mk11 -MD -MF.depend.if_bwi_pci.o > -MTif_bwi_pci.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector > -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs > -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-er ro > r-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value -Ofast -fvectorize > -fslp-vectorize -fblocks -fcolor-diagnostics -mno-aes -mno-avx > -std=iso9899:1999 -c /usr/src/sys/modules/bwi/../../dev/bwi/if_bwi_pci.c -o > if_bwi_pci.o > --- all_subdir_ata --- > objcopy --strip-debug atajmicron.ko > --- all_subdir_bhnd --- > --- all_subdir_bhnd/bhndb_pci --- > In file included from > /usr/src/sys/modules/bhnd/bhndb_pci/../../../dev/bhnd/bhndb/bhndb_pci_hwdata.c:46: > /usr/src/sys/dev/pci/pcivar.h:271:10: fatal error: 'pci_if.h' file not found > #include "pci_if.h" > ^ > --- all_subdir_ata --- > --- all_subdir_ata/atapci/chipsets/atamarvell --- > ===> ata/atapci/chipsets/atamarvell (all) > --- all_subdir_bhnd --- > 1 error generated. > *** [bhndb_pci_hwdata.o] Error code 1 > > make[5]: stopped in /usr/src/sys/modules/bhnd/bhndb_pci > 1 error > > make[5]: stopped in /usr/src/sys/modules/bhnd/bhndb_pci > *** [all_subdir_bhnd/bhndb_pci] Error code 2 > > make[4]: stopped in /usr/src/sys/modules/bhnd > --- all_subdir_ata --- > A failure has been detected in another branch of the parallel make > > make[7]: stopped in /usr/src/sys/modules/ata/atapci/chipsets/atamarvell > *** [all_subdir_ata/atapci/chipsets/atamarvell] Error code 2 > > make[6]: stopped in /usr/src/sys/modules/ata/atapci/chipsets > 1 error > > make[6]: stopped in /usr/src/sys/modules/ata/atapci/chipsets > *** [all_subdir_ata/atapci/chipsets] Error code 2 > > make[5]: stopped in /usr/src/sys/modules/ata/atapci > 1 error > > make[5]: stopped in /usr/src/sys/modules/ata/atapci > *** [all_subdir_ata/atapci] Error code 2 > > make[4]: stopped in /usr/src/sys/modules/ata > 1 error > > make[4]: stopped in /usr/src/sys/modules/ata > *** [all_subdir_ata] Error code 2 > > make[3]: stopped in /usr/src/sys/modules > --- all_subdir_bhnd --- > --- all_subdir_bhnd/bhndb --- > A failure has been detected in another branch of the parallel make > > make[5]: stopped in /usr/src/sys/modules/bhnd/bhndb > *** [all_subdir_bhnd/bhndb] Error code 2 > > make[4]: stopped in /usr/src/sys/modules/bhnd > 2 errors > > make[4]: stopped in /usr/src/sys/modules/bhnd > *** [all_subdir_bhnd] Error code 2 > > make[3]: stopped in /usr/src/sys/modules > --- all_subdir_ath --- > /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ar5210/ar5210_reset.c:503:12: > warning: shifting a negative signed value is undefined > [-Wshift-
Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol
On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote: > Author: asomers > Date: Wed May 4 22:34:11 2016 > New Revision: 299090 > URL: https://svnweb.freebsd.org/changeset/base/299090 > > Log: > Improve performance and functionality of the bitstring(3) api > > Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow > for efficient searching of set or cleared bits starting from any bit offset > within the bit string. > > Performance is improved by operating on longs instead of bytes and using > ffsl() for searches within a long. ffsl() is a compiler builtin in both > clang and gcc for most architectures, converting what was a brute force > while loop search into a couple of instructions. > > All of the bitstring(3) API continues to be contained in the header file. > Some of the functions are large enough that perhaps they should be uninlined > and moved to a library, but that is beyond the scope of this commit. Doesn't switching from bytes to longs break the ABI? That is, setting bit 9 now has a different representation on big-endian systems (0x00 0x01 before, now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes on 64-bit). This means you can't have an object file compiled against the old header pass a bitstring to an object file compiled against the new header on big-endian systems. Even on little-endian systems if an old object file allocates storage for a bitstring the new code might read off the end of it and fault (or return garbage if bits are set in the extra bytes it reads off the end)? Is the API is so little used we don't care? -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol
On Thu, May 5, 2016 at 10:31 AM, John Baldwin wrote: > On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote: > > Author: asomers > > Date: Wed May 4 22:34:11 2016 > > New Revision: 299090 > > URL: https://svnweb.freebsd.org/changeset/base/299090 > > > > Log: > > Improve performance and functionality of the bitstring(3) api > > > > Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which > allow > > for efficient searching of set or cleared bits starting from any bit > offset > > within the bit string. > > > > Performance is improved by operating on longs instead of bytes and > using > > ffsl() for searches within a long. ffsl() is a compiler builtin in both > > clang and gcc for most architectures, converting what was a brute force > > while loop search into a couple of instructions. > > > > All of the bitstring(3) API continues to be contained in the header > file. > > Some of the functions are large enough that perhaps they should be > uninlined > > and moved to a library, but that is beyond the scope of this commit. > > Doesn't switching from bytes to longs break the ABI? That is, setting bit > 9 > now has a different representation on big-endian systems (0x00 0x01 before, > now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes on > 64-bit). > This means you can't have an object file compiled against the old header > pass a bitstring to an object file compiled against the new header on > big-endian > systems. > > Even on little-endian systems if an old object file allocates storage for a > bitstring the new code might read off the end of it and fault (or return > garbage if bits are set in the extra bytes it reads off the end)? > > Is the API is so little used we don't care? > > -- > John Baldwin > The API isn't used in any shared libraries, so the only risk would be if it's used in a user application where the user's build system doesn't check for changes in system libraries, and the user upgrades FreeBSD without doing a clean build of his application, right? Am I missing any other scenarios? Do we need to warn users with a line in UPDATING or something? This is similar to an upgrade of the C++ compiler. C++ objects built by different minor versions of the compiler aren't guaranteed to be compatible. -Alan ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299109 - head/sys/modules/bhnd/bhndb
On 2016-05-05 17:51, Adrian Chadd wrote: > I'll check. I've done full kernel builds with this though, I wonder > why it's not showing up here. > Hi! I'm bitten by the same issue and just developed the same fix independently of Ivan Klymenko. However, at least for me, the issue only shows when doing a parallel build of the kernel, in my case make -j8. Regards! -- Niclas ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299123 - head/sys/dev/bhnd/bcma
Author: emaste Date: Thu May 5 17:47:03 2016 New Revision: 299123 URL: https://svnweb.freebsd.org/changeset/base/299123 Log: bhnd: another build fix for GCC-using architectures Further to r299119. GCC architectures failed with bcma_subr.c:138: warning: control reaches end of non-void function Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/bhnd/bcma/bcma_subr.c Modified: head/sys/dev/bhnd/bcma/bcma_subr.c == --- head/sys/dev/bhnd/bcma/bcma_subr.c Thu May 5 15:43:26 2016 (r299122) +++ head/sys/dev/bhnd/bcma/bcma_subr.c Thu May 5 17:47:03 2016 (r299123) @@ -134,6 +134,8 @@ bcma_corecfg_get_port_list(struct bcma_c case BHND_PORT_AGENT: return (&cfg->wrapper_ports); break; + default: + return (NULL); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299124 - head/sys/arm64/arm64
Author: zbb Date: Thu May 5 17:51:14 2016 New Revision: 299124 URL: https://svnweb.freebsd.org/changeset/base/299124 Log: Fix GICv3 build after r299090 Obtained from:Semihalf Sponsored by: Cavium Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h Modified: head/sys/arm64/arm64/gic_v3.c == --- head/sys/arm64/arm64/gic_v3.c Thu May 5 17:47:03 2016 (r299123) +++ head/sys/arm64/arm64/gic_v3.c Thu May 5 17:51:14 2016 (r299124) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/arm64/arm64/gic_v3_fdt.c == --- head/sys/arm64/arm64/gic_v3_fdt.c Thu May 5 17:47:03 2016 (r299123) +++ head/sys/arm64/arm64/gic_v3_fdt.c Thu May 5 17:51:14 2016 (r299124) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: head/sys/arm64/arm64/gic_v3_its.c == --- head/sys/arm64/arm64/gic_v3_its.c Thu May 5 17:47:03 2016 (r299123) +++ head/sys/arm64/arm64/gic_v3_its.c Thu May 5 17:51:14 2016 (r299124) @@ -852,7 +852,7 @@ lpi_alloc_chunk(struct gic_v3_its_softc { u_int *col_ids; int fclr; /* First cleared bit */ - uint8_t *bitmap; + bitstr_t *bitmap; size_t nb, i; col_ids = malloc(sizeof(*col_ids) * nvecs, M_GIC_V3_ITS, @@ -861,7 +861,7 @@ lpi_alloc_chunk(struct gic_v3_its_softc return (ENOMEM); mtx_lock_spin(&sc->its_dev_lock); - bitmap = (uint8_t *)sc->its_lpi_bitmap; + bitmap = sc->its_lpi_bitmap; fclr = 0; retry: @@ -901,9 +901,6 @@ static void lpi_free_chunk(struct gic_v3_its_softc *sc, struct lpi_chunk *lpic) { int start, end; - uint8_t *bitmap; - - bitmap = (uint8_t *)sc->its_lpi_bitmap; KASSERT((lpic->lpi_free == lpic->lpi_num), ("Trying to free LPI chunk that is still in use.\n")); @@ -915,7 +912,7 @@ lpi_free_chunk(struct gic_v3_its_softc * end = start + lpic->lpi_num - 1; /* Finally free this chunk */ - bit_nclear(bitmap, start, end); + bit_nclear(sc->its_lpi_bitmap, start, end); mtx_unlock_spin(&sc->its_dev_lock); free(lpic->lpi_col_ids, M_GIC_V3_ITS); Modified: head/sys/arm64/arm64/gic_v3_var.h == --- head/sys/arm64/arm64/gic_v3_var.h Thu May 5 17:47:03 2016 (r299123) +++ head/sys/arm64/arm64/gic_v3_var.h Thu May 5 17:51:14 2016 (r299124) @@ -236,7 +236,7 @@ struct gic_v3_its_softc { struct its_dev_list its_dev_list; - unsigned long * its_lpi_bitmap; + bitstr_t * its_lpi_bitmap; uint32_tits_lpi_maxid; struct mtx its_dev_lock; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol
Hi, It broke build for ARM64 but fixed here: https://svnweb.freebsd.org/changeset/base/299124 Best regards zbb 2016-05-05 18:45 GMT+02:00 Alan Somers : > On Thu, May 5, 2016 at 10:31 AM, John Baldwin wrote: > > > On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote: > > > Author: asomers > > > Date: Wed May 4 22:34:11 2016 > > > New Revision: 299090 > > > URL: https://svnweb.freebsd.org/changeset/base/299090 > > > > > > Log: > > > Improve performance and functionality of the bitstring(3) api > > > > > > Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which > > allow > > > for efficient searching of set or cleared bits starting from any bit > > offset > > > within the bit string. > > > > > > Performance is improved by operating on longs instead of bytes and > > using > > > ffsl() for searches within a long. ffsl() is a compiler builtin in > both > > > clang and gcc for most architectures, converting what was a brute > force > > > while loop search into a couple of instructions. > > > > > > All of the bitstring(3) API continues to be contained in the header > > file. > > > Some of the functions are large enough that perhaps they should be > > uninlined > > > and moved to a library, but that is beyond the scope of this commit. > > > > Doesn't switching from bytes to longs break the ABI? That is, setting > bit > > 9 > > now has a different representation on big-endian systems (0x00 0x01 > before, > > now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes on > > 64-bit). > > This means you can't have an object file compiled against the old header > > pass a bitstring to an object file compiled against the new header on > > big-endian > > systems. > > > > Even on little-endian systems if an old object file allocates storage > for a > > bitstring the new code might read off the end of it and fault (or return > > garbage if bits are set in the extra bytes it reads off the end)? > > > > Is the API is so little used we don't care? > > > > -- > > John Baldwin > > > > The API isn't used in any shared libraries, so the only risk would be if > it's used in a user application where the user's build system doesn't check > for changes in system libraries, and the user upgrades FreeBSD without > doing a clean build of his application, right? Am I missing any other > scenarios? Do we need to warn users with a line in UPDATING or something? > > This is similar to an upgrade of the C++ compiler. C++ objects built by > different minor versions of the compiler aren't guaranteed to be > compatible. > > -Alan > ___ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org" > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299125 - head/sys/modules/bhnd/bhndb_pci
Author: zeising (doc,ports committer) Date: Thu May 5 17:55:10 2016 New Revision: 299125 URL: https://svnweb.freebsd.org/changeset/base/299125 Log: Fix kernel build with parallel make. Approved by: jhb Modified: head/sys/modules/bhnd/bhndb_pci/Makefile Modified: head/sys/modules/bhnd/bhndb_pci/Makefile == --- head/sys/modules/bhnd/bhndb_pci/MakefileThu May 5 17:51:14 2016 (r299124) +++ head/sys/modules/bhnd/bhndb_pci/MakefileThu May 5 17:55:10 2016 (r299125) @@ -6,6 +6,6 @@ KMOD= bhndb_pci SRCS= bhndb_pci.c bhndb_pci_hwdata.c SRCS+= bhnd_bus_if.h bhndb_bus_if.h bhndb_if.h -SRCS+= device_if.h bus_if.h +SRCS+= device_if.h bus_if.h pci_if.h .include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299090 - in head: etc/mtree include lib/libbluetooth sbin/hastd share/man/man3 sys/dev/xen/blkback sys/kern sys/net sys/sys tests/sys tests/sys/sys usr.sbin/bluetooth/hccontrol
On Thursday, May 05, 2016 10:45:21 AM Alan Somers wrote: > On Thu, May 5, 2016 at 10:31 AM, John Baldwin wrote: > > > On Wednesday, May 04, 2016 10:34:11 PM Alan Somers wrote: > > > Author: asomers > > > Date: Wed May 4 22:34:11 2016 > > > New Revision: 299090 > > > URL: https://svnweb.freebsd.org/changeset/base/299090 > > > > > > Log: > > > Improve performance and functionality of the bitstring(3) api > > > > > > Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which > > allow > > > for efficient searching of set or cleared bits starting from any bit > > offset > > > within the bit string. > > > > > > Performance is improved by operating on longs instead of bytes and > > using > > > ffsl() for searches within a long. ffsl() is a compiler builtin in both > > > clang and gcc for most architectures, converting what was a brute force > > > while loop search into a couple of instructions. > > > > > > All of the bitstring(3) API continues to be contained in the header > > file. > > > Some of the functions are large enough that perhaps they should be > > uninlined > > > and moved to a library, but that is beyond the scope of this commit. > > > > Doesn't switching from bytes to longs break the ABI? That is, setting bit > > 9 > > now has a different representation on big-endian systems (0x00 0x01 before, > > now 0x00 0x00 0x01 0x00 on 32-bit BE, and 4 more leading 0 bytes on > > 64-bit). > > This means you can't have an object file compiled against the old header > > pass a bitstring to an object file compiled against the new header on > > big-endian > > systems. > > > > Even on little-endian systems if an old object file allocates storage for a > > bitstring the new code might read off the end of it and fault (or return > > garbage if bits are set in the extra bytes it reads off the end)? > > > > Is the API is so little used we don't care? > > > > -- > > John Baldwin > > > > The API isn't used in any shared libraries, so the only risk would be if > it's used in a user application where the user's build system doesn't check > for changes in system libraries, and the user upgrades FreeBSD without > doing a clean build of his application, right? Am I missing any other > scenarios? Do we need to warn users with a line in UPDATING or something? It would matter more if it was used in any 3rd party applications (e.g. in /usr/ports), though it needs to cross an API boundary to matter. I can believe that bitstring(3) is obscure enough that nothing uses it, but the ABI needs to be considered. We can't ever change cpuset_t from longs to uint32_t's for example (which is what sigset_t uses) because it is used in various system calls (e.g. consider using cpuset(8) in an old jail). > This is similar to an upgrade of the C++ compiler. C++ objects built by > different minor versions of the compiler aren't guaranteed to be compatible. Erm, that's definitely not true. Changes to libstdc++ or libc++ might generate incompatible objects, and there has been a lot of anguish in the past when GCC has done that (see how it had to revert changes to std::list in libstdc++ that were done to make it C++11 compliant but broke the ABI of std::list). You can even mix objects from GCC and clang and it will work fine (e.g. use clang or newer versions of GCC to build user applications that link against libraries in the base system built with a different version of either gcc or clang). -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299109 - head/sys/modules/bhnd/bhndb
Yeah I'm looking at it now. -adrian On 5 May 2016 at 10:09, Niclas Zeising wrote: > On 2016-05-05 17:51, Adrian Chadd wrote: >> I'll check. I've done full kernel builds with this though, I wonder >> why it's not showing up here. >> > > Hi! > I'm bitten by the same issue and just developed the same fix > independently of Ivan Klymenko. However, at least for me, the issue > only shows when doing a parallel build of the kernel, in my case make -j8. > Regards! > -- > Niclas ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299109 - head/sys/modules/bhnd/bhndb
> On May 5, 2016, at 11:29, Adrian Chadd wrote: > > Yeah I'm looking at it now. Already fixed in r299125. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299126 - head/sys/dev/acpica
Author: jkim Date: Thu May 5 18:43:31 2016 New Revision: 299126 URL: https://svnweb.freebsd.org/changeset/base/299126 Log: Fix intmax_t to uintptr_t casting on 32-bit platforms. Found by GCC. Submitted by: bde Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c == --- head/sys/dev/acpica/acpi_thermal.c Thu May 5 17:55:10 2016 (r299125) +++ head/sys/dev/acpica/acpi_thermal.c Thu May 5 18:43:31 2016 (r299126) @@ -785,7 +785,7 @@ acpi_tz_temp_sysctl(SYSCTL_HANDLER_ARGS) interror; sc = oidp->oid_arg1; -temp_ptr = (int *)((uintptr_t)sc + oidp->oid_arg2); +temp_ptr = (int *)(void *)(uintptr_t)((uintptr_t)sc + oidp->oid_arg2); temp = *temp_ptr; error = sysctl_handle_int(oidp, &temp, 0, req); @@ -814,7 +814,7 @@ acpi_tz_passive_sysctl(SYSCTL_HANDLER_AR interror; sc = oidp->oid_arg1; -val_ptr = (int *)((uintptr_t)sc + oidp->oid_arg2); +val_ptr = (int *)(void *)(uintptr_t)((uintptr_t)sc + oidp->oid_arg2); val = *val_ptr; error = sysctl_handle_int(oidp, &val, 0, req); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299129 - head/sys/dev/bhnd/bcma
Author: adrian Date: Thu May 5 19:30:14 2016 New Revision: 299129 URL: https://svnweb.freebsd.org/changeset/base/299129 Log: [bhnd] handle unknown port type. Reported by: emaste Modified: head/sys/dev/bhnd/bcma/bcma.c Modified: head/sys/dev/bhnd/bcma/bcma.c == --- head/sys/dev/bhnd/bcma/bcma.c Thu May 5 18:59:29 2016 (r299128) +++ head/sys/dev/bhnd/bcma/bcma.c Thu May 5 19:30:14 2016 (r299129) @@ -251,6 +251,11 @@ bcma_get_port_count(device_t dev, device return (dinfo->corecfg->num_bridge_ports); case BHND_PORT_AGENT: return (dinfo->corecfg->num_wrapper_ports); + default: + device_printf(dev, "%s: unknown type (%d)\n", + __func__, + type); + return (0); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299130 - head/sys/dev/bhnd/bhndb
Author: adrian Date: Thu May 5 19:38:53 2016 New Revision: 299130 URL: https://svnweb.freebsd.org/changeset/base/299130 Log: [bhnd] quieten gcc warning. Modified: head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c == --- head/sys/dev/bhnd/bhndb/bhndb.c Thu May 5 19:30:14 2016 (r299129) +++ head/sys/dev/bhnd/bhndb/bhndb.c Thu May 5 19:38:53 2016 (r299130) @@ -867,6 +867,9 @@ bhndb_get_rman(struct bhndb_softc *sc, d return (NULL); }; } + + /* Quieten gcc */ + return (NULL); } /** ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299131 - head/sys/dev/bwn
Author: adrian Date: Thu May 5 19:40:26 2016 New Revision: 299131 URL: https://svnweb.freebsd.org/changeset/base/299131 Log: [bwn] fix signed-ness of the rssi parameter. It's a uint8_t from the hardware. Found by: gcc Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c == --- head/sys/dev/bwn/if_bwn.c Thu May 5 19:38:53 2016(r299130) +++ head/sys/dev/bwn/if_bwn.c Thu May 5 19:40:26 2016(r299131) @@ -5434,7 +5434,7 @@ bwn_hwrate2ieeerate(int rate) * Valid for A, B, G, LP PHYs. */ static int8_t -bwn_rx_rssi_calc(struct bwn_mac *mac, int8_t in_rssi, +bwn_rx_rssi_calc(struct bwn_mac *mac, uint8_t in_rssi, int ofdm, int adjust_2053, int adjust_2050) { struct bwn_phy *phy = &mac->mac_phy; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299132 - stable/10/share/man/man7
Author: wblock (doc committer) Date: Thu May 5 19:44:06 2016 New Revision: 299132 URL: https://svnweb.freebsd.org/changeset/base/299132 Log: MFC r298759: Clarify build(7) instructions for alternate object directory. Modified: stable/10/share/man/man7/build.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man7/build.7 == --- stable/10/share/man/man7/build.7Thu May 5 19:40:26 2016 (r299131) +++ stable/10/share/man/man7/build.7Thu May 5 19:44:06 2016 (r299132) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 4, 2015 +.Dd April 28, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -179,6 +179,12 @@ Build everything but the kernel, configu .Pa etc , and .Pa release . +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. The actual build location prefix used is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} for native builds, and @@ -262,6 +268,12 @@ are: .Bl -tag -width ".Cm distributekernel" .It Cm buildkernel Rebuild the kernel and the kernel modules. +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. .It Cm installkernel Install the kernel and the kernel modules to directory .Pa ${DESTDIR}/boot/kernel , @@ -331,7 +343,7 @@ should be set as with .Dq Li "make installworld" . .It Cm delete-old-libs Delete obsolete base system libraries interactively. -This target should only be used if no 3rd party software uses these +This target should only be used if no third party software uses these libraries. When .Li -DBATCH_DELETE_OLD_FILES @@ -525,7 +537,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e., manpages, locale data files, timezone data files and +subdirectory (i.e., manual pages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299133 - head/sys/dev/bhnd/siba
Author: adrian Date: Thu May 5 19:54:17 2016 New Revision: 299133 URL: https://svnweb.freebsd.org/changeset/base/299133 Log: [bhnd] handle unknown bhnd port type. Modified: head/sys/dev/bhnd/siba/siba_subr.c Modified: head/sys/dev/bhnd/siba/siba_subr.c == --- head/sys/dev/bhnd/siba/siba_subr.c Thu May 5 19:44:06 2016 (r299132) +++ head/sys/dev/bhnd/siba/siba_subr.c Thu May 5 19:54:17 2016 (r299133) @@ -187,6 +187,11 @@ siba_dinfo_get_port(struct siba_devinfo return (NULL); case BHND_PORT_AGENT: return (NULL); + default: + printf("%s: unknown port_type (%d)\n", + __func__, + port_type); + return (NULL); } } @@ -369,4 +374,4 @@ siba_parse_admatch(uint32_t am, uint32_t } return (0); -} \ No newline at end of file +} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299134 - head/sys/dev/bhnd
Author: adrian Date: Thu May 5 19:55:16 2016 New Revision: 299134 URL: https://svnweb.freebsd.org/changeset/base/299134 Log: [bhnd] default to BUS_PROBE_DEFAULT for unknown BHND classes. Found by: gcc-4.2 Modified: head/sys/dev/bhnd/bhnd.c Modified: head/sys/dev/bhnd/bhnd.c == --- head/sys/dev/bhnd/bhnd.cThu May 5 19:54:17 2016(r299133) +++ head/sys/dev/bhnd/bhnd.cThu May 5 19:55:16 2016(r299134) @@ -351,6 +351,8 @@ bhnd_generic_get_probe_order(device_t de return (BHND_PROBE_ROOT + BHND_PROBE_ORDER_EARLY); return (BHND_PROBE_DEFAULT); + default: + return (BHND_PROBE_DEFAULT); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299135 - head/sys/dev/bhnd/bhndb
Author: adrian Date: Thu May 5 19:56:18 2016 New Revision: 299135 URL: https://svnweb.freebsd.org/changeset/base/299135 Log: [bhnd] don't use anonymous unions. Found by: gcc-4.2 Modified: head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb.h head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c head/sys/dev/bhnd/bhndb/bhndb_subr.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c == --- head/sys/dev/bhnd/bhndb/bhndb.c Thu May 5 19:55:16 2016 (r299134) +++ head/sys/dev/bhnd/bhndb/bhndb.c Thu May 5 19:56:18 2016 (r299135) @@ -259,9 +259,9 @@ bhndb_initialize_region_cfg(struct bhndb continue; /* Fetch the base address of the mapped port. */ - error = bhnd_get_region_addr(child, - regw->core.port_type, regw->core.port, - regw->core.region, &addr, &size); + error = bhnd_get_region_addr(child, + regw->d.core.port_type, regw->d.core.port, + regw->d.core.region, &addr, &size); if (error) return (error); Modified: head/sys/dev/bhnd/bhndb/bhndb.h == --- head/sys/dev/bhnd/bhndb/bhndb.h Thu May 5 19:55:16 2016 (r299134) +++ head/sys/dev/bhnd/bhndb/bhndb.h Thu May 5 19:56:18 2016 (r299135) @@ -98,7 +98,7 @@ struct bhndb_regwin { struct { bus_size_t cfg_offset; /**< window address config offset. */ } dyn; -}; + } d; }; #defineBHNDB_REGWIN_TABLE_END { BHNDB_REGWIN_T_INVALID, 0, 0, { 0, 0 } } @@ -170,4 +170,4 @@ struct bhndb_hw_priority { #defineBHNDB_HW_PRIORITY_TABLE_END { {}, BHNDB_PRIORITY_NONE, NULL, 0 } -#endif /* _BHND_BHNDB_H_ */ \ No newline at end of file +#endif /* _BHND_BHNDB_H_ */ Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c == --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Thu May 5 19:55:16 2016 (r299134) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Thu May 5 19:56:18 2016 (r299135) @@ -313,7 +313,7 @@ bhndb_pci_compat_setregwin(struct bhndb_ if ((error = bhndb_pci_fast_setregwin(sc, rw, addr))) return (error); - if (pci_read_config(parent, rw->dyn.cfg_offset, 4) == addr) + if (pci_read_config(parent, rw->d.dyn.cfg_offset, 4) == addr) return (0); DELAY(10); @@ -343,7 +343,7 @@ bhndb_pci_fast_setregwin(struct bhndb_pc if (addr % rw->win_size != 0) return (EINVAL); - pci_write_config(parent, rw->dyn.cfg_offset, addr, 4); + pci_write_config(parent, rw->d.dyn.cfg_offset, addr, 4); break; default: return (ENODEV); Modified: head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c == --- head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c Thu May 5 19:55:16 2016 (r299134) +++ head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c Thu May 5 19:56:18 2016 (r299135) @@ -93,7 +93,9 @@ const struct bhndb_hwcfg bhndb_pci_siba_ .win_type = BHNDB_REGWIN_T_DYN, .win_offset = BHNDB_PCI_V1_BAR0_WIN0_OFFSET, .win_size = BHNDB_PCI_V1_BAR0_WIN0_SIZE, - .dyn.cfg_offset = BHNDB_PCI_V1_BAR0_WIN0_CONTROL, + .d.dyn = { + .cfg_offset = BHNDB_PCI_V1_BAR0_WIN0_CONTROL + }, .res= { SYS_RES_MEMORY, PCIR_BAR(0) } }, BHNDB_REGWIN_TABLE_END @@ -122,7 +124,9 @@ const struct bhndb_hwcfg bhndb_pci_bcma_ .win_type = BHNDB_REGWIN_T_DYN, .win_offset = BHNDB_PCI_V1_BAR0_WIN0_OFFSET, .win_size = BHNDB_PCI_V1_BAR0_WIN0_SIZE, - .dyn.cfg_offset = BHNDB_PCI_V1_BAR0_WIN0_CONTROL, + .d.dyn = { + .cfg_offset = BHNDB_PCI_V1_BAR0_WIN0_CONTROL, + }, .res= { SYS_RES_MEMORY, PCIR_BAR(0) } }, @@ -131,7 +135,7 @@ const struct bhndb_hwcfg bhndb_pci_bcma_ .win_type = BHNDB_REGWIN_T_CORE, .win_offset = BHNDB_PCI_V1_BAR0_CCREGS_OFFSET, .win_size = BHNDB_PCI_V1_BAR0_CCREGS_SIZE, -
svn commit: r299136 - head/sys/netpfil/ipfw
Author: ae Date: Thu May 5 20:15:46 2016 New Revision: 299136 URL: https://svnweb.freebsd.org/changeset/base/299136 Log: Rename find_name_tlv_type() to ipfw_find_name_tlv_type() and make it global. Use it in ip_fw_table.c instead of find_name_tlv() to reduce duplicated code. Obtained from:Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_private.h == --- head/sys/netpfil/ipfw/ip_fw_private.h Thu May 5 19:56:18 2016 (r299135) +++ head/sys/netpfil/ipfw/ip_fw_private.h Thu May 5 20:15:46 2016 (r299136) @@ -684,6 +684,8 @@ void ipfw_objhash_set_funcs(struct named int ipfw_objhash_find_type(struct namedobj_instance *ni, struct tid_info *ti, uint32_t etlv, struct named_object **pno); void ipfw_export_obj_ntlv(struct named_object *no, ipfw_obj_ntlv *ntlv); +ipfw_obj_ntlv *ipfw_find_name_tlv_type(void *tlvs, int len, uint16_t uidx, +uint32_t etlv); void ipfw_init_obj_rewriter(void); void ipfw_destroy_obj_rewriter(void); void ipfw_add_obj_rewriter(struct opcode_obj_rewrite *rw, size_t count); Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c == --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu May 5 19:56:18 2016 (r299135) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu May 5 20:15:46 2016 (r299136) @@ -4089,8 +4089,8 @@ ipfw_objhash_lookup_name(struct namedobj * * Returns pointer to found TLV or NULL. */ -static ipfw_obj_ntlv * -find_name_tlv_type(void *tlvs, int len, uint16_t uidx, uint32_t etlv) +ipfw_obj_ntlv * +ipfw_find_name_tlv_type(void *tlvs, int len, uint16_t uidx, uint32_t etlv) { ipfw_obj_ntlv *ntlv; uintptr_t pa, pe; @@ -4145,7 +4145,7 @@ ipfw_objhash_find_type(struct namedobj_i if (ti->tlvs == NULL) return (EINVAL); - ntlv = find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, etlv); + ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, etlv); if (ntlv == NULL) return (EINVAL); name = ntlv->name; Modified: head/sys/netpfil/ipfw/ip_fw_table.c == --- head/sys/netpfil/ipfw/ip_fw_table.c Thu May 5 19:56:18 2016 (r299135) +++ head/sys/netpfil/ipfw/ip_fw_table.c Thu May 5 20:15:46 2016 (r299136) @@ -1879,7 +1879,6 @@ create_table(struct ip_fw_chain *ch, ip_ /* * Creates new table based on @ti and @aname. * - * Relies on table name checking inside find_name_tlv() * Assume @aname to be checked and valid. * Stores allocated table kidx inside @pkidx (if non-NULL). * Reference created table if @compat is non-zero. @@ -2927,44 +2926,6 @@ check_table_name(const char *name) } /* - * Find tablename TLV by @uid. - * Check @tlvs for valid data inside. - * - * Returns pointer to found TLV or NULL. - */ -static ipfw_obj_ntlv * -find_name_tlv(void *tlvs, int len, uint16_t uidx) -{ - ipfw_obj_ntlv *ntlv; - uintptr_t pa, pe; - int l; - - pa = (uintptr_t)tlvs; - pe = pa + len; - l = 0; - for (; pa < pe; pa += l) { - ntlv = (ipfw_obj_ntlv *)pa; - l = ntlv->head.length; - - if (l != sizeof(*ntlv)) - return (NULL); - - if (ntlv->head.type != IPFW_TLV_TBL_NAME) - continue; - - if (ntlv->idx != uidx) - continue; - - if (check_table_name(ntlv->name) != 0) - return (NULL); - - return (ntlv); - } - - return (NULL); -} - -/* * Finds table config based on either legacy index * or name in ntlv. * Note @ti structure contains unchecked data from userland. @@ -2981,7 +2942,8 @@ find_table_err(struct namedobj_instance uint32_t set; if (ti->tlvs != NULL) { - ntlv = find_name_tlv(ti->tlvs, ti->tlen, ti->uidx); + ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, + IPFW_TLV_TBL_NAME); if (ntlv == NULL) return (EINVAL); name = ntlv->name; @@ -3039,7 +3001,8 @@ alloc_table_config(struct ip_fw_chain *c uint32_t set; if (ti->tlvs != NULL) { - ntlv = find_name_tlv(ti->tlvs, ti->tlen, ti->uidx); + ntlv = ipfw_find_name_tlv_type(ti->tlvs, ti->tlen, ti->uidx, + IPFW_TLV_TBL_NAME); if (ntlv == NULL) return (NULL); name = ntlv->name; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listin
svn commit: r299137 - head/sys/dev/bwn
Author: adrian Date: Thu May 5 20:16:58 2016 New Revision: 299137 URL: https://svnweb.freebsd.org/changeset/base/299137 Log: .. delete this; I don't know why this was here. oops! Deleted: head/sys/dev/bwn/if_bwn.c.c ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r297748 - in head/sys: conf dev/acpica kern vm x86/acpica
On Sat, Apr 9, 2016 at 6:58 AM, John Baldwin wrote: > Author: jhb > Date: Sat Apr 9 13:58:04 2016 > New Revision: 297748 > URL: https://svnweb.freebsd.org/changeset/base/297748 > > Log: > Add more fine-grained kernel options for NUMA support. > > VM_NUMA_ALLOC is used to enable use of domain-aware memory allocation in > the virtual memory system. DEVICE_NUMA is used to enable affinity > reporting for devices such as bus_get_domain(). > > MAXMEMDOM must still be set to a value greater than for any NUMA support > to be effective. Note that 'cpuset -gd' always works if MAXMEMDOM is > enabled and the system supports NUMA. > > Reviewed by: kib > Differential Revision:https://reviews.freebsd.org/D5782 Jenkins/clang says vm_domain_rr_selectdomain(..) is unused if VM_NUMA_ALLOC isn't defined after this commit: https://jenkins.freebsd.org/job/FreeBSD_HEAD/250/warnings7Result/package.-887393991/source.-7253451996200343468/#55 . Could this be reduced/folded or did you mean to add more logic around this function in the future? Thanks, -Ngie ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299138 - head/lib/clang
Author: emaste Date: Thu May 5 21:20:09 2016 New Revision: 299138 URL: https://svnweb.freebsd.org/changeset/base/299138 Log: Limit Options.inc generation to desired targets As mentioned in the Makefile there's an "atrocious" hack to generate a different version of Options.inc.h, depending on the library being built. Remove the catch-all else case and limit it to specific libraries, so that we don't accidentally use the Options.inc.h from clangdriver if a future libary also uses Options.inc.h. Reviewed by: dim Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D6209 Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk == --- head/lib/clang/clang.build.mk Thu May 5 20:16:58 2016 (r299137) +++ head/lib/clang/clang.build.mk Thu May 5 21:20:09 2016 (r299138) @@ -221,13 +221,14 @@ Diagnostic${hdr}Kinds.inc.h: ${CLANG_SRC .endfor # XXX: Atrocious hack, need to clean this up later -.if defined(LIB) && ${LIB} == "llvmlibdriver" +.if ${LIB:U} == llvmlibdriver Options.inc.h: ${LLVM_SRCS}/lib/LibDriver/Options.td ${LLVM_TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include \ -d ${.TARGET:C/\.h$/.d/} -o ${.TARGET} \ ${LLVM_SRCS}/lib/LibDriver/Options.td -.else +.elif ${LIB:U} == clangdriver || ${LIB:U} == clangfrontend || \ +${LIB:U} == clangfrontendtool || ${PROG_CXX:U} == clang Options.inc.h: ${CLANG_SRCS}/include/clang/Driver/Options.td ${LLVM_TBLGEN} -gen-opt-parser-defs \ -I ${LLVM_SRCS}/include -I ${CLANG_SRCS}/include/clang/Driver \ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299139 - in head/secure/lib/libcrypto: . i386
Author: emaste Date: Thu May 5 21:25:41 2016 New Revision: 299139 URL: https://svnweb.freebsd.org/changeset/base/299139 Log: Make libcrypto position independent on i386 Prior to this change libcrypto ended up with a .text relocation. Submitted by: Rafael Espíndola (earlier version) Reviewed by: kib Approved by: so (glebius) Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D6164 Added: head/secure/lib/libcrypto/i386/crypt586.S - copied, changed from r299138, head/secure/lib/libcrypto/i386/crypt586.s Deleted: head/secure/lib/libcrypto/i386/crypt586.s Modified: head/secure/lib/libcrypto/Makefile Modified: head/secure/lib/libcrypto/Makefile == --- head/secure/lib/libcrypto/Makefile Thu May 5 21:20:09 2016 (r299138) +++ head/secure/lib/libcrypto/Makefile Thu May 5 21:25:41 2016 (r299139) @@ -137,7 +137,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c .if ${MACHINE_CPUARCH} == "i386" -SRCS+= crypt586.s des-586.s +SRCS+= crypt586.S des-586.s .else SRCS+= des_enc.c fcrypt_b.c .endif Copied and modified: head/secure/lib/libcrypto/i386/crypt586.S (from r299138, head/secure/lib/libcrypto/i386/crypt586.s) == --- head/secure/lib/libcrypto/i386/crypt586.s Thu May 5 21:20:09 2016 (r299138, copy source) +++ head/secure/lib/libcrypto/i386/crypt586.S Thu May 5 21:25:41 2016 (r299139) @@ -14,7 +14,15 @@ fcrypt_body: xorl%edi,%edi xorl%esi,%esi +#ifdef PIC + calll .L1 +.L1: + popl%edx + addl$_GLOBAL_OFFSET_TABLE_+(.-.L1), %edx + movlDES_SPtrans@GOT(%edx), %edx +#else lealDES_SPtrans,%edx +#endif pushl %edx movl28(%esp),%ebp pushl $25 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r299139 - in head/secure/lib/libcrypto: . i386
On 5 May 2016 at 17:25, Ed Maste wrote: > Author: emaste > Date: Thu May 5 21:25:41 2016 > New Revision: 299139 > URL: https://svnweb.freebsd.org/changeset/base/299139 > > Log: > Make libcrypto position independent on i386 Note that the generated output for these i386 .s files was committed in r95967. PIC support was added as of r109998 (OpenSSL 0.9.7) but these files have not been regenerated since the original import. I intend to regenerate all of these and compare the result sometime later on. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299140 - vendor/libcxxrt/dist
Author: dim Date: Thu May 5 22:09:43 2016 New Revision: 299140 URL: https://svnweb.freebsd.org/changeset/base/299140 Log: Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef. Interesting fixes: 760ae47 Add std::uncaught_exceptions(). e45e6db Fix off-by-ones in emergency exception buffer free 3adaa2e Fix _Unwind_Exception cleanup functions 286776c Check exception cleanup function ptr before calling edda626 Correct exception specifications on new and delete operators Modified: vendor/libcxxrt/dist/exception.cc vendor/libcxxrt/dist/memory.cc Modified: vendor/libcxxrt/dist/exception.cc == --- vendor/libcxxrt/dist/exception.cc Thu May 5 21:25:41 2016 (r299139) +++ vendor/libcxxrt/dist/exception.cc Thu May 5 22:09:43 2016 (r299140) @@ -304,13 +304,17 @@ static pthread_key_t eh_key; static void exception_cleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { - __cxa_free_exception(static_cast(ex)); + // Exception layout: + // [__cxa_exception [_Unwind_Exception]] [exception object] + // + // __cxa_free_exception expects a pointer to the exception object + __cxa_free_exception(static_cast(ex + 1)); } static void dependent_exception_cleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { - __cxa_free_dependent_exception(static_cast(ex)); + __cxa_free_dependent_exception(static_cast(ex + 1)); } /** @@ -340,7 +344,8 @@ static void thread_cleanup(void* thread_ if (info->foreign_exception_state != __cxa_thread_info::none) { _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(info->globals.caughtExceptions); - e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + if (e->exception_cleanup) + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); } else { @@ -516,7 +521,7 @@ static void emergency_malloc_free(char * break; } } - assert(buffer > 0 && + assert(buffer >= 0 && "Trying to free something that is not an emergency buffer!"); // emergency_malloc() is expected to return 0-initialized data. We don't // zero the buffer when allocating it, because the static buffers will @@ -556,7 +561,7 @@ static void free_exception(char *e) { // If this allocation is within the address range of the emergency buffer, // don't call free() because it was not allocated with malloc() - if ((e > emergency_buffer) && + if ((e >= emergency_buffer) && (e < (emergency_buffer + sizeof(emergency_buffer { emergency_malloc_free(e); @@ -1280,12 +1285,13 @@ extern "C" void __cxa_end_catch() if (ti->foreign_exception_state != __cxa_thread_info::none) { - globals->caughtExceptions = 0; if (ti->foreign_exception_state != __cxa_thread_info::rethrown) { _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ti->globals.caughtExceptions); - e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + if (e->exception_cleanup) + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); } + globals->caughtExceptions = 0; ti->foreign_exception_state = __cxa_thread_info::none; return; } @@ -1472,6 +1478,15 @@ namespace std return info->globals.uncaughtExceptions != 0; } /** +* Returns the number of exceptions currently being thrown that have not +* been caught. This can occur inside a nested catch statement. +*/ + int uncaught_exceptions() throw() + { + __cxa_thread_info *info = thread_info(); + return info->globals.uncaughtExceptions; + } + /** * Returns the current unexpected handler. */ unexpected_handler get_unexpected() throw() Modified: vendor/libcxxrt/dist/memory.cc == --- vendor/libcxxrt/dist/memory.cc Thu May 5 21:25:41 2016 (r299139) +++ vendor/libcxxrt/dist/memory.cc Thu May 5 22:09:43 2016 (r299140) @@ -71,8 +71,17 @@ namespace std } +#if __cplusplus < 201103L +#define NOEXCEPT throw() +#define BADALLOC throw(std::bad_alloc) +#else +#define NOEXCEPT noexcept +#define BADALLOC +#endif + + __attribute__((weak)) -void* operator new(size_t size) +void* operator new(size_t size) BADALLOC { if (0 == size) { @@ -97,7 +106,7 @@ void*
svn commit: r299141 - vendor/libcxxrt/2016-03-29-516a65c109eb0a01e5e95fbef455eb3215135cef
Author: dim Date: Thu May 5 22:10:41 2016 New Revision: 299141 URL: https://svnweb.freebsd.org/changeset/base/299141 Log: Tag libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef. Added: vendor/libcxxrt/2016-03-29-516a65c109eb0a01e5e95fbef455eb3215135cef/ - copied from r299140, vendor/libcxxrt/dist/ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299142 - in head/sys: amd64/conf arm64/conf conf dev/acpica dev/pci i386/conf powerpc/conf
Author: jhb Date: Thu May 5 22:26:23 2016 New Revision: 299142 URL: https://svnweb.freebsd.org/changeset/base/299142 Log: Native PCI-express HotPlug support. PCI-express HotPlug support is implemented via bits in the slot registers of the PCI-express capability of the downstream port along with an interrupt that triggers when bits in the slot status register change. This is implemented for FreeBSD by adding HotPlug support to the PCI-PCI bridge driver which attaches to the virtual PCI-PCI bridges representing downstream ports on HotPlug slots. The PCI-PCI bridge driver registers an interrupt handler to receive HotPlug events. It also uses the slot registers to determine the current HotPlug state and drive an internal HotPlug state machine. For simplicty of implementation, the PCI-PCI bridge device detaches and deletes the child PCI device when a card is removed from a slot and creates and attaches a PCI child device when a card is inserted into the slot. The PCI-PCI bridge driver provides a bus_child_present which claims that child devices are present on HotPlug-capable slots only when a card is inserted. Rather than requiring a timeout in the RC for config accesses to not-present children, the pcib_read/write_config methods fail all requests when a card is not present (or not yet ready). These changes include support for various optional HotPlug capabilities such as a power controller, mechanical latch, electro-mechanical interlock, indicators, and an attention button. It also includes support for devices which require waiting for command completion events before initiating a subsequent HotPlug command. However, it has only been tested on ExpressCard systems which support surprise removal and have none of these optional capabilities. PCI-express HotPlug support is conditional on the PCI_HP option which is enabled by default on arm64, x86, and powerpc. Reviewed by: adrian, imp, vangyzen (older versions) Relnotes: yes Differential Revision:https://reviews.freebsd.org/D6136 Modified: head/sys/amd64/conf/GENERIC head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_private.h head/sys/dev/pci/pcireg.h head/sys/i386/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Thu May 5 22:10:41 2016(r299141) +++ head/sys/amd64/conf/GENERIC Thu May 5 22:26:23 2016(r299142) @@ -102,6 +102,7 @@ device cpufreq device acpi optionsACPI_DMAR device pci +optionsPCI_HP # PCI-Express native HotPlug optionsPCI_IOV # PCI SR-IOV support # Floppy drives Modified: head/sys/arm64/conf/GENERIC == --- head/sys/arm64/conf/GENERIC Thu May 5 22:10:41 2016(r299141) +++ head/sys/arm64/conf/GENERIC Thu May 5 22:26:23 2016(r299142) @@ -96,6 +96,7 @@ devicevtnet # Bus drivers device pci +optionsPCI_HP # PCI-Express native HotPlug optionsPCI_IOV # PCI SR-IOV support # Ethernet NICs Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Thu May 5 22:10:41 2016(r299141) +++ head/sys/conf/NOTES Thu May 5 22:26:23 2016(r299142) @@ -1411,6 +1411,7 @@ options MSGBUF_SIZE=40960 # PCI bus & PCI options: # device pci +optionsPCI_HP # PCI-Express native HotPlug optionsPCI_IOV # PCI SR-IOV support Modified: head/sys/conf/options == --- head/sys/conf/options Thu May 5 22:10:41 2016(r299141) +++ head/sys/conf/options Thu May 5 22:26:23 2016(r299142) @@ -177,6 +177,7 @@ NO_SYSCTL_DESCR opt_global.h NSWBUF_MIN opt_swap.h MBUF_PACKET_ZONE_DISABLE opt_global.h PANIC_REBOOT_WAIT_TIME opt_panic.h +PCI_HP opt_pci.h PCI_IOVopt_global.h PPC_DEBUG opt_ppc.h PPC_PROBE_CHIPSET opt_ppc.h Modified: head/sys/dev/acpica/acpi_pcib_acpi.c == --- head/sys/dev/acpica/acpi_pcib_acpi.cThu May 5 22:10:41 2016 (r299141) +++ head/sys/dev/acpica/acpi_pcib_acpi.cThu May 5 22:26:23 2016 (r299142) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_pci.h" + #include #include #include @@ -312,6 +314,11 @@ acpi_pcib_osc(struct acpi_hpcib_softc *s
Re: svn commit: r299139 - in head/secure/lib/libcrypto: . i386
On 5 May 2016 at 21:31, Ed Maste wrote: > > these files have not been regenerated since the original import. I'm wrong: they have been regenerated, just not with -PIC. In any case, I'll investigate having them generated both ways and have the Makefile choose the desired ones. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299143 - head/contrib/libcxxrt
Author: dim Date: Thu May 5 22:30:00 2016 New Revision: 299143 URL: https://svnweb.freebsd.org/changeset/base/299143 Log: Since contrib/libcxxrt's ancestry was never correct, subversion 1.8 and higher cannot merge to it from the vendor area. Re-bootstrap the ancestry by doing (apologies to your retinas): * svn pg svn:mergeinfo contrib/libcxxrt > mergeinfo.txt * svn rm contrib/libcxxrt * svn cp ^/vendor/libcxxrt/dist@297299 contrib/libcxxrt * svn rm CMakeLists.txt doxygen_config * svn cp ^/head/contrib/libcxxrt/FREEBSD-upgrade@297299 contrib/libcxxrt * svn cp ^/head/contrib/libcxxrt/exception.cc@297299 contrib/libcxxrt * svn cp ^/head/contrib/libcxxrt/unwind-arm.h@297299 contrib/libcxxrt * svn pd -R svn:mergeinfo contrib/libcxxrt * svn ps -F mergeinfo.txt svn:mergeinfo contrib/libcxxrt Added: head/contrib/libcxxrt/FREEBSD-upgrade - copied unchanged from r297299, head/contrib/libcxxrt/FREEBSD-upgrade Replaced: - copied from r297299, vendor/libcxxrt/dist/ head/contrib/libcxxrt/exception.cc - copied unchanged from r297299, head/contrib/libcxxrt/exception.cc head/contrib/libcxxrt/unwind-arm.h - copied unchanged from r297299, head/contrib/libcxxrt/unwind-arm.h Directory Properties: head/contrib/libcxxrt/ (props changed) Deleted: head/contrib/libcxxrt/CMakeLists.txt head/contrib/libcxxrt/doxygen_config Copied: head/contrib/libcxxrt/FREEBSD-upgrade (from r297299, head/contrib/libcxxrt/FREEBSD-upgrade) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libcxxrt/FREEBSD-upgrade Thu May 5 22:30:00 2016 (r299143, copy of r297299, head/contrib/libcxxrt/FREEBSD-upgrade) @@ -0,0 +1,6 @@ +$FreeBSD$ + +This is the FreeBSD copy of libcxxrt. It contains the src directory from the +upstream repository. + +When updating, copy *.{c,cc,h} from the upstream src/. Copied: head/contrib/libcxxrt/exception.cc (from r297299, head/contrib/libcxxrt/exception.cc) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libcxxrt/exception.cc Thu May 5 22:30:00 2016 (r299143, copy of r297299, head/contrib/libcxxrt/exception.cc) @@ -0,0 +1,1544 @@ +/* + * Copyright 2010-2011 PathScale, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + *this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + *this list of conditions and the following disclaimer in the documentation + *and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS + * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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. + */ + +#include +#include +#include +#include +#include +#include +#include "typeinfo.h" +#include "dwarf_eh.h" +#include "atomic.h" +#include "cxxabi.h" + +#pragma weak pthread_key_create +#pragma weak pthread_setspecific +#pragma weak pthread_getspecific +#pragma weak pthread_once +#ifdef LIBCXXRT_WEAK_LOCKS +#pragma weak pthread_mutex_lock +#define pthread_mutex_lock(mtx) do {\ + if (pthread_mutex_lock) pthread_mutex_lock(mtx);\ + } while(0) +#pragma weak pthread_mutex_unlock +#define pthread_mutex_unlock(mtx) do {\ + if (pthread_mutex_unlock) pthread_mutex_unlock(mtx);\ + } while(0) +#pragma weak pthread_cond_signal +#define pthread_cond_signal(cv) do {\ + if (pthread_cond_signal) pthread_cond_signal(cv);\ + } while(0) +#pragma weak pthread_cond_wait +#define pthread_cond_wait(cv, mtx) do {\ + if (pthread_cond_wait) pthread_cond_wait(cv, mtx);\ + } while(0) +#endif + +using namespace ABI_NAMESPACE; + +/** + * Saves the result of the landing pad that we have found. For ARM, this is + * stored in the generic unwind structure, while on other platforms it is + * stored in the C++ exception. + */ +static void saveLandingPad(struct _Unwind_Context *context, +
svn commit: r299144 - head/contrib/libcxxrt
Author: dim Date: Thu May 5 22:40:07 2016 New Revision: 299144 URL: https://svnweb.freebsd.org/changeset/base/299144 Log: Import libcxxrt master 516a65c109eb0a01e5e95fbef455eb3215135cef. Interesting fixes: 3adaa2e Fix _Unwind_Exception cleanup functions 286776c Check exception cleanup function ptr before calling edda626 Correct exception specifications on new and delete operators Modified: head/contrib/libcxxrt/exception.cc head/contrib/libcxxrt/memory.cc Directory Properties: head/contrib/libcxxrt/ (props changed) Modified: head/contrib/libcxxrt/exception.cc == --- head/contrib/libcxxrt/exception.cc Thu May 5 22:30:00 2016 (r299143) +++ head/contrib/libcxxrt/exception.cc Thu May 5 22:40:07 2016 (r299144) @@ -304,13 +304,17 @@ static pthread_key_t eh_key; static void exception_cleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { - __cxa_free_exception(static_cast(ex)); + // Exception layout: + // [__cxa_exception [_Unwind_Exception]] [exception object] + // + // __cxa_free_exception expects a pointer to the exception object + __cxa_free_exception(static_cast(ex + 1)); } static void dependent_exception_cleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { - __cxa_free_dependent_exception(static_cast(ex)); + __cxa_free_dependent_exception(static_cast(ex + 1)); } /** @@ -340,7 +344,8 @@ static void thread_cleanup(void* thread_ if (info->foreign_exception_state != __cxa_thread_info::none) { _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(info->globals.caughtExceptions); - e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + if (e->exception_cleanup) + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); } else { @@ -1282,12 +1287,13 @@ extern "C" void __cxa_end_catch() if (ti->foreign_exception_state != __cxa_thread_info::none) { - globals->caughtExceptions = 0; if (ti->foreign_exception_state != __cxa_thread_info::rethrown) { _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ti->globals.caughtExceptions); - e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + if (e->exception_cleanup) + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); } + globals->caughtExceptions = 0; ti->foreign_exception_state = __cxa_thread_info::none; return; } Modified: head/contrib/libcxxrt/memory.cc == --- head/contrib/libcxxrt/memory.cc Thu May 5 22:30:00 2016 (r299143) +++ head/contrib/libcxxrt/memory.cc Thu May 5 22:40:07 2016 (r299144) @@ -71,8 +71,17 @@ namespace std } +#if __cplusplus < 201103L +#define NOEXCEPT throw() +#define BADALLOC throw(std::bad_alloc) +#else +#define NOEXCEPT noexcept +#define BADALLOC +#endif + + __attribute__((weak)) -void* operator new(size_t size) +void* operator new(size_t size) BADALLOC { if (0 == size) { @@ -97,7 +106,7 @@ void* operator new(size_t size) } __attribute__((weak)) -void* operator new(size_t size, const std::nothrow_t &) throw() +void* operator new(size_t size, const std::nothrow_t &) NOEXCEPT { try { return :: operator new(size); @@ -110,27 +119,21 @@ void* operator new(size_t size, const st __attribute__((weak)) -void operator delete(void * ptr) -#if __cplusplus < 201000L -throw() -#endif +void operator delete(void * ptr) NOEXCEPT { free(ptr); } __attribute__((weak)) -void * operator new[](size_t size) -#if __cplusplus < 201000L -throw(std::bad_alloc) -#endif +void * operator new[](size_t size) BADALLOC { return ::operator new(size); } __attribute__((weak)) -void * operator new[](size_t size, const std::nothrow_t &) throw() +void * operator new[](size_t size, const std::nothrow_t &) NOEXCEPT { try { return ::operator new[](size); @@ -143,10 +146,7 @@ void * operator new[](size_t size, const __attribute__((weak)) -void operator delete[](void * ptr) -#if __cplusplus < 201000L -throw() -#endif +void operator delete[](void * ptr) NOEXCEPT { ::operator delete(ptr); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299145 - stable/10/sys/netinet6
Author: markj Date: Thu May 5 23:06:39 2016 New Revision: 299145 URL: https://svnweb.freebsd.org/changeset/base/299145 Log: MFC r295583, r295584, r295729, r295730: NDP code cleanup changes. MFC r295732: Fix an IPv6 DAD reference count leak. Modified: stable/10/sys/netinet6/nd6.c stable/10/sys/netinet6/nd6.h stable/10/sys/netinet6/nd6_nbr.c stable/10/sys/netinet6/nd6_rtr.c stable/10/sys/netinet6/scope6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/nd6.c == --- stable/10/sys/netinet6/nd6.cThu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6.cThu May 5 23:06:39 2016 (r299145) @@ -2215,7 +2215,7 @@ nd6_sysctl_drlist(SYSCTL_HANDLER_ARGS) error = sa6_recoverscope(&d.rtaddr); if (error != 0) return (error); - d.flags = dr->flags; + d.flags = dr->raflags; d.rtlifetime = dr->rtlifetime; d.expire = dr->expire + (time_second - time_uptime); d.if_index = dr->ifp->if_index; Modified: stable/10/sys/netinet6/nd6.h == --- stable/10/sys/netinet6/nd6.hThu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6.hThu May 5 23:06:39 2016 (r299145) @@ -235,13 +235,13 @@ structin6_ndifreq { ((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10 /1000) TAILQ_HEAD(nd_drhead, nd_defrouter); -struct nd_defrouter { +struct nd_defrouter { TAILQ_ENTRY(nd_defrouter) dr_entry; - struct in6_addr rtaddr; - u_char flags; /* flags on RA message */ + struct in6_addr rtaddr; + u_char raflags;/* flags on RA message */ u_short rtlifetime; u_long expire; - struct ifnet *ifp; + struct ifnet *ifp; int installed; /* is installed into kernel routing table */ }; @@ -445,7 +445,6 @@ void nd6_dad_stop(struct ifaddr *); /* nd6_rtr.c */ void nd6_rs_input(struct mbuf *, int, int); void nd6_ra_input(struct mbuf *, int, int); -void prelist_del(struct nd_prefix *); void defrouter_reset(void); void defrouter_select(void); void defrtrlist_del(struct nd_defrouter *); Modified: stable/10/sys/netinet6/nd6_nbr.c == --- stable/10/sys/netinet6/nd6_nbr.cThu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6_nbr.cThu May 5 23:06:39 2016 (r299145) @@ -1315,9 +1315,10 @@ nd6_dad_start(struct ifaddr *ifa, int de } if ((dp = nd6_dad_find(ifa, NULL)) != NULL) { /* -* DAD already in progress. Let the existing entry -* to finish it. +* DAD is already in progress. Let the existing entry +* finish it. */ + nd6_dad_rele(dp); return; } Modified: stable/10/sys/netinet6/nd6_rtr.c == --- stable/10/sys/netinet6/nd6_rtr.cThu May 5 22:40:07 2016 (r299144) +++ stable/10/sys/netinet6/nd6_rtr.cThu May 5 23:06:39 2016 (r299145) @@ -270,7 +270,7 @@ nd6_ra_input(struct mbuf *m, int off, in bzero(&dr0, sizeof(dr0)); dr0.rtaddr = saddr6; - dr0.flags = nd_ra->nd_ra_flags_reserved; + dr0.raflags = nd_ra->nd_ra_flags_reserved; /* * Effectively-disable routes from RA messages when * ND6_IFF_NO_RADR enabled on the receiving interface or @@ -708,7 +708,7 @@ defrouter_select(void) static int rtpref(struct nd_defrouter *dr) { - switch (dr->flags & ND_RA_FLAG_RTPREF_MASK) { + switch (dr->raflags & ND_RA_FLAG_RTPREF_MASK) { case ND_RA_FLAG_RTPREF_HIGH: return (RTPREF_HIGH); case ND_RA_FLAG_RTPREF_MEDIUM: @@ -722,7 +722,7 @@ rtpref(struct nd_defrouter *dr) * serious bug of kernel internal. We thus always bark here. * Or, can we even panic? */ - log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->flags); + log(LOG_ERR, "rtpref: impossible RA flag %x\n", dr->raflags); return (RTPREF_INVALID); } /* NOTREACHED */ @@ -744,7 +744,7 @@ defrtrlist_update(struct nd_defrouter *n oldpref = rtpref(dr); /* override */ - dr->flags = new->flags; /* xxx flag check */ + dr->raflags = new->raflags; /* XXX flag check */ dr->rtlifetime = new->rtlifetime; dr->expire = new->expire; @@ -937,9 +937,9 @@ prelist_remove(struct nd_prefix *pr) /* unlink ndpr_entry from nd_prefix list */ L
svn commit: r299147 - stable/9/sys/netinet
Author: jtl Date: Fri May 6 01:27:01 2016 New Revision: 299147 URL: https://svnweb.freebsd.org/changeset/base/299147 Log: MFC r298408: Prevent underflows in tp->snd_wnd if the remote side ACKs more than tp->snd_wnd. This can happen, for example, when the remote side responds to a window probe by ACKing the one byte it contains. Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c == --- stable/9/sys/netinet/tcp_input.cFri May 6 01:26:58 2016 (r299146) +++ stable/9/sys/netinet/tcp_input.cFri May 6 01:27:01 2016 (r299147) @@ -2629,6 +2629,9 @@ process_ACK: INP_WLOCK_ASSERT(tp->t_inpcb); acked = BYTES_THIS_ACK(tp, th); + KASSERT(acked >= 0, ("%s: acked unexepectedly negative " + "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, + tp->snd_una, th->th_ack, tp, m)); TCPSTAT_INC(tcps_rcvackpack); TCPSTAT_ADD(tcps_rcvackbyte, acked); @@ -2698,12 +2701,18 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { - tp->snd_wnd -= so->so_snd.sb_cc; + if (tp->snd_wnd >= so->so_snd.sb_cc) + tp->snd_wnd -= so->so_snd.sb_cc; + else + tp->snd_wnd = 0; sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { sbdrop_locked(&so->so_snd, acked); - tp->snd_wnd -= acked; + if (tp->snd_wnd >= (u_long) acked) + tp->snd_wnd -= acked; + else + tp->snd_wnd = 0; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299146 - stable/10/sys/netinet
Author: jtl Date: Fri May 6 01:26:58 2016 New Revision: 299146 URL: https://svnweb.freebsd.org/changeset/base/299146 Log: MFC r298408: Prevent underflows in tp->snd_wnd if the remote side ACKs more than tp->snd_wnd. This can happen, for example, when the remote side responds to a window probe by ACKing the one byte it contains. Modified: stable/10/sys/netinet/tcp_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_input.c == --- stable/10/sys/netinet/tcp_input.c Thu May 5 23:06:39 2016 (r299145) +++ stable/10/sys/netinet/tcp_input.c Fri May 6 01:26:58 2016 (r299146) @@ -2733,6 +2733,9 @@ process_ACK: INP_WLOCK_ASSERT(tp->t_inpcb); acked = BYTES_THIS_ACK(tp, th); + KASSERT(acked >= 0, ("%s: acked unexepectedly negative " + "(tp->snd_una=%u, th->th_ack=%u, tp=%p, m=%p)", __func__, + tp->snd_una, th->th_ack, tp, m)); TCPSTAT_INC(tcps_rcvackpack); TCPSTAT_ADD(tcps_rcvackbyte, acked); @@ -2802,13 +2805,19 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { - tp->snd_wnd -= so->so_snd.sb_cc; + if (tp->snd_wnd >= so->so_snd.sb_cc) + tp->snd_wnd -= so->so_snd.sb_cc; + else + tp->snd_wnd = 0; mfree = sbcut_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { mfree = sbcut_locked(&so->so_snd, acked); - tp->snd_wnd -= acked; + if (tp->snd_wnd >= (u_long) acked) + tp->snd_wnd -= acked; + else + tp->snd_wnd = 0; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299148 - stable/10/sbin/restore
Author: pfg Date: Fri May 6 01:37:06 2016 New Revision: 299148 URL: https://svnweb.freebsd.org/changeset/base/299148 Log: MFC r298868, r298874: restore: fix memory and resource handle leaks. CID: 272297, 1007784 Modified: stable/10/sbin/restore/main.c stable/10/sbin/restore/symtab.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/restore/main.c == --- stable/10/sbin/restore/main.c Fri May 6 01:27:01 2016 (r299147) +++ stable/10/sbin/restore/main.c Fri May 6 01:37:06 2016 (r299148) @@ -366,7 +366,8 @@ obsolete(int *argcp, char **argvp[]) if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++)); Modified: stable/10/sbin/restore/symtab.c == --- stable/10/sbin/restore/symtab.c Fri May 6 01:27:01 2016 (r299147) +++ stable/10/sbin/restore/symtab.c Fri May 6 01:37:06 2016 (r299148) @@ -560,6 +560,7 @@ initsymtable(char *filename) fprintf(stderr, "read: %s\n", strerror(errno)); panic("cannot read symbol table file %s\n", filename); } + (void)close(fd); switch (command) { case 'r': /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299149 - stable/9/sbin/restore
Author: pfg Date: Fri May 6 01:38:12 2016 New Revision: 299149 URL: https://svnweb.freebsd.org/changeset/base/299149 Log: MFC r298868, r298874: restore: fix memory and resource handle leaks. CID: 272297, 1007784 Modified: stable/9/sbin/restore/main.c stable/9/sbin/restore/symtab.c Directory Properties: stable/9/sbin/restore/ (props changed) Modified: stable/9/sbin/restore/main.c == --- stable/9/sbin/restore/main.cFri May 6 01:37:06 2016 (r299148) +++ stable/9/sbin/restore/main.cFri May 6 01:38:12 2016 (r299149) @@ -366,7 +366,8 @@ obsolete(int *argcp, char **argvp[]) if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++)); Modified: stable/9/sbin/restore/symtab.c == --- stable/9/sbin/restore/symtab.c Fri May 6 01:37:06 2016 (r299148) +++ stable/9/sbin/restore/symtab.c Fri May 6 01:38:12 2016 (r299149) @@ -559,6 +559,7 @@ initsymtable(char *filename) fprintf(stderr, "read: %s\n", strerror(errno)); panic("cannot read symbol table file %s\n", filename); } + (void)close(fd); switch (command) { case 'r': /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299150 - head/sys/rpc
Author: pfg Date: Fri May 6 01:49:46 2016 New Revision: 299150 URL: https://svnweb.freebsd.org/changeset/base/299150 Log: sys/rpc: minor spelling fixes. No functional change. Modified: head/sys/rpc/clnt_bck.c head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/svc.c head/sys/rpc/svc.h head/sys/rpc/types.h Modified: head/sys/rpc/clnt_bck.c == --- head/sys/rpc/clnt_bck.c Fri May 6 01:38:12 2016(r299149) +++ head/sys/rpc/clnt_bck.c Fri May 6 01:49:46 2016(r299150) @@ -431,7 +431,7 @@ got_reply: } } /* end successful completion */ /* -* If unsuccesful AND error is an authentication error +* If unsuccessful AND error is an authentication error * then refresh credentials and try again, else break */ else if (stat == RPC_AUTHERROR) Modified: head/sys/rpc/clnt_dg.c == --- head/sys/rpc/clnt_dg.c Fri May 6 01:38:12 2016(r299149) +++ head/sys/rpc/clnt_dg.c Fri May 6 01:49:46 2016(r299150) @@ -742,7 +742,7 @@ got_reply: } } /* end successful completion */ /* -* If unsuccesful AND error is an authentication error +* If unsuccessful AND error is an authentication error * then refresh credentials and try again, else break */ else if (stat == RPC_AUTHERROR) @@ -882,7 +882,7 @@ clnt_dg_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the version number field is the fifth field from the -* begining of the RPC header. MUST be changed if the +* beginning of the RPC header. MUST be changed if the * call_struct is changed */ *(uint32_t *)info = @@ -899,7 +899,7 @@ clnt_dg_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the program number field is the fourth field from the -* begining of the RPC header. MUST be changed if the +* beginning of the RPC header. MUST be changed if the * call_struct is changed */ *(uint32_t *)info = Modified: head/sys/rpc/clnt_vc.c == --- head/sys/rpc/clnt_vc.c Fri May 6 01:38:12 2016(r299149) +++ head/sys/rpc/clnt_vc.c Fri May 6 01:49:46 2016(r299150) @@ -520,7 +520,7 @@ got_reply: } } /* end successful completion */ /* -* If unsuccesful AND error is an authentication error +* If unsuccessful AND error is an authentication error * then refresh credentials and try again, else break */ else if (stat == RPC_AUTHERROR) @@ -653,7 +653,7 @@ clnt_vc_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the version number field is the fifth field from the -* begining of the RPC header. MUST be changed if the +* beginning of the RPC header. MUST be changed if the * call_struct is changed */ *(uint32_t *)info = @@ -671,7 +671,7 @@ clnt_vc_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the program number field is the fourth field from the -* begining of the RPC header. MUST be changed if the +* beginning of the RPC header. MUST be changed if the * call_struct is changed */ *(uint32_t *)info = Modified: head/sys/rpc/svc.c == --- head/sys/rpc/svc.c Fri May 6 01:38:12 2016(r299149) +++ head/sys/rpc/svc.c Fri May 6 01:49:46 2016(r299150) @@ -440,7 +440,7 @@ xprt_inactive(SVCXPRT *xprt) /* * Variant of xprt_inactive() for use only when sure that port is - * assigned to thread. For example, withing receive handlers. + * assigned to thread. For example, within receive handlers. */ void xprt_inactive_self(SVCXPRT *xprt) Modified: head/sys/rpc/svc.h == --- head/sys/rpc/svc.h Fri May 6 01:38:12 2016(r299149) +++ head/sys/rpc/svc.h Fri May 6 01:49:46 2
svn commit: r299151 - head/sbin/nvmecontrol
Author: pfg Date: Fri May 6 03:11:34 2016 New Revision: 299151 URL: https://svnweb.freebsd.org/changeset/base/299151 Log: nvmecontrol.8: minor spelling fix. No functional change. Modified: head/sbin/nvmecontrol/nvmecontrol.8 Modified: head/sbin/nvmecontrol/nvmecontrol.8 == --- head/sbin/nvmecontrol/nvmecontrol.8 Fri May 6 01:49:46 2016 (r299150) +++ head/sbin/nvmecontrol/nvmecontrol.8 Fri May 6 03:11:34 2016 (r299151) @@ -89,7 +89,7 @@ Display a human-readable summary of the .Pp .Dl nvmecontrol identify -x -v nvme0ns1 .Pp -Display a hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace +Display an hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace 1. .Pp .Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1 @@ -110,7 +110,7 @@ SMART/Health Information Log (ID=2), and .Pp .Dl nvmecontrol logpage -p 1 -x nvme0 .Pp -Display a hexidecimal dump of the nvme0 controller's Error Information Log. +Display a hexadecimal dump of the nvme0 controller's Error Information Log. .Pp .Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0 .Pp ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299152 - head/sys/netpfil/ipfw
Author: ae Date: Fri May 6 03:18:51 2016 New Revision: 299152 URL: https://svnweb.freebsd.org/changeset/base/299152 Log: Change the type of objhash_cb_t callback function to be able return an error code. Use it to interrupt the loop in ipfw_objhash_foreach(). Obtained from:Yandex LLC Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_iface.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c head/sys/netpfil/ipfw/ip_fw_table.c head/sys/netpfil/ipfw/ip_fw_table_algo.c head/sys/netpfil/ipfw/ip_fw_table_value.c Modified: head/sys/netpfil/ipfw/ip_fw_iface.c == --- head/sys/netpfil/ipfw/ip_fw_iface.c Fri May 6 03:11:34 2016 (r299151) +++ head/sys/netpfil/ipfw/ip_fw_iface.c Fri May 6 03:18:51 2016 (r299152) @@ -249,13 +249,14 @@ vnet_ipfw_iface_init(struct ip_fw_chain } } -static void +static int destroy_iface(struct namedobj_instance *ii, struct named_object *no, void *arg) { /* Assume all consumers have been already detached */ free(no, M_IPFW); + return (0); } /* @@ -460,7 +461,7 @@ struct dump_iface_args { struct sockopt_data *sd; }; -static void +static int export_iface_internal(struct namedobj_instance *ii, struct named_object *no, void *arg) { @@ -481,6 +482,7 @@ export_iface_internal(struct namedobj_in i->ifindex = iif->ifindex; i->refcnt = iif->no.refcnt; i->gencnt = iif->gencnt; + return (0); } /* Modified: head/sys/netpfil/ipfw/ip_fw_private.h == --- head/sys/netpfil/ipfw/ip_fw_private.h Fri May 6 03:11:34 2016 (r299151) +++ head/sys/netpfil/ipfw/ip_fw_private.h Fri May 6 03:18:51 2016 (r299152) @@ -649,7 +649,7 @@ caddr_t ipfw_get_sopt_header(struct sock } while(0) struct namedobj_instance; -typedef void (objhash_cb_t)(struct namedobj_instance *ni, struct named_object *, +typedef int (objhash_cb_t)(struct namedobj_instance *ni, struct named_object *, void *arg); typedef uint32_t (objhash_hash_f)(struct namedobj_instance *ni, const void *key, uint32_t kopt); @@ -675,7 +675,7 @@ int ipfw_objhash_same_name(struct namedo void ipfw_objhash_add(struct namedobj_instance *ni, struct named_object *no); void ipfw_objhash_del(struct namedobj_instance *ni, struct named_object *no); uint32_t ipfw_objhash_count(struct namedobj_instance *ni); -void ipfw_objhash_foreach(struct namedobj_instance *ni, objhash_cb_t *f, +int ipfw_objhash_foreach(struct namedobj_instance *ni, objhash_cb_t *f, void *arg); int ipfw_objhash_free_idx(struct namedobj_instance *ni, uint16_t idx); int ipfw_objhash_alloc_idx(void *n, uint16_t *pidx); Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c == --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri May 6 03:11:34 2016 (r299151) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Fri May 6 03:18:51 2016 (r299152) @@ -3009,7 +3009,7 @@ ipfw_del_obj_rewriter(struct opcode_obj_ return (0); } -static void +static int export_objhash_ntlv_internal(struct namedobj_instance *ni, struct named_object *no, void *arg) { @@ -3019,8 +3019,9 @@ export_objhash_ntlv_internal(struct name sd = (struct sockopt_data *)arg; ntlv = (ipfw_obj_ntlv *)ipfw_get_sopt_space(sd, sizeof(*ntlv)); if (ntlv == NULL) - return; + return (ENOMEM); ipfw_export_obj_ntlv(no, ntlv); + return (0); } /* @@ -4249,16 +4250,20 @@ ipfw_objhash_count(struct namedobj_insta * Runs @func for each found named object. * It is safe to delete objects from callback */ -void +int ipfw_objhash_foreach(struct namedobj_instance *ni, objhash_cb_t *f, void *arg) { struct named_object *no, *no_tmp; - int i; + int i, ret; for (i = 0; i < ni->nn_size; i++) { - TAILQ_FOREACH_SAFE(no, &ni->names[i], nn_next, no_tmp) - f(ni, no, arg); + TAILQ_FOREACH_SAFE(no, &ni->names[i], nn_next, no_tmp) { + ret = f(ni, no, arg); + if (ret != 0) + return (ret); + } } + return (0); } /* Modified: head/sys/netpfil/ipfw/ip_fw_table.c == --- head/sys/netpfil/ipfw/ip_fw_table.c Fri May 6 03:11:34 2016 (r299151) +++ head/sys/netpfil/ipfw/ip_fw_table.c Fri May 6 03:18:51 2016 (r299152) @@ -2119,7 +2119,7 @@ struct dump_table_args { struct sockopt_data *sd; }; -static void +static int export_table_internal(struct namedobj_instance *ni, struct named_object *no, void *arg) { @@ -2132,6 +2132,7 @@ export_table
svn commit: r299153 - stable/10/sys/dev/hyperv/storvsc
Author: sephe Date: Fri May 6 05:16:42 2016 New Revision: 299153 URL: https://svnweb.freebsd.org/changeset/base/299153 Log: MFC r298038 hyperv/stor: Temporary disable the wrongly done command timeout. It will be reenabled once the request processing is corrected. Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri May 6 03:18:51 2016(r299152) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Fri May 6 05:16:42 2016(r299153) @@ -1273,6 +1273,7 @@ storvsc_timeout_test(struct hv_storvsc_r } #endif /* HVS_TIMEOUT_TEST */ +#ifdef notyet /** * @brief timeout handler for requests * @@ -1320,6 +1321,7 @@ storvsc_timeout(void *arg) storvsc_timeout_test(reqp, MODE_SELECT_10, 1); #endif } +#endif /** * @brief StorVSC device poll function @@ -1472,6 +1474,7 @@ storvsc_action(struct cam_sim *sim, unio return; } +#ifdef notyet if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { callout_init(&reqp->callout, CALLOUT_MPSAFE); callout_reset_sbt(&reqp->callout, @@ -1491,6 +1494,7 @@ storvsc_action(struct cam_sim *sim, unio } #endif /* HVS_TIMEOUT_TEST */ } +#endif if ((res = hv_storvsc_io_request(sc->hs_dev, reqp)) != 0) { xpt_print(ccb->ccb_h.path, @@ -2039,6 +2043,7 @@ storvsc_io_done(struct hv_storvsc_reques mtx_unlock(&sc->hs_lock); } +#ifdef notyet /* * callout_drain() will wait for the timer handler to finish * if it is running. So we don't need any lock to synchronize @@ -2049,6 +2054,7 @@ storvsc_io_done(struct hv_storvsc_reques if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { callout_drain(&reqp->callout); } +#endif ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299154 - head/sys/mips/mediatek
Author: sgalabov Date: Fri May 6 05:22:25 2016 New Revision: 299154 URL: https://svnweb.freebsd.org/changeset/base/299154 Log: mtk_gpio fixes Allow output pins to be read and input pins to be set. Fix bugs where we were trying to access the gpio softc before doing device_get_softc. Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision:https://reviews.freebsd.org/D6222 Modified: head/sys/mips/mediatek/mtk_gpio_v1.c head/sys/mips/mediatek/mtk_gpio_v2.c Modified: head/sys/mips/mediatek/mtk_gpio_v1.c == --- head/sys/mips/mediatek/mtk_gpio_v1.cFri May 6 05:16:42 2016 (r299153) +++ head/sys/mips/mediatek/mtk_gpio_v1.cFri May 6 05:22:25 2016 (r299154) @@ -290,7 +290,7 @@ mtk_gpio_attach(device_t dev) else sc->num_pins = MTK_GPIO_PINS; - for (i = 0; i < num_pins; i++) { + for (i = 0; i < sc->num_pins; i++) { sc->pins[i].pin_caps |= GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_INVIN | GPIO_PIN_INVOUT; sc->pins[i].intr_polarity = INTR_POLARITY_HIGH; @@ -444,18 +444,12 @@ mtk_gpio_pin_set(device_t dev, uint32_t return (EINVAL); MTK_GPIO_LOCK(sc); - if(!(sc->pins[pin].pin_flags & GPIO_PIN_OUTPUT)) { - ret = EINVAL; - goto out; - } - if (value) MTK_WRITE_4(sc, GPIO_PIOSET, (1u << pin)); else MTK_WRITE_4(sc, GPIO_PIORESET, (1u << pin)); - -out: MTK_GPIO_UNLOCK(sc); + return (ret); } @@ -473,15 +467,10 @@ mtk_gpio_pin_get(device_t dev, uint32_t return (EINVAL); MTK_GPIO_LOCK(sc); - if(!(sc->pins[pin].pin_flags & GPIO_PIN_INPUT)) { - ret = EINVAL; - goto out; - } data = MTK_READ_4(sc, GPIO_PIODATA); *val = (data & (1u << pin)) ? 1 : 0; - -out: MTK_GPIO_UNLOCK(sc); + return (ret); } @@ -491,12 +480,12 @@ mtk_gpio_pin_toggle(device_t dev, uint32 struct mtk_gpio_softc *sc; int ret; - if (pin >= sc->num_pins) - return (EINVAL); - sc = device_get_softc(dev); ret = 0; + if (pin >= sc->num_pins) + return (EINVAL); + MTK_GPIO_LOCK(sc); if (!(sc->pins[pin].pin_flags & GPIO_PIN_OUTPUT)) { ret = EINVAL; Modified: head/sys/mips/mediatek/mtk_gpio_v2.c == --- head/sys/mips/mediatek/mtk_gpio_v2.cFri May 6 05:16:42 2016 (r299153) +++ head/sys/mips/mediatek/mtk_gpio_v2.cFri May 6 05:22:25 2016 (r299154) @@ -428,23 +428,17 @@ mtk_gpio_pin_set(device_t dev, uint32_t struct mtk_gpio_softc *sc; int ret; - if (pin >= sc->num_pins) - return (EINVAL); - sc = device_get_softc(dev); ret = 0; + if (pin >= sc->num_pins) + return (EINVAL); + MTK_GPIO_LOCK(sc); - if (!(sc->pins[pin].pin_flags & GPIO_PIN_OUTPUT)) { - ret = EINVAL; - goto out; - } if (value) MTK_WRITE_4(sc, GPIO_PIOSET(sc), (1u << pin)); else MTK_WRITE_4(sc, GPIO_PIORESET(sc), (1u << pin)); - -out: MTK_GPIO_UNLOCK(sc); return (ret); @@ -457,22 +451,17 @@ mtk_gpio_pin_get(device_t dev, uint32_t uint32_t data; int ret; - if (pin >= sc->num_pins) - return (EINVAL); - sc = device_get_softc(dev); ret = 0; + if (pin >= sc->num_pins) + return (EINVAL); + MTK_GPIO_LOCK(sc); - if (!(sc->pins[pin].pin_flags & GPIO_PIN_INPUT)) { - ret = EINVAL; - goto out; - } data = MTK_READ_4(sc, GPIO_PIODATA(sc)); *val = (data & (1u << pin)) ? 1 : 0; - -out: MTK_GPIO_UNLOCK(sc); + return (ret); } @@ -483,12 +472,12 @@ mtk_gpio_pin_toggle(device_t dev, uint32 uint32_t val; int ret; - if (pin >= sc->num_pins) - return (EINVAL); - sc = device_get_softc(dev); ret = 0; + if (pin >= sc->num_pins) + return (EINVAL); + MTK_GPIO_LOCK(sc); if(!(sc->pins[pin].pin_flags & GPIO_PIN_OUTPUT)) { ret = EINVAL; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299155 - head/sys/mips/mediatek
Author: sgalabov Date: Fri May 6 05:24:10 2016 New Revision: 299155 URL: https://svnweb.freebsd.org/changeset/base/299155 Log: mtk_spi cleanup commented printfs Approved by: adrian (mentor) Sponsored by: Smartcom - Bulgaria AD Differential Revision:https://reviews.freebsd.org/D6223 Modified: head/sys/mips/mediatek/mtk_spi_v1.c head/sys/mips/mediatek/mtk_spi_v2.c Modified: head/sys/mips/mediatek/mtk_spi_v1.c == --- head/sys/mips/mediatek/mtk_spi_v1.c Fri May 6 05:22:25 2016 (r299154) +++ head/sys/mips/mediatek/mtk_spi_v1.c Fri May 6 05:24:10 2016 (r299155) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -//#include #include #include @@ -166,7 +165,6 @@ mtk_spi_detach(device_t dev) static void mtk_spi_chip_activate(struct mtk_spi_softc *sc) { -//printf("%s\n", __func__); mtk_spi_wait(sc); /* * Put all CSx to low @@ -177,7 +175,6 @@ mtk_spi_chip_activate(struct mtk_spi_sof static void mtk_spi_chip_deactivate(struct mtk_spi_softc *sc) { -//printf("%s\n", __func__); mtk_spi_wait(sc); /* * Put all CSx to high @@ -212,14 +209,12 @@ mtk_spi_txrx(struct mtk_spi_softc *sc, u if (write == MTK_SPI_WRITE) { SPI_WRITE(sc, MTK_SPIDATA, *data); SPI_SET_BITS(sc, MTK_SPICTL, START_WRITE); - //printf("%s(W:%d)\n", __func__, *data); } else {/* MTK_SPI_READ */ SPI_SET_BITS(sc, MTK_SPICTL, START_READ); if (mtk_spi_wait(sc)) return (EBUSY); *data = SPI_READ(sc, MTK_SPIDATA) & 0xff; - //printf("%s(R:%d)\n", __func__, *data); } return (0); } Modified: head/sys/mips/mediatek/mtk_spi_v2.c == --- head/sys/mips/mediatek/mtk_spi_v2.c Fri May 6 05:22:25 2016 (r299154) +++ head/sys/mips/mediatek/mtk_spi_v2.c Fri May 6 05:24:10 2016 (r299155) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include -//#include #include #include @@ -157,8 +156,6 @@ mtk_spi_detach(device_t dev) { struct mtk_spi_softc *sc = device_get_softc(dev); - //SPI_SET_BITS(sc, MTK_SPICTL, HIZSMOSI | CS_HIGH); - if (sc->sc_mem_res) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); @@ -168,7 +165,6 @@ mtk_spi_detach(device_t dev) static void mtk_spi_chip_activate(struct mtk_spi_softc *sc) { -//printf("%s\n", __func__); mtk_spi_wait(sc); /* * Put all CSx to low @@ -179,7 +175,6 @@ mtk_spi_chip_activate(struct mtk_spi_sof static void mtk_spi_chip_deactivate(struct mtk_spi_softc *sc) { -//printf("%s\n", __func__); mtk_spi_wait(sc); /* * Put all CSx to high @@ -197,7 +192,6 @@ mtk_spi_wait(struct mtk_spi_softc *sc) break; } if (i == 0) { - //printf("busy\n"); return (1); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r299156 - stable/10/sbin/dhclient
Author: sephe Date: Fri May 6 05:44:12 2016 New Revision: 299156 URL: https://svnweb.freebsd.org/changeset/base/299156 Log: MFC r298385 dhclient: Log a warning instead of bailing upon "illegal" options In Azure, the DHCP servers add private option (id 0xf5), which contains binary form of an IPv4 address. Once this option is converted to string form, it could contain '$', e.g. IPv4 address: 100.72.36.54 binary form: 0x64 0x48 0x24 0x36 string form: "dH$6" dhclient bails upon "illegal" options like the above example, thus the VM bring-up will fail. Also as a side note, this "illegal" option detection was added in OpenBSD ~11years ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.50&content-type=text/x-cvsweb-markup And it was removed along with the removal of script support in OpenBSD ~3years ago: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhclient/dhclient.c?rev=1.159&content-type=text/x-cvsweb-markup Reported by: Hongxiong Xian Reviewed by: jhb, Dexuan Cui Tested by:Hongxiong Xian Analyzed by: Dong Liu Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D5853 Modified: stable/10/sbin/dhclient/dhclient.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/dhclient.c == --- stable/10/sbin/dhclient/dhclient.c Fri May 6 05:24:10 2016 (r299155) +++ stable/10/sbin/dhclient/dhclient.c Fri May 6 05:44:12 2016 (r299156) @@ -2277,6 +2277,17 @@ script_set_env(struct client_state *clie { int i, j, namelen; + /* No `` or $() command substitution allowed in environment values! */ + for (j=0; j < strlen(value); j++) + switch (value[j]) { + case '`': + case '$': + warning("illegal character (%c) in value '%s'", + value[j], value); + /* Ignore this option */ + return; + } + namelen = strlen(name); for (i = 0; client->scriptEnv[i]; i++) @@ -2313,16 +2324,6 @@ script_set_env(struct client_state *clie strlen(value) + 1); if (client->scriptEnv[i] == NULL) error("script_set_env: no memory for variable assignment"); - - /* No `` or $() command substitution allowed in environment values! */ - for (j=0; j < strlen(value); j++) - switch (value[j]) { - case '`': - case '$': - error("illegal character (%c) in value '%s'", value[j], - value); - /* not reached */ - } snprintf(client->scriptEnv[i], strlen(prefix) + strlen(name) + 1 + strlen(value) + 1, "%s%s=%s", prefix, name, value); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"