Re: Linux-2.1.109.. preliminary code freeze.

Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
Sun, 19 Jul 1998 00:34:50 +0200 (MET DST)


On Sat, 18 Jul 1998, Linus Torvalds wrote:
> On Sat, 18 Jul 1998, Alan Cox wrote:
> > > The problem here is applying "test_and_set_bit" to a poorly-aligned char.
> > > The variable is "interrupt" in a "struct device" (line 192 in netdevice.h).
> > > For the UDB, this can be kludged-around by changing the two char-s to int-s.
> > > Somebody else should know the correct solution. The code in question is
> > > around line 1560 in de4x5.c:
> >
> > If we need to ensure alignment of that field for atomic tests then unless
> > it breaks anything else (it doesnt seem to at first look) they should be
> > int. Im happy to make them ints
>
> I've made them both "unsigned long". No architecture I know of requires
> atomic accesses to be "long", but I could imagine some that does (many
> architectures essentially require the access to be at least "int").

One of the common bugs in drivers is related to bitops on chars: on big endian
machines bits 0-7 are not in the byte you're pointing at.

Greetings,

Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}  http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html