On Mon, 18 Feb 2008, svn@coreboot.org wrote:
void pnp_set_enable(device_t dev, int enable) {
- pnp_write_config(dev, 0x30, enable?0x1:0x0);
- u8 tmp, bitpos;
- tmp = pnp_read_config(dev, 0x30);
- /* handle the virtual devices, which share same LDN register */
- bitpos = (dev->path.u.pnp.device >> 8) & 0x7;
- if (enable) {
tmp |= (1 << bitpos);
- } else {
tmp &= ~(1 << bitpos);
- }
- pnp_write_config(dev, 0x30, tmp);
}
int pnp_read_enable(device_t dev) {
- return !!pnp_read_config(dev, 0x30);
- u8 tmp, bitpos;
- tmp = pnp_read_config(dev, 0x30);
- /* handle the virtual devices, which share same LDN register */
- bitpos = (dev->path.u.pnp.device >> 8) & 0x7;
- return !!(tmp & bitpos);
Hmm, shouldn't the last line test the bit at *position* bitpos:
+ return !!(tmp & (1 << bitpos));
/ulf
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Ulf,
Hmm, shouldn't the last line test the bit at *position* bitpos:
- return !!(tmp & (1 << bitpos));
Yep good catch. I will fix it and I'm sorry about that.
Btw the build is failing with:
srv/svn/linuxbios-extra/tmp/coreboot-v2-3104/src/devices/pnp_device.c:54: error: `u8' undeclared (first use in this function)
Any idea why it works for me here?
Rudolf
On Mon, 18 Feb 2008, Rudolf Marek wrote:
Btw the build is failing with:
srv/svn/linuxbios-extra/tmp/coreboot-v2-3104/src/devices/pnp_device.c:54: error: `u8' undeclared (first use in this function)
Any idea why it works for me here?
No, but all the failed builds are for powerpc targets. Include file differences between the platforms?
/ulf
On Mon, 18 Feb 2008, Ulf Jordan wrote:
On Mon, 18 Feb 2008, Rudolf Marek wrote:
Btw the build is failing with:
srv/svn/linuxbios-extra/tmp/coreboot-v2-3104/src/devices/pnp_device.c:54: error: `u8' undeclared (first use in this function)
Any idea why it works for me here?
No, but all the failed builds are for powerpc targets. Include file differences between the platforms?
I think it is necessary to use uint8_t in the code here, see attached patch.
/ulf
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
Thanks,
Yep I fixing that too. Chatting on IRC with the rest of the folks so I got preempted somehow.
Rudolf
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi all
I'm attaching the patch which should fix both problems. Fix the undefined u8 type and the bitpos selection in currently unused pnp_read_enable function.
Signed-off-by: Rudolf Marek r.marek@assembler.cz
Thanks,
Rudolf
* Rudolf Marek r.marek@assembler.cz [080218 23:30]:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi all
I'm attaching the patch which should fix both problems. Fix the undefined u8 type and the bitpos selection in currently unused pnp_read_enable function.
Signed-off-by: Rudolf Marek r.marek@assembler.cz
Acked-by: Stefan Reinauer stepan@coresystems.de
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Thanks, r3109
Rudolf