Mike Frysinger wrote:

> we've already got a "gpio" driver that sits on top of the Linux GPIO
> sysfs interface.  we can't have another driver using the same name.

Therefore I called it "parportgpio". I noticed the conflict, while compiling
it for the first time. ;)


>  could you take a look at src/tap/cable/gpio.c and see if you could add
> NetBSD support to that instead ?  i think you'd just have to update the
> accessor funcs ...

I studied the gpio.c source, but there is not much which could be reused. It
would end up in a completely new driver.

The Linux GPIO sysfs interface is so much different. You would open a single
file for each GPIO pin and GPIO direction and read() or write() to it. I
didn't even understand what gpio_export does.

Under NetBSD (and OpenBSD) it is just a single file, /dev/gpio0, which
controls all GPIO pins of a device via ioctl().

And I wanted to use the byteblaster.c cable (I have a ByteblasterMV), which
depends on urj_tap_parport_xxx accessor functions. So it seemed logical for
me to add a new parport lowlevel driver.


>> [...] I also fixed some bugs with missing "(unsigned char)"
>> casts, which cause error messages since gcc 4.5.
>
> i'd like to address this separately.  i've been building under Linux
> with gcc-4.5 and gcc-4.6 and haven't seen any warnings.

Hmm... probably the compiler was configured to be more strict under NetBSD?


> POSIX says that isspace() and friends take an int, so i don't see why
> we need to cast a char to unsigned char to avoid warnings there.
>   http://pubs.opengroup.org/onlinepubs/9699919799/functions/isspace.html

The answer is in the link, you were refering to:
"The c argument is an int, the value of which the application shall ensure
is a character representable as an unsigned char..."

You don't ensure it is an unsigned char.

For example: ASCII code 128 would be -128 as a signed char, which will be
converted to an int of -128 by the compiler, when calling isspace(). The
result would be undefined!

Casting it to unsigned char first would make it 128, which can be converted
to an int of 128.

-- 
Frank Wille


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to