Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-28 Thread Mindaugas Rasiukevicius
Mouse mo...@rodents-montreal.org wrote: Multiple threads can ioctl and nobody prevents one from having a single process with multiple threads (pthreads, if you like). Not only that, but even without threading, there are at least two ways I can think of offhand that a file descriptor, once

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-26 Thread Marc Balmer
Am 24.08.11 00:00, schrieb Mindaugas Rasiukevicius: Marc Balmer mbal...@netbsd.org wrote: Here comes the third iteration of the gpio(4) patch. In addition to whjat I already described, u_int_XXX types have been replaced by uint_XXX and gpio(4) is made MPSAFE. Comments? Furthermore I am

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-25 Thread Marc Balmer
Am 24.08.11 04:50, schrieb Mouse: Well, you need to open it first, before you can to ioctl, and if only one process can open it, only one process can ioctl it, right? Wrong. Agreed. Multiple threads can ioctl and nobody prevents one from having a single process with multiple threads

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-23 Thread David Young
On Tue, Aug 23, 2011 at 08:24:03AM +0200, Marc Balmer wrote: Furthermore I am thinking if it would be useful if more than one process could open a gpio device, as a long as they use different pins, e.g. one process controlls a stepper motor using some of the pins while another process drives

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-23 Thread Marc Balmer
Am 24.08.11 00:00, schrieb Mindaugas Rasiukevicius: Marc Balmer mbal...@netbsd.org wrote: Here comes the third iteration of the gpio(4) patch. In addition to whjat I already described, u_int_XXX types have been replaced by uint_XXX and gpio(4) is made MPSAFE. Comments? Furthermore I am

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-23 Thread Mindaugas Rasiukevicius
Marc Balmer mbal...@netbsd.org wrote: There is nothing what prevents from multiple threads calling gpioioctl (), which is obviously not MP-safe. As soon as you will start fixing this, it will bring you back to the point I have already stated - the design needs to be MP-safe in general.

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-23 Thread Mouse
Well, you need to open it first, before you can to ioctl, and if only one process can open it, only one process can ioctl it, right? Wrong. Agreed. Multiple threads can ioctl and nobody prevents one from having a single process with multiple threads (pthreads, if you like). Not only that,

Adding pulse support to gpio(4), gpioctl(8)

2011-08-21 Thread Marc Balmer
The attached diff adds the ability to pulse a pin with a set frequency and duty cycle. A new gpio(4) ioctl, GPIOPULSE, and a new gpioctl(8) command line option pulse are added. Whereas the gpioctl(8) command line utility accepts the freqeuncy in hertz and the duty cycle in percent, these values

Re: Adding pulse support to gpio(4), gpioctl(8)

2011-08-21 Thread Marc Balmer
The attached diff adds the ability to pulse a pin with a set frequency and duty cycle. A new gpio(4) ioctl, GPIOPULSE, and a new gpioctl(8) command line option pulse are added. Whereas the gpioctl(8) command line utility accepts the freqeuncy in hertz and the duty cycle in percent, these