2006-03-26 22:20:15

by Chuck Ebbert

[permalink] [raw]
Subject: Re: [Ext2-devel] [PATCH 1/2] ext2/3: Support 2^32-1 blocks(Kernel)

In-Reply-To: <[email protected]>

On Sat, 25 Mar 2006 22:01:15 -0500, Theodore Ts'o wrote:

> Fix the i386 bitmap operations so they are 32-bit clean
...
> --- a/lib/ext2fs/bitops.h Sat Mar 25 01:42:02 2006 -0500
> +++ b/lib/ext2fs/bitops.h Sat Mar 25 13:42:45 2006 -0500
...
> @@ -155,9 +179,10 @@
> {
> int oldbit;
>
> + addr = (void *) (((unsigned char *) addr) + (nr >> 3));
> __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0"
> :"=r" (oldbit),"=m" (EXT2FS_ADDR)
^
This should be "+" because that data is both read and written
by the assembler instruction.

> - :"r" (nr));
> + :"r" (nr & 7));
> return oldbit;
> }
>
> @@ -165,9 +190,10 @@
> {
> int oldbit;
>
> + addr = (void *) (((unsigned char *) addr) + (nr >> 3));
> __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0"
> :"=r" (oldbit),"=m" (EXT2FS_ADDR)
^
Same here.

> - :"r" (nr));
> + :"r" (nr & 7));
> return oldbit;
> }

See include/asm-i386/bitops.h where that has already been done (it's still
wrong, but less so than before.)

--
Chuck
"Penguins don't come from next door, they come from the Antarctic!"