Re: svn commit: r264177 - in head/sys/dev/hyperv: netvsc storvsc
On Sat, 5 Apr 2014, Warner Losh wrote: Log: Make some unwise casts. On i386 these casts wind up being safe. Rather than disturb the API, go with these casts to shut gcc up. These casts seem to be correct, while the old ones were just wrong. Now the old ones are still there, but seem to be just style bugs -- they have no effect except to bloat the code and give some collateral style bugs (long lines). Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Sat Apr 5 22:28:46 2014 (r264176) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Sat Apr 5 22:42:00 2014 (r264177) @@ -182,7 +182,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct /* Send the gpadl notification request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) { The cast was presumably to pass a pointer to a function expectly a uint64_t. Casting to uint64_t was wrong for this. Pointer to integer casts should only use uintptr_t or intptr_t. After changing to the correct cast, the cast to uint64_t has no effect. Conversion from one integer type to another is done automatically by the prototype. It even works correctly on amd64 and i386, since uintptr_t is no larger than uint64_t. Conversion from pointer to integer is not done automatically by prototypes, even if it would work correctly. I forget it the C standard requires this of if it is just a warning. Probably the former. @@ -280,7 +280,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru /* Send the gpadl notification request */ ret = hv_vmbus_channel_send_packet(device->channel, init_pkt, - sizeof(nvsp_msg), (uint64_t)init_pkt, + sizeof(nvsp_msg), (uint64_t)(uintptr_t)init_pkt, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) { All the changes keep the bogus cast. ... Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Apr 5 22:28:46 2014(r264176) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sat Apr 5 22:42:00 2014(r264177) ... @@ -494,7 +494,7 @@ retry_send: /* Set the completion routine */ packet->compl.send.on_send_completion = netvsc_xmit_completion; packet->compl.send.send_completion_context = packet; - packet->compl.send.send_completion_tid = (uint64_t)m_head; + packet->compl.send.send_completion_tid = (uint64_t)(uintptr_t)m_head; /* Removed critical_enter(), does not appear necessary */ ret = hv_rf_on_send(device_ctx, packet); Here the changes also break the formatting. @@ -682,7 +682,7 @@ netvsc_recv(struct hv_device *device_ctx */ for (i=0; i < packet->page_buf_count; i++) { /* Shift virtual page number to form virtual page address */ - uint8_t *vaddr = (uint8_t *) + uint8_t *vaddr = (uint8_t *)(uintptr_t) (packet->page_buffers[i].pfn << PAGE_SHIFT); hv_m_append(m_new, packet->page_buffers[i].length, This one is a little different, and still broken. Oops, probably all the casts are still broken. This one is just more obviously broken. uintptr_t is only specified to work on pointers of type void *, but here the pointer has type uint8_t *. From C99 (n869.txt draft): %7.18.1.4 Integer types capable of holding object pointers % %[#1] The following type designates a signed integer type %with the property that any valid pointer to void can be %converted to this type, then converted back to pointer to %void, and the result will compare equal to the original %pointer: % %intptr_t % %The following type designates an unsigned integer type with %the property that any valid pointer to void can be converted %to this type, then converted back to pointer to void, and %the result will compare equal to the original pointer: % %uintptr_t So almost all correct uses of uintptr_t need a pre- or post-cast of the pointer to void * (or vice versa), and the code is verbose for another reason. In practice, uintptr_t and intptr_t work for casts of all pointer types, and compilers only warn if there is a size mismatch. The C standard requires just about all casts between pointers and integers to give a result and doesn't require any warnings, but i
Re: svn commit: r264177 - in head/sys/dev/hyperv: netvsc storvsc
On Sat, 5 Apr 2014, Warner Losh wrote: Log: Make some unwise casts. On i386 these casts wind up being safe. Rather than disturb the API, go with these casts to shut gcc up. Another reply. The bug is mostly in clang. It doesn't complain about casting pointers to integers that are neither uintptr_t or intptr_t, even when the cast is to a smaller size, so it doesn't detect the wrong casts being used here. So the bugs build up until they are detected by compiling with gcc (or coverity?). Here the casts are to a larger size. The style bug is still very large, since the casts are used to suppress the warning for conversion from pointer to integer without an explicit cast. Casts to break warnings should be correct. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264190 - head/contrib/compiler-rt/lib
Author: andrew Date: Sun Apr 6 09:14:11 2014 New Revision: 264190 URL: http://svnweb.freebsd.org/changeset/base/264190 Log: Mark __fixdfdi/__aeabi_d2lz with COMPILER_RT_ABI so it uses the correct calling convention for __aeabi_* functions. Modified: head/contrib/compiler-rt/lib/fixdfdi.c Modified: head/contrib/compiler-rt/lib/fixdfdi.c == --- head/contrib/compiler-rt/lib/fixdfdi.c Sun Apr 6 06:18:43 2014 (r264189) +++ head/contrib/compiler-rt/lib/fixdfdi.c Sun Apr 6 09:14:11 2014 (r264190) @@ -25,7 +25,7 @@ ARM_EABI_FNALIAS(d2lz, fixdfdi) -di_int +COMPILER_RT_ABI di_int __fixdfdi(double a) { double_bits fb; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r264042 - in head: include lib/libc/gen lib/libc/include lib/libc/stdlib
Although non-LLVM may just die, I'd like people to please consider what it takes to bring a new CPU architecture/platform up and how, well, that support typically doesn't make it into the public LLVM source straight away. So if we want to be taken seriously by those funny companies that make CPUs, then: * we still need external toolchain support; * .. and that may be LLVM, but it may not be the LLVM that you currently have in HEAD, with the current set of expected features in our LLVM. -a On 4 April 2014 07:17, Jordan Hubbard wrote: > > On Apr 4, 2014, at 7:03 PM, David Chisnall wrote: > >> That said, I think we're increasingly going to be using LLVM for things that >> are beyond just simple AOT compilation, so platforms with no LLVM back end >> are likely to be left behind. > > Amen, and a topic worth an entire discussion in its own right, but I'll spare > us that and leave the topic with just one quick anecdote: When we ported > MacRuby to LLVM, thus creating in effect a ruby JIT compiler, we were pretty > amazed at how quickly the work progressed and how good the performance of the > resulting code was. MacRuby later died for other reasons, but its JIT/AOT > compilation abilities were amazing enough that we were left wondered why the > Python and Perl folks weren't stampeding over themselves to follow suit. > > I think the answer there was that they'd already rolled their own bytecode > systems, as ultimately did Ruby, and had too much invested in those > technologies, but I'm still holding out hope that the "everyone but C/C++" > world of languages will eventually converge on LLVM, as seems to be slowly > happening with projects like Rubinius and Numba. Not relevant to FreeBSD > right now, but who knows the future? > > - Jordan > > > > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264191 - head/sys/cam/ctl
Author: mav Date: Sun Apr 6 10:13:14 2014 New Revision: 264191 URL: http://svnweb.freebsd.org/changeset/base/264191 Log: Report stripe size and offset of the backing device in READ CAPACITY (16) as physical sector size and offset. MFC after:2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl.c == --- head/sys/cam/ctl/ctl.c Sun Apr 6 09:14:11 2014(r264190) +++ head/sys/cam/ctl/ctl.c Sun Apr 6 10:13:14 2014(r264191) @@ -6907,6 +6907,8 @@ ctl_read_capacity_16(struct ctl_scsiio * scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); + data->prot_lbppbe = lun->be_lun->pblockexp & SRC16_LBPPBE; + scsi_ulto2b(lun->be_lun->pblockoff & SRC16_LALBA_A, data->lalba_lbp); ctsio->scsi_status = SCSI_STATUS_OK; Modified: head/sys/cam/ctl/ctl_backend.h == --- head/sys/cam/ctl/ctl_backend.h Sun Apr 6 09:14:11 2014 (r264190) +++ head/sys/cam/ctl/ctl_backend.h Sun Apr 6 10:13:14 2014 (r264191) @@ -137,6 +137,10 @@ typedef void (*be_lun_config_t)(void *be * this should be 512. In theory CTL should be able to handle other block * sizes. Host application software may not deal with it very well, though. * + * pblockexp is the log2() of number of LBAs on the LUN per physical sector. + * + * pblockoff is the lowest LBA on the LUN aligned ot physical sector. + * * req_lun_id is the requested LUN ID. CTL only pays attention to this * field if the CTL_LUN_FLAG_ID_REQ flag is set. If the requested LUN ID is * not available, the LUN addition will fail. If a particular LUN ID isn't @@ -185,6 +189,8 @@ struct ctl_be_lun { void*be_lun;/* passed to CTL */ uint64_tmaxlba; /* passed to CTL */ uint32_tblocksize; /* passed to CTL */ + uint16_tpblockexp; /* passed to CTL */ + uint16_tpblockoff; /* passed to CTL */ uint32_treq_lun_id; /* passed to CTL */ uint32_tlun_id; /* returned from CTL */ uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ Modified: head/sys/cam/ctl/ctl_backend_block.c == --- head/sys/cam/ctl/ctl_backend_block.cSun Apr 6 09:14:11 2014 (r264190) +++ head/sys/cam/ctl/ctl_backend_block.cSun Apr 6 10:13:14 2014 (r264191) @@ -156,6 +156,8 @@ struct ctl_be_block_lun { uint64_t size_bytes; uint32_t blocksize; int blocksize_shift; + uint16_t pblockexp; + uint16_t pblockoff; struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; @@ -1262,6 +1264,7 @@ ctl_be_block_open_dev(struct ctl_be_bloc struct cdev *dev; struct cdevsw*devsw; int error; + off_t ps, pss, po, pos; params = &req->reqdata.create; @@ -1359,6 +1362,24 @@ ctl_be_block_open_dev(struct ctl_be_bloc be_lun->size_bytes = params->lun_size_bytes; } + error = devsw->d_ioctl(dev, DIOCGSTRIPESIZE, + (caddr_t)&ps, FREAD, curthread); + if (error) + ps = po = 0; + else { + error = devsw->d_ioctl(dev, DIOCGSTRIPEOFFSET, + (caddr_t)&po, FREAD, curthread); + if (error) + po = 0; + } + pss = ps / be_lun->blocksize; + pos = po / be_lun->blocksize; + if ((pss > 0) && (pss * be_lun->blocksize == ps) && (pss >= pos) && + ((pss & (pss - 1)) == 0) && (pos * be_lun->blocksize == po)) { + be_lun->pblockexp = fls(pss) - 1; + be_lun->pblockoff = (pss - pos) % pss; + } + return (0); } @@ -1583,6 +1604,8 @@ ctl_be_block_create(struct ctl_be_block_ * For processor devices, we don't have any size. */ be_lun->blocksize = 0; + be_lun->pblockexp = 0; + be_lun->pblockoff = 0; be_lun->size_blocks = 0; be_lun->size_bytes = 0; be_lun->ctl_be_lun.maxlba = 0; @@ -1643,6 +1666,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.blocksize = be_lun->blocksize; + be_lun->ctl_be_lun.pblockexp = be
Compiler toolchain roadmap
On Apr 6, 2014, at 2:34 PM, Adrian Chadd wrote: > So if we want to be taken seriously by those funny companies that make CPUs, > then: Not really religious about that at all, I just wonder the following: 1. How long will it be considered worthwhile to not be able to have various advanced features in base (like blocks, or someday perhaps, more advanced C++ features / GC / yada yada yada) because the lowest common denominator compiler technology, probably not even under control of the project itself (those “weird-ass compiler ports” David mentioned), simply doesn’t support those things? Moreover, there’s not much incentive for the companies in question to modernize their toolchains if FreeBSD is happy to remain somewhere in the 1990s in terms of what compiler features it leverages, and it’s not particularly clear to me how the presence / participation (?) of those companies is being valued in the overall scheme of things. If one lone MIPS R3000 vendor was holding back because it was using the Mongoose-V radiation-hardened part (yeah, that’s a real thing) and FreeBSD for some solution, would that be worth holding the entire project back? No? How about two such vendors? Three? Where do you draw the line? I don’t even pretend to have the answer to that question, I just think it’s a question worth asking. Also, JFYI, I don’t really have any strong personal agenda where this is concerned - I can just keep taking FreeBSD and hacking it up every which way such that “what’s in base” becomes increasingly irrelevant to me, but the more I diverge, the less easy it becomes to upstream stuff back. I already had that experience once at Apple, and it ultimately didn’t hold me back at all so the “omg the cost of forking” argument is no longer one that holds much fear for me, but it’s a shame that all the I18N / UNIX03 / numerics optimization / … work that occurred in the open over the first 3-5 years I was there was never able to benefit FreeBSD because of said divergence, either. 2. What’s the long-term prognosis on a multi-architecture ecosystem? I certainly remember the “good old days” when any company that knew how to solder two transistors together had their own CPU architecture, but those folks have been dying off for decades now. Now we have Intel as the long-dominant 900 pound gorilla, which is why FreeBSD originally chose to focus almost exclusively on that architecture (and I think that was a smart decision), and the smaller but still feisty ARM architecture. That’s about it. Yes, I know about the others, but just because a port *can* be done doesn’t necessarily mean it *should* be, and I’ll cite the Alpha and Itanium ports as existence proofs of that. Heck, I was a huge proponent of the Alpha port - I wanted a 64 bit version of FreeBSD back then so badly I could taste it, and I personally thought the Alpha was pretty damn cool - I even had one of my own. Didn’t make it such a good idea in hindsight, however. Again, if there’s a common theme in my two bullets there, it’s “show me the numbers!” Sure, I know of vendors who use MIPS and, for that matter, PowerPC and a few other far more obscure architectures as well. I’m familiar with Juniper and Cisco’s interest. I even read Warner’s slides from BSDCan 2008, where a fairly long and slightly sordid tale is told of MIPS support trying repeatedly to get into the tree, being repeatedly rebuffed until it finally somehow took root through a semi-cabalistic effort with dark rituals involving dead chickens and Perforce. Now it’s 2014 and apparently we can’t have nice things in the tree because of MIPS? Maybe I’m over-simplifying the argument, but even simplistically I would easily understand it if you substituted “ARM” or “Intel” because I can count those numbers easily and know without even trying that there are at least 7 zeros involved in the total. Every PC ever shipped. Every Samsung phone. Big and impressive numbers that can’t be argued with. I’m just not getting the same impression from the other architectures under discussion here. - Jordan ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264193 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mav Date: Sun Apr 6 16:31:28 2014 New Revision: 264193 URL: http://svnweb.freebsd.org/changeset/base/264193 Log: In addition to r264077, tell GEOM that we do support BIO_DELETE now. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Apr 6 10:56:27 2014(r264192) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Sun Apr 6 16:31:28 2014(r264193) @@ -2440,6 +2440,9 @@ zvol_geom_start(struct bio *bp) zvol_strategy(bp); break; case BIO_GETATTR: + if (g_handleattr_int(bp, "GEOM::candelete", 1)) + return; + /* FALLTHROUGH */ default: g_io_deliver(bp, EOPNOTSUPP); break; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264194 - head/usr.sbin/daemon
Author: jh Date: Sun Apr 6 16:35:49 2014 New Revision: 264194 URL: http://svnweb.freebsd.org/changeset/base/264194 Log: Fork a child process and wait until the process terminates when the -P option is specified. This behavior is documented on the manual page. PR: bin/187265 Submitted by: Kimo R MFC after:2 weeks Modified: head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.c == --- head/usr.sbin/daemon/daemon.c Sun Apr 6 16:31:28 2014 (r264193) +++ head/usr.sbin/daemon/daemon.c Sun Apr 6 16:35:49 2014 (r264194) @@ -139,7 +139,7 @@ main(int argc, char *argv[]) * get SIGCHLD eventually. */ pid = -1; - if (pidfile != NULL || restart) { + if (pidfile != NULL || ppidfile != NULL || restart) { /* * Restore default action for SIGTERM in case the * parent process decided to ignore it. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r264179 - in head/sys/amd64/vmm: . intel io
Make the vmm code compile with gcc too. Not entirely sure things are correct for the pirbase test Then why not contact the authors/maintainers of this code ? We'll take it from here and will revert/rework this change, as well as making sure it compiles with gcc and also testing it, which for some reason you seem to think you are immune from. Not happy, Peter. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264195 - head
Author: grehan Date: Sun Apr 6 16:48:00 2014 New Revision: 264195 URL: http://svnweb.freebsd.org/changeset/base/264195 Log: This should have been obvious, but make it so. Modified: head/MAINTAINERS Modified: head/MAINTAINERS == --- head/MAINTAINERSSun Apr 6 16:35:49 2014(r264194) +++ head/MAINTAINERSSun Apr 6 16:48:00 2014(r264195) @@ -132,3 +132,4 @@ nvmecontrol(8) jimharris Pre-commit revi release/release.sh gjb Pre-commit review and regression tests requested. nanobsdimp Pre-commit review requested for coordination. +vmm(4) neel,grehan Pre-commit review requested. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r264179 - in head/sys/amd64/vmm: . intel io
>>Make the vmm code compile with gcc too. Not entirely sure things are correct for the pirbase test Warner has contacted me privately; we have a way forward and I now consider the issue closed. later, Peter. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264196 - head/lib/libc/rpc
Author: theraven Date: Sun Apr 6 17:06:27 2014 New Revision: 264196 URL: http://svnweb.freebsd.org/changeset/base/264196 Log: Move definitions out of rpc_com so that the linker doesn't complain about multiple definitions. Reported by: sbruno Modified: head/lib/libc/rpc/rpc_com.h head/lib/libc/rpc/svc.c Modified: head/lib/libc/rpc/rpc_com.h == --- head/lib/libc/rpc/rpc_com.h Sun Apr 6 16:48:00 2014(r264195) +++ head/lib/libc/rpc/rpc_com.h Sun Apr 6 17:06:27 2014(r264196) @@ -86,8 +86,8 @@ bool_t __xdrrec_setnonblock(XDR *, int); bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t); void __xprt_unregister_unlocked(SVCXPRT *); -SVCXPRT **__svc_xports; -int __svc_maxrec; +extern SVCXPRT **__svc_xports; +extern int __svc_maxrec; __END_DECLS Modified: head/lib/libc/rpc/svc.c == --- head/lib/libc/rpc/svc.c Sun Apr 6 16:48:00 2014(r264195) +++ head/lib/libc/rpc/svc.c Sun Apr 6 17:06:27 2014(r264196) @@ -84,6 +84,9 @@ static struct svc_callout { void(*sc_dispatch)(struct svc_req *, SVCXPRT *); } *svc_head; +SVCXPRT **__svc_xports; +int __svc_maxrec; + static struct svc_callout *svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *); static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264197 - head/sys/arm/ti
Author: loos Date: Sun Apr 6 17:09:51 2014 New Revision: 264197 URL: http://svnweb.freebsd.org/changeset/base/264197 Log: Partially revert r264083. While it is the recommended initialization procedure, it hangs on the reset of the second GPIO module on pandaboard. Removes the module reset for now as more investigation would be needed. Reported by: jceel Modified: head/sys/arm/ti/ti_gpio.c Modified: head/sys/arm/ti/ti_gpio.c == --- head/sys/arm/ti/ti_gpio.c Sun Apr 6 17:06:27 2014(r264196) +++ head/sys/arm/ti/ti_gpio.c Sun Apr 6 17:09:51 2014(r264197) @@ -69,9 +69,6 @@ __FBSDID("$FreeBSD$"); /* Register definitions */ #defineTI_GPIO_REVISION0x #defineTI_GPIO_SYSCONFIG 0x0010 -#defineTI_GPIO_SYSCONFIG_SOFTRESET (1 << 1) -#defineTI_GPIO_SYSCONFIG_AUTOIDLE (1 << 0) -#defineTI_GPIO_SYSSTATUS_RESETDONE (1 << 0) #if defined(SOC_OMAP3) #defineTI_GPIO_SYSSTATUS 0x0014 #defineTI_GPIO_IRQSTATUS1 0x0018 @@ -715,7 +712,7 @@ ti_gpio_detach_intr(device_t dev) static int ti_gpio_bank_init(device_t dev, int bank) { - int pin, timeout; + int pin; struct ti_gpio_softc *sc; uint32_t flags, reg_oe; @@ -724,16 +721,6 @@ ti_gpio_bank_init(device_t dev, int bank /* Enable the interface and functional clocks for the module. */ ti_prcm_clk_enable(GPIO0_CLK + FIRST_GPIO_BANK + bank); - /* Reset the GPIO module. */ - timeout = 0; - ti_gpio_write_4(sc, bank, TI_GPIO_SYSCONFIG, TI_GPIO_SYSCONFIG_SOFTRESET); - while ((ti_gpio_read_4(sc, bank, TI_GPIO_SYSSTATUS) & - TI_GPIO_SYSSTATUS_RESETDONE) == 0) { - if (timeout++ > 100) - return (EBUSY); - DELAY(100); - } - /* * Read the revision number of the module. TI don't publish the * actual revision numbers, so instead the values have been @@ -821,7 +808,7 @@ ti_gpio_attach(device_t dev) */ for (i = 0; i < MAX_GPIO_BANKS; i++) { if (sc->sc_mem_res[i] != NULL) { - /* Reset and initialize the GPIO module. */ + /* Initialize the GPIO module. */ err = ti_gpio_bank_init(dev, i); if (err != 0) { ti_gpio_detach_intr(dev); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264199 - head/sys/boot/ficl
Author: imp Date: Sun Apr 6 19:51:57 2014 New Revision: 264199 URL: http://svnweb.freebsd.org/changeset/base/264199 Log: Fix the mips64el build: mips64el should use the mips64 directory, not the mips64el directory. Modified: head/sys/boot/ficl/Makefile Modified: head/sys/boot/ficl/Makefile == --- head/sys/boot/ficl/Makefile Sun Apr 6 19:19:25 2014(r264198) +++ head/sys/boot/ficl/Makefile Sun Apr 6 19:51:57 2014(r264199) @@ -6,7 +6,7 @@ FICLDIR?= ${.CURDIR} .if defined(FICL32) .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} .elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" -.PATH: ${FICLDIR}/${MACHINE_ARCH} +.PATH: ${FICLDIR}/mips64 .else .PATH: ${FICLDIR}/${MACHINE_CPUARCH} .endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264200 - head/sys/kern
Author: ed Date: Sun Apr 6 20:00:42 2014 New Revision: 264200 URL: http://svnweb.freebsd.org/changeset/base/264200 Log: Nit: fix locking of p->p_state in procdesc_close(). According to , this field needs to be locked with either the p_mtx or the p_slock. In this case the damage was quite small. Instead of being reaped, the process would just be reparented to init, so it could be reaped from there. Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c == --- head/sys/kern/sys_procdesc.cSun Apr 6 19:51:57 2014 (r264199) +++ head/sys/kern/sys_procdesc.cSun Apr 6 20:00:42 2014 (r264200) @@ -364,39 +364,41 @@ procdesc_close(struct file *fp, struct t * collected and procdesc_reap() was already called. */ sx_xunlock(&proctree_lock); - } else if (p->p_state == PRS_ZOMBIE) { - /* -* If the process is already dead and just awaiting reaping, -* do that now. This will release the process's reference to -* the process descriptor when it calls back into -* procdesc_reap(). -*/ - PROC_LOCK(p); - PROC_SLOCK(p); - proc_reap(curthread, p, NULL, 0); } else { - /* -* If the process is not yet dead, we need to kill it, but we -* can't wait around synchronously for it to go away, as that -* path leads to madness (and deadlocks). First, detach the -* process from its descriptor so that its exit status will -* be reported normally. -*/ PROC_LOCK(p); - pd->pd_proc = NULL; - p->p_procdesc = NULL; - procdesc_free(pd); - - /* -* Next, reparent it to init(8) so that there's someone to -* pick up the pieces; finally, terminate with prejudice. -*/ - p->p_sigparent = SIGCHLD; - proc_reparent(p, initproc); - if ((pd->pd_flags & PDF_DAEMON) == 0) - kern_psignal(p, SIGKILL); - PROC_UNLOCK(p); - sx_xunlock(&proctree_lock); + if (p->p_state == PRS_ZOMBIE) { + /* +* If the process is already dead and just awaiting +* reaping, do that now. This will release the +* process's reference to the process descriptor when it +* calls back into procdesc_reap(). +*/ + PROC_SLOCK(p); + proc_reap(curthread, p, NULL, 0); + } else { + /* +* If the process is not yet dead, we need to kill it, +* but we can't wait around synchronously for it to go +* away, as that path leads to madness (and deadlocks). +* First, detach the process from its descriptor so that +* its exit status will be reported normally. +*/ + pd->pd_proc = NULL; + p->p_procdesc = NULL; + procdesc_free(pd); + + /* +* Next, reparent it to init(8) so that there's someone +* to pick up the pieces; finally, terminate with +* prejudice. +*/ + p->p_sigparent = SIGCHLD; + proc_reparent(p, initproc); + if ((pd->pd_flags & PDF_DAEMON) == 0) + kern_psignal(p, SIGKILL); + PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); + } } /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264201 - head/usr.bin/find
Author: jilles Date: Sun Apr 6 20:04:33 2014 New Revision: 264201 URL: http://svnweb.freebsd.org/changeset/base/264201 Log: find: Treat errno from fts_read() more carefully. fts_read() leaves errno unchanged on EOF and sets it on error, so set errno to 0 before calling it. Also, don't trust finish_execplus() to leave errno unchanged. Modified: head/usr.bin/find/find.c Modified: head/usr.bin/find/find.c == --- head/usr.bin/find/find.cSun Apr 6 20:00:42 2014(r264200) +++ head/usr.bin/find/find.cSun Apr 6 20:04:33 2014(r264201) @@ -175,13 +175,13 @@ find_execute(PLAN *plan, char *paths[]) { FTSENT *entry; PLAN *p; - int rval; + int e, rval; tree = fts_open(paths, ftsoptions, (issort ? find_compare : NULL)); if (tree == NULL) err(1, "ftsopen"); - for (rval = 0; (entry = fts_read(tree)) != NULL;) { + for (rval = 0; errno = 0, (entry = fts_read(tree)) != NULL;) { if (maxdepth != -1 && entry->fts_level >= maxdepth) { if (fts_set(tree, entry, FTS_SKIP)) err(1, "%s", entry->fts_path); @@ -231,8 +231,9 @@ find_execute(PLAN *plan, char *paths[]) */ for (p = plan; p && (p->execute)(p, entry); p = p->next); } + e = errno; finish_execplus(); - if (errno && (!ignore_readdir_race || errno != ENOENT)) - err(1, "fts_read"); + if (e && (!ignore_readdir_race || e != ENOENT)) + errc(1, e, "fts_read"); return (rval); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264202 - head/sys/kern
Author: ed Date: Sun Apr 6 20:20:07 2014 New Revision: 264202 URL: http://svnweb.freebsd.org/changeset/base/264202 Log: Fix a typo. The function name is pdfork; not pfork. Modified: head/sys/kern/sys_procdesc.c Modified: head/sys/kern/sys_procdesc.c == --- head/sys/kern/sys_procdesc.cSun Apr 6 20:04:33 2014 (r264201) +++ head/sys/kern/sys_procdesc.cSun Apr 6 20:20:07 2014 (r264202) @@ -55,7 +55,7 @@ * * - How to handle ptrace(2)? * - Will we want to add a pidtoprocdesc(2) system call to allow process - * descriptors to be created for processes without pfork(2)? + * descriptors to be created for processes without pdfork(2)? */ #include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264203 - head/sys/arm/include
Author: ian Date: Sun Apr 6 21:40:39 2014 New Revision: 264203 URL: http://svnweb.freebsd.org/changeset/base/264203 Log: Tell VM we now have ARM platforms with physically discontiguous memory. Modified: head/sys/arm/include/vmparam.h Modified: head/sys/arm/include/vmparam.h == --- head/sys/arm/include/vmparam.h Sun Apr 6 20:20:07 2014 (r264202) +++ head/sys/arm/include/vmparam.h Sun Apr 6 21:40:39 2014 (r264203) @@ -77,9 +77,9 @@ #defineVM_PHYSSEG_MAX 32 /* - * The physical address space is densely populated. + * The physical address space may be sparsely populated on some ARM systems. */ -#defineVM_PHYSSEG_DENSE +#defineVM_PHYSSEG_SPARSE /* * Create two free page pools. Since the ARM kernel virtual address ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264204 - head/sys/boot/fdt/dts/arm
Author: ian Date: Sun Apr 6 21:45:38 2014 New Revision: 264204 URL: http://svnweb.freebsd.org/changeset/base/264204 Log: Define the full 1024M of ram on the imx53 QSB board. Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts Modified: head/sys/boot/fdt/dts/arm/imx53-qsb.dts == --- head/sys/boot/fdt/dts/arm/imx53-qsb.dts Sun Apr 6 21:40:39 2014 (r264203) +++ head/sys/boot/fdt/dts/arm/imx53-qsb.dts Sun Apr 6 21:45:38 2014 (r264204) @@ -41,8 +41,9 @@ compatible = "fsl,imx53-qsb", "fsl,imx53"; memory { - /* RAM 512M */ - reg = <0x7000 0x2000>; + /* RAM is 2 banks of 512M each. */ + reg = <0x7000 0x2000 + 0xb000 0x2000>; }; localbus@1800 { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264205 - head/sys/powerpc/powermac
Author: jhibbits Date: Sun Apr 6 21:48:45 2014 New Revision: 264205 URL: http://svnweb.freebsd.org/changeset/base/264205 Log: Fix the ATI backlight driver off/on handling. Now this driver works correctly with the ATI Radeon 9700 in the PowerBook G4 1.67GHz. Code shamelessly taken in spirit from the radeonkms driver, which I hope will make this driver redundant in the future. MFC after:2 weeks Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c == --- head/sys/powerpc/powermac/atibl.c Sun Apr 6 21:45:38 2014 (r264204) +++ head/sys/powerpc/powermac/atibl.c Sun Apr 6 21:48:45 2014 (r264205) @@ -57,6 +57,12 @@ __FBSDID("$FreeBSD$"); #define RADEON_LVDS_PLL_RESET(1 << 17) #define RADEON_PIXCLKS_CNTL 0x002d #define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) +#define RADEON_DISP_PWR_MAN 0x0d08 +#define RADEON_AUTO_PWRUP_EN (1 << 26) +#define RADEON_CLOCK_CNTL_DATA 0x000c +#define RADEON_CLOCK_CNTL_INDEX 0x0008 +#define RADEON_PLL_WR_EN (1 << 7) +#define RADEON_CRTC_GEN_CNTL 0x0050 struct atibl_softc { struct resource *sc_memr; @@ -151,12 +157,56 @@ atibl_attach(device_t dev) return (0); } +static uint32_t __inline +atibl_pll_rreg(struct atibl_softc *sc, uint32_t reg) +{ + uint32_t data, save, tmp; + + bus_write_1(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, + ((reg & 0x3f) | RADEON_PLL_WR_EN)); + (void)bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + (void)bus_read_4(sc->sc_memr, RADEON_CRTC_GEN_CNTL); + + data = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + + /* Only necessary on R300, bt won't hurt others. */ + save = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX); + tmp = save & (~0x3f | RADEON_PLL_WR_EN); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, tmp); + tmp = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, save); + + return data; +} + +static void __inline +atibl_pll_wreg(struct atibl_softc *sc, uint32_t reg, uint32_t val) +{ + uint32_t save, tmp; + + bus_write_1(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, + ((reg & 0x3f) | RADEON_PLL_WR_EN)); + (void)bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + (void)bus_read_4(sc->sc_memr, RADEON_CRTC_GEN_CNTL); + + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA, val); + DELAY(5000); + + /* Only necessary on R300, bt won't hurt others. */ + save = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX); + tmp = save & (~0x3f | RADEON_PLL_WR_EN); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, tmp); + tmp = bus_read_4(sc->sc_memr, RADEON_CLOCK_CNTL_DATA); + bus_write_4(sc->sc_memr, RADEON_CLOCK_CNTL_INDEX, save); +} + static int atibl_setlevel(struct atibl_softc *sc, int newlevel) { uint32_t lvds_gen_cntl; uint32_t lvds_pll_cntl; uint32_t pixclks_cntl; + uint32_t disp_pwr_reg; if (newlevel > 100) newlevel = 100; @@ -168,11 +218,15 @@ atibl_setlevel(struct atibl_softc *sc, i if (newlevel > 0) { newlevel = (newlevel * 5) / 2 + 5; + disp_pwr_reg = bus_read_4(sc->sc_memr, RADEON_DISP_PWR_MAN); + disp_pwr_reg |= RADEON_AUTO_PWRUP_EN; + bus_write_4(sc->sc_memr, RADEON_DISP_PWR_MAN, disp_pwr_reg); lvds_pll_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL); lvds_pll_cntl |= RADEON_LVDS_PLL_EN; bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); lvds_pll_cntl &= ~RADEON_LVDS_PLL_RESET; bus_write_4(sc->sc_memr, RADEON_LVDS_PLL_CNTL, lvds_pll_cntl); + DELAY(1000); lvds_gen_cntl &= ~(RADEON_LVDS_DISPLAY_DIS | RADEON_LVDS_BL_MOD_LEVEL_MASK); @@ -181,20 +235,21 @@ atibl_setlevel(struct atibl_softc *sc, i lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & RADEON_LVDS_BL_MOD_LEVEL_MASK; lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; - DELAY(2000); + DELAY(200); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); } else { - pixclks_cntl = bus_read_4(sc->sc_memr, RADEON_PIXCLKS_CNTL); - bus_write_4(sc->sc_memr, RADEON_PIXCLKS_CNTL, + pixclks_cntl = atibl_pll_rreg(sc, RADEON_PIXCLKS_CNTL); + atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl & ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; - lvds_gen_cntl &= RADEON_LVDS_BL_MOD_EN; + lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_EN;
svn commit: r264206 - head/sys/boot/fdt/dts/arm
Author: rpaulo Date: Sun Apr 6 23:22:42 2014 New Revision: 264206 URL: http://svnweb.freebsd.org/changeset/base/264206 Log: Fix the memory region. This board has two memory regions. Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Modified: head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts == --- head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sun Apr 6 21:48:45 2014 (r264205) +++ head/sys/boot/fdt/dts/arm/digi-ccwmx53.dts Sun Apr 6 23:22:42 2014 (r264206) @@ -41,7 +41,8 @@ memory { /* RAM 512M */ - reg = <0x7000 0x2000>; + reg = <0x7000 0x1000 + 0xB000 0x1000>; }; localbus@1800 { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264207 - head/sys/powerpc/powermac
Author: jhibbits Date: Sun Apr 6 23:57:19 2014 New Revision: 264207 URL: http://svnweb.freebsd.org/changeset/base/264207 Log: Clear the backlight level when it's turned off. Also, reduce the delay times to less conservative values, also found in the radeonkms driver. MFC after:2 weeks X-MFC-with: r264205 Modified: head/sys/powerpc/powermac/atibl.c Modified: head/sys/powerpc/powermac/atibl.c == --- head/sys/powerpc/powermac/atibl.c Sun Apr 6 23:22:42 2014 (r264206) +++ head/sys/powerpc/powermac/atibl.c Sun Apr 6 23:57:19 2014 (r264207) @@ -235,21 +235,21 @@ atibl_setlevel(struct atibl_softc *sc, i lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & RADEON_LVDS_BL_MOD_LEVEL_MASK; lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; - DELAY(200); + DELAY(20); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); } else { pixclks_cntl = atibl_pll_rreg(sc, RADEON_PIXCLKS_CNTL); atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl & ~RADEON_PIXCLK_LVDS_ALWAYS_ONb); lvds_gen_cntl |= RADEON_LVDS_DISPLAY_DIS; - lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_EN; + lvds_gen_cntl &= ~(RADEON_LVDS_BL_MOD_EN | RADEON_LVDS_BL_MOD_LEVEL_MASK); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); lvds_gen_cntl &= ~(RADEON_LVDS_ON | RADEON_LVDS_EN); - DELAY(200); + DELAY(20); bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); atibl_pll_wreg(sc, RADEON_PIXCLKS_CNTL, pixclks_cntl); - DELAY(200); + DELAY(20); } return (0); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264208 - head/sys/boot/amd64
Author: emaste Date: Mon Apr 7 00:49:15 2014 New Revision: 264208 URL: http://svnweb.freebsd.org/changeset/base/264208 Log: Do not build the amd64 UEFI loader with GCC The UEFI loader causes buildworld to fail when building with (in-tree) GCC, due to a typedef redefinition. As it happens the in-tree GCC cannot successfully build the UEFI loader anyhow, as it does not support __attribute__((ms_abi)). Thus, just avoid trying to build it with GCC, rather than disconnecting it from the build until the underlying issue is fixed. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/amd64/Makefile Modified: head/sys/boot/amd64/Makefile == --- head/sys/boot/amd64/MakefileSun Apr 6 23:57:19 2014 (r264207) +++ head/sys/boot/amd64/MakefileMon Apr 7 00:49:15 2014 (r264208) @@ -2,6 +2,10 @@ .include +# In-tree GCC does not support __attribute__((ms_abi)), required by the +# UEFI loader. +.if ${COMPILER_TYPE} != "gcc" SUBDIR=efi +.endif .include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264209 - head/usr.bin/units
Author: eadler Date: Mon Apr 7 01:46:30 2014 New Revision: 264209 URL: http://svnweb.freebsd.org/changeset/base/264209 Log: units(1): Add some some additional units Most of these are also recognized by GNU units Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib == --- head/usr.bin/units/units.libMon Apr 7 00:49:15 2014 (r264208) +++ head/usr.bin/units/units.libMon Apr 7 01:46:30 2014 (r264209) @@ -39,8 +39,13 @@ zopto- 1e-21 zepto- zopto yocto- 1e-24 +quarter- 1|4 semi- .5 demi- .5 +hemi- .5 +half- .5 +double-2 +tripple- 3 Y- yotta Z- zetta @@ -55,6 +60,7 @@ da- deka d- deci c- centi m- milli +u- micro n- nano p- pico f- femto ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264211 - head/usr.bin/units
Author: eadler Date: Mon Apr 7 01:52:35 2014 New Revision: 264211 URL: http://svnweb.freebsd.org/changeset/base/264211 Log: units(1): fix spelling Pointyhat to: me Modified: head/usr.bin/units/units.lib Modified: head/usr.bin/units/units.lib == --- head/usr.bin/units/units.libMon Apr 7 01:49:30 2014 (r264210) +++ head/usr.bin/units/units.libMon Apr 7 01:52:35 2014 (r264211) @@ -45,7 +45,7 @@ demi- .5 hemi- .5 half- .5 double-2 -tripple- 3 +triple-3 Y- yotta Z- zetta ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264212 - in head: lib/libc/net sys/netinet sys/netinet6 sys/sys
Author: kevlo Date: Mon Apr 7 01:53:03 2014 New Revision: 264212 URL: http://svnweb.freebsd.org/changeset/base/264212 Log: Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. Tested with vlc and a test suite [1]. [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz Reviewed by: jhb, glebius, adrian Added: head/sys/netinet/udplite.h (contents, props changed) Modified: head/lib/libc/net/getaddrinfo.c head/sys/netinet/in.c head/sys/netinet/in.h head/sys/netinet/in_pcb.c head/sys/netinet/in_proto.c head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_proto.c head/sys/netinet6/udp6_usrreq.c head/sys/netinet6/udp6_var.h head/sys/sys/param.h Modified: head/lib/libc/net/getaddrinfo.c == --- head/lib/libc/net/getaddrinfo.c Mon Apr 7 01:52:35 2014 (r264211) +++ head/lib/libc/net/getaddrinfo.c Mon Apr 7 01:53:03 2014 (r264212) @@ -170,12 +170,14 @@ static const struct explore explore[] = { PF_INET6, SOCK_STREAM, IPPROTO_TCP, 0x07 }, { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET6, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, { PF_INET6, SOCK_RAW, ANY, 0x05 }, #endif { PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_TCP, 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_SCTP, 0x03 }, { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, 0x07 }, + { PF_INET, SOCK_DGRAM, IPPROTO_UDPLITE, 0x03 }, { PF_INET, SOCK_RAW, ANY, 0x05 }, { -1, 0, 0, 0 }, }; @@ -1477,6 +1479,9 @@ get_port(struct addrinfo *ai, const char case IPPROTO_SCTP: proto = "sctp"; break; + case IPPROTO_UDPLITE: + proto = "udplite"; + break; default: proto = NULL; break; Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Mon Apr 7 01:52:35 2014(r264211) +++ head/sys/netinet/in.c Mon Apr 7 01:53:03 2014(r264212) @@ -859,6 +859,7 @@ in_ifdetach(struct ifnet *ifp) in_pcbpurgeif0(&V_ripcbinfo, ifp); in_pcbpurgeif0(&V_udbinfo, ifp); + in_pcbpurgeif0(&V_ulitecbinfo, ifp); in_purgemaddrs(ifp); } Modified: head/sys/netinet/in.h == --- head/sys/netinet/in.h Mon Apr 7 01:52:35 2014(r264211) +++ head/sys/netinet/in.h Mon Apr 7 01:53:03 2014(r264212) @@ -237,6 +237,7 @@ __END_DECLS #defineIPPROTO_IPCOMP 108 /* payload compression (IPComp) */ #defineIPPROTO_SCTP132 /* SCTP */ #defineIPPROTO_MH 135 /* IPv6 Mobility Header */ +#defineIPPROTO_UDPLITE 136 /* UDP-Lite */ #defineIPPROTO_HIP 139 /* IP6 Host Identity Protocol */ #defineIPPROTO_SHIM6 140 /* IP6 Shim6 Protocol */ /* 101-254: Partly Unassigned */ Modified: head/sys/netinet/in_pcb.c == --- head/sys/netinet/in_pcb.c Mon Apr 7 01:52:35 2014(r264211) +++ head/sys/netinet/in_pcb.c Mon Apr 7 01:53:03 2014(r264212) @@ -389,13 +389,14 @@ in_pcb_lport(struct inpcb *inp, struct i lastport = &pcbinfo->ipi_lastport; } /* -* For UDP, use random port allocation as long as the user +* For UDP(-Lite), use random port allocation as long as the user * allows it. For TCP (and as of yet unknown) connections, * use random port allocation only if the user allows it AND * ipport_tick() allows it. */ if (V_ipport_randomized && - (!V_ipport_stoprandom || pcbinfo == &V_udbinfo)) + (!V_ipport_stoprandom || pcbinfo == &V_udbinfo || + pcbinfo == &V_ulitecbinfo)) dorandom = 1; else dorandom = 0; @@ -405,8 +406,8 @@ in_pcb_lport(struct inpcb *inp, struct i */ if (first == last) dorandom = 0; - /* Make sure to not include UDP packets in the count. */ - if (pcbinfo != &V_udbinfo) + /* Make sure to not include UDP(-Lite) packets in the count. */ + if (pcbinfo != &V_udbinfo || pcbinfo != &V_ulitecbinfo) V_ipport_tcpallocs++; /* * Instead of having two loops further down counting up or down Modified: head/sys/netinet/in_proto.c ===
svn commit: r264213 - in head/sys: netinet netinet6
Author: kevlo Date: Mon Apr 7 01:55:53 2014 New Revision: 264213 URL: http://svnweb.freebsd.org/changeset/base/264213 Log: Minor style cleanups. Modified: head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/in6_proto.c Modified: head/sys/netinet/udp_usrreq.c == --- head/sys/netinet/udp_usrreq.c Mon Apr 7 01:53:03 2014 (r264212) +++ head/sys/netinet/udp_usrreq.c Mon Apr 7 01:55:53 2014 (r264213) @@ -403,7 +403,7 @@ udp_input(struct mbuf *m, int off) */ ip = mtod(m, struct ip *); if (m->m_len < iphlen + sizeof(struct udphdr)) { - if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == 0) { + if ((m = m_pullup(m, iphlen + sizeof(struct udphdr))) == NULL) { UDPSTAT_INC(udps_hdrops); return; } Modified: head/sys/netinet/udp_var.h == --- head/sys/netinet/udp_var.h Mon Apr 7 01:53:03 2014(r264212) +++ head/sys/netinet/udp_var.h Mon Apr 7 01:55:53 2014(r264213) @@ -158,24 +158,24 @@ get_pcblist(uint8_t protocol) return (protocol == IPPROTO_UDP) ? &V_udb : &V_ulitecb; } -int udp_newudpcb(struct inpcb *); -voidudp_discardcb(struct udpcb *); +intudp_newudpcb(struct inpcb *); +void udp_discardcb(struct udpcb *); -voidudp_ctlinput(int, struct sockaddr *, void *); -voidudplite_ctlinput(int, struct sockaddr *, void *); -int udp_ctloutput(struct socket *, struct sockopt *); -voidudp_init(void); -voidudplite_init(void); +void udp_ctlinput(int, struct sockaddr *, void *); +void udplite_ctlinput(int, struct sockaddr *, void *); +intudp_ctloutput(struct socket *, struct sockopt *); +void udp_init(void); +void udplite_init(void); #ifdef VIMAGE -voidudp_destroy(void); -voidudplite_destroy(void); +void udp_destroy(void); +void udplite_destroy(void); #endif -voidudp_input(struct mbuf *, int); -voidudplite_input(struct mbuf *, int); +void udp_input(struct mbuf *, int); +void udplite_input(struct mbuf *, int); struct inpcb *udp_notify(struct inpcb *inp, int errno); -int udp_shutdown(struct socket *so); +intudp_shutdown(struct socket *so); -int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); +intudp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f); #endif /* _KERNEL */ Modified: head/sys/netinet6/in6_proto.c == --- head/sys/netinet6/in6_proto.c Mon Apr 7 01:53:03 2014 (r264212) +++ head/sys/netinet6/in6_proto.c Mon Apr 7 01:55:53 2014 (r264213) @@ -208,7 +208,7 @@ struct ip6protosw inet6sw[] = { .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_WANTRCVD, .pr_input = sctp6_input, - .pr_ctlinput = sctp6_ctlinput, + .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, .pr_usrreqs = &sctp6_usrreqs ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264215 - head/share/man/man4
Author: kevlo Date: Mon Apr 7 01:57:51 2014 New Revision: 264215 URL: http://svnweb.freebsd.org/changeset/base/264215 Log: Add man page for udplite(4). Added: head/share/man/man4/udplite.4 (contents, props changed) Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileMon Apr 7 01:55:54 2014 (r264214) +++ head/share/man/man4/MakefileMon Apr 7 01:57:51 2014 (r264215) @@ -510,6 +510,7 @@ MAN=aac.4 \ udav.4 \ udbp.4 \ udp.4 \ + udplite.4 \ uep.4 \ ufm.4 \ ufoma.4 \ Added: head/share/man/man4/udplite.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/udplite.4 Mon Apr 7 01:57:51 2014 (r264215) @@ -0,0 +1,96 @@ +.\" Copyright (c) 2014, Kevin Lo. +.\" 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 REGENTS 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 REGENTS 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. +.\" +.\" $FreeBSD$ +.\" +.Dd April 7, 2014 +.Dt UDPLITE 4 +.Os +.Sh NAME +.Nm udplite +.Nd Lightweight User Datagram Protocol +.Sh SYNOPSIS +.In sys/types.h +.In sys/socket.h +.In netinet/udplite.h +.Ft int +.Fn socket AF_INET SOCK_STREAM IPPROTO_UDPLITE +.Sh DESCRIPTION +The +.Tn UDP-Lite +protocol provides a partial checksum which allows +corrupted packets to be transmitted to the receiving +application. +This has advantages for some types of multimedia +transport that may be able to make use of slightly +damaged datagrams, rather than having them discarded +by lower-layer protocols. +.Pp +.Tn UDP-Lite +supports a number of socket options which can be set with +.Xr setsockopt 2 +and tested with +.Xr getsockopt 2 : +.Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" +.It Dv UDPLITE_SEND_CSCOV +This option sets the sender checksum coverage. +A value of zero indicates that the entire packet +is covered by the checksum. +A value of 1 to 7 must be discarded by the receiver. +.It Dv UDPLITE_RECV_CSCOV +This option is the receiver-side analogue. +It is truly optional, i.e. not required to enable traffic +with partial checksum coverage. +Its function is that of a traffic filter: +when enabled, it instructs the kernel to drop +all packets which have a coverage less than this value. +.El +.Sh ERRORS +A socket operation may fail with one of the following errors returned: +.Bl -tag -width Er +.It Bq Er EISCONN +when trying to establish a connection on a socket which +already has one, or when trying to send a datagram with the destination +address specified and the socket is already connected; +.It Bq Er ENOTCONN +when trying to send a datagram, but +no destination address is specified, and the socket has not been +connected; +.It Bq Er ENOBUFS +when the system runs out of memory for +an internal data structure; +.It Bq Er EADDRINUSE +when an attempt +is made to create a socket with a port which has already been +allocated; +.It Bq Er EADDRNOTAVAIL +when an attempt is made to create a +socket with a network address for which no network interface +exists. +.El +.Sh SEE ALSO +.Xr getsockopt 2 , +.Xr recv 2 , +.Xr send 2 , +.Xr socket 2 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264216 - head/usr.bin/units
Author: eadler Date: Mon Apr 7 02:31:10 2014 New Revision: 264216 URL: http://svnweb.freebsd.org/changeset/base/264216 Log: units(1): make -V print version instead of -v The units program is likely little used. It is even less likely that a script will want the units program to print out its version number by passing -v. GNU units uses -V for version and -v for verbosity. Increase compatibility between these two versions (written by the same author) by switching our flag as well. Take this opportunity to remove bogus information about the version number and just call it 'FreeBSD units'. Discussed with: cperciva, rwatson Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 == --- head/usr.bin/units/units.1 Mon Apr 7 01:57:51 2014(r264215) +++ head/usr.bin/units/units.1 Mon Apr 7 02:31:10 2014(r264216) @@ -8,7 +8,7 @@ .Sh SYNOPSIS .Nm .Op Fl f Ar filename -.Op Fl qv +.Op Fl qV .Op Ar from-unit to-unit .Sh OPTIONS The following options are available: @@ -18,8 +18,8 @@ Specify the name of the units data file .It Fl q Suppress prompting of the user for units and the display of statistics about the number of units loaded. -.It Fl v -Print the version number. +.It Fl V +Print the version number, usage, and then exit. .It Ar from-unit to-unit Allow a single unit conversion to be done directly from the command line. Modified: head/usr.bin/units/units.c == --- head/usr.bin/units/units.c Mon Apr 7 01:57:51 2014(r264215) +++ head/usr.bin/units/units.c Mon Apr 7 02:31:10 2014(r264216) @@ -32,8 +32,6 @@ static const char rcsid[] = #include "pathnames.h" -#define VERSION "1.0" - #ifndef UNITSFILE #define UNITSFILE _PATH_UNITSLIB #endif @@ -689,7 +687,7 @@ main(int argc, char **argv) char *userfile = 0; int quiet = 0; - while ((optchar = getopt(argc, argv, "vqf:")) != -1) { + while ((optchar = getopt(argc, argv, "Vqf:")) != -1) { switch (optchar) { case 'f': userfile = optarg; @@ -697,14 +695,12 @@ main(int argc, char **argv) case 'q': quiet = 1; break; - case 'v': - fprintf(stderr, "\n units version %s Copyright (c) 1993 by Adrian Mariano\n", - VERSION); - fprintf(stderr, "This program may be freely distributed\n"); + case 'V': + fprintf(stderr, "FreeBSD units\n"); usage(); + break; default: usage(); - break; } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264218 - head/sys/dev/uart
Author: rpaulo Date: Mon Apr 7 05:18:27 2014 New Revision: 264218 URL: http://svnweb.freebsd.org/changeset/base/264218 Log: Use a more professional device description. Modified: head/sys/dev/uart/uart_dev_imx.c Modified: head/sys/dev/uart/uart_dev_imx.c == --- head/sys/dev/uart/uart_dev_imx.cMon Apr 7 02:36:30 2014 (r264217) +++ head/sys/dev/uart/uart_dev_imx.cMon Apr 7 05:18:27 2014 (r264218) @@ -352,7 +352,7 @@ imx_uart_bus_probe(struct uart_softc *sc sc->sc_rxfifosz = 1; sc->sc_txfifosz = 1; - device_set_desc(sc->sc_dev, "imx_uart"); + device_set_desc(sc->sc_dev, "Freescale i.MX UART"); return (0); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r264219 - in head/sys/arm: cavium cavium/cns11xx conf econa
Author: rpaulo Date: Mon Apr 7 05:33:30 2014 New Revision: 264219 URL: http://svnweb.freebsd.org/changeset/base/264219 Log: Move sys/arm/econa to sys/arm/cavium/cns11xx. Added: head/sys/arm/cavium/ head/sys/arm/cavium/cns11xx/ - copied from r264142, head/sys/arm/econa/ Deleted: head/sys/arm/econa/ Modified: head/sys/arm/cavium/cns11xx/cfi_bus_econa.c head/sys/arm/cavium/cns11xx/files.econa head/sys/arm/cavium/cns11xx/if_ece.c head/sys/arm/cavium/cns11xx/ohci_ec.c head/sys/arm/cavium/cns11xx/std.econa head/sys/arm/cavium/cns11xx/uart_bus_ec.c head/sys/arm/cavium/cns11xx/uart_cpu_ec.c head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/NOTES Modified: head/sys/arm/cavium/cns11xx/cfi_bus_econa.c == --- head/sys/arm/econa/cfi_bus_econa.c Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/cfi_bus_econa.c Mon Apr 7 05:33:30 2014 (r264219) @@ -40,8 +40,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include static int cfi_econa_probe(device_t dev) Modified: head/sys/arm/cavium/cns11xx/files.econa == --- head/sys/arm/econa/files.econa Sat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/files.econa Mon Apr 7 05:33:30 2014 (r264219) @@ -1,13 +1,13 @@ # $FreeBSD$ arm/arm/cpufunc_asm_fa526.Sstandard -arm/econa/econa_machdep.c standard -arm/econa/econa.c standard -arm/econa/timer.c standard -arm/econa/uart_bus_ec.coptionaluart -arm/econa/uart_cpu_ec.coptionaluart +arm/cavium/cns11xx/econa_machdep.c standard +arm/cavium/cns11xx/econa.c standard +arm/cavium/cns11xx/timer.c standard +arm/cavium/cns11xx/uart_bus_ec.c optionaluart +arm/cavium/cns11xx/uart_cpu_ec.c optionaluart dev/uart/uart_dev_ns8250.c optionaluart arm/arm/bus_space_generic.cstandard -arm/econa/ehci_ebus.c optionalehci -arm/econa/ohci_ec.coptionalohci -arm/econa/if_ece.c standard -arm/econa/cfi_bus_econa.c optionalcfi +arm/cavium/cns11xx/ehci_ebus.c optionalehci +arm/cavium/cns11xx/ohci_ec.c optionalohci +arm/cavium/cns11xx/if_ece.cstandard +arm/cavium/cns11xx/cfi_bus_econa.c optionalcfi Modified: head/sys/arm/cavium/cns11xx/if_ece.c == --- head/sys/arm/econa/if_ece.c Sat Apr 5 03:01:29 2014(r264142) +++ head/sys/arm/cavium/cns11xx/if_ece.cMon Apr 7 05:33:30 2014 (r264219) @@ -62,9 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include +#include +#include +#include #include #include Modified: head/sys/arm/cavium/cns11xx/ohci_ec.c == --- head/sys/arm/econa/ohci_ec.cSat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/ohci_ec.c Mon Apr 7 05:33:30 2014 (r264219) @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #defineMEM_RID 0 Modified: head/sys/arm/cavium/cns11xx/std.econa == --- head/sys/arm/econa/std.econaSat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/std.econa Mon Apr 7 05:33:30 2014 (r264219) @@ -1,6 +1,6 @@ # $FreeBSD$ -files "../econa/files.econa" +files "../cavium/cns11xx/files.econa" cpuCPU_FA526 machinearm makeoptionsCONF_CFLAGS=-march=armv4 Modified: head/sys/arm/cavium/cns11xx/uart_bus_ec.c == --- head/sys/arm/econa/uart_bus_ec.cSat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/uart_bus_ec.c Mon Apr 7 05:33:30 2014 (r264219) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include static int uart_ec_probe(device_t dev); Modified: head/sys/arm/cavium/cns11xx/uart_cpu_ec.c == --- head/sys/arm/econa/uart_cpu_ec.cSat Apr 5 03:01:29 2014 (r264142) +++ head/sys/arm/cavium/cns11xx/uart_cpu_ec.c Mon Apr 7 05:33:30 2014 (r264219) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include +#include +#include bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; Modified: head/sys/arm/conf/CNS11XXNAS == --- head/sys/