From 8ad26b08fac068f0c50d44a5072fb49ab7bedc78 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 29 Mar 2006 14:23:00 -0500 Subject: [PATCH] Fix the x86 asm constraints for ext2fs_set/clear_bit. The assembly function reads/writes the data files, so make sure we tell gcc that. Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/ChangeLog | 6 ++++++ lib/ext2fs/bitops.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index ac3cd69..4a12f78 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,9 @@ +2006-03-29 Theodore Ts'o + + * bitops.h (ext2fs_set_bit, ext2fs_clear_bit): Fix the constraints + so that GCC knows that the ext2fs_set/clear_bit reads and + writes the data. + 2006-03-25 Theodore Ts'o * Makefile.in: Check the bitfield operations much more carefully, diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h index caaec5f..5d01838 100644 --- a/lib/ext2fs/bitops.h +++ b/lib/ext2fs/bitops.h @@ -181,7 +181,7 @@ _INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr) addr = (void *) (((unsigned char *) addr) + (nr >> 3)); __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"=m" (EXT2FS_ADDR) + :"=r" (oldbit),"+m" (EXT2FS_ADDR) :"r" (nr & 7)); return oldbit; } @@ -192,7 +192,7 @@ _INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr) addr = (void *) (((unsigned char *) addr) + (nr >> 3)); __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"=m" (EXT2FS_ADDR) + :"=r" (oldbit),"+m" (EXT2FS_ADDR) :"r" (nr & 7)); return oldbit; } -- 1.8.3.1