aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh64/bitops.h
diff options
context:
space:
mode:
authorAkinobu Mita <mita@miraclelinux.com>2006-03-26 04:39:05 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:57:10 -0500
commit67b0ad574b5ee90f8ea58196ff8a7f3780b75365 (patch)
treeca9bc212f6efa8f5170185ef1fa21f75de0684fd /include/asm-sh64/bitops.h
parent72b61a3cfd80d1321eb898be8ceae2064f0fbea1 (diff)
[PATCH] bitops: use non atomic operations for minix_*_bit() and ext2_*_bit()
Bitmap functions for the minix filesystem and the ext2 filesystem except ext2_set_bit_atomic() and ext2_clear_bit_atomic() do not require the atomic guarantees. But these are defined by using atomic bit operations on several architectures. (cris, frv, h8300, ia64, m32r, m68k, m68knommu, mips, s390, sh, sh64, sparc, sparc64, v850, and xtensa) This patch switches to non atomic bit operation. Signed-off-by: Akinobu Mita <mita@miraclelinux.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh64/bitops.h')
-rw-r--r--include/asm-sh64/bitops.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/include/asm-sh64/bitops.h b/include/asm-sh64/bitops.h
index ce9c3ad45fe0..5622b1a50cb1 100644
--- a/include/asm-sh64/bitops.h
+++ b/include/asm-sh64/bitops.h
@@ -382,8 +382,8 @@ static inline int sched_find_first_bit(unsigned long *b)
382#define hweight8(x) generic_hweight8(x) 382#define hweight8(x) generic_hweight8(x)
383 383
384#ifdef __LITTLE_ENDIAN__ 384#ifdef __LITTLE_ENDIAN__
385#define ext2_set_bit(nr, addr) test_and_set_bit((nr), (addr)) 385#define ext2_set_bit(nr, addr) __test_and_set_bit((nr), (addr))
386#define ext2_clear_bit(nr, addr) test_and_clear_bit((nr), (addr)) 386#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr), (addr))
387#define ext2_test_bit(nr, addr) test_bit((nr), (addr)) 387#define ext2_test_bit(nr, addr) test_bit((nr), (addr))
388#define ext2_find_first_zero_bit(addr, size) find_first_zero_bit((addr), (size)) 388#define ext2_find_first_zero_bit(addr, size) find_first_zero_bit((addr), (size))
389#define ext2_find_next_zero_bit(addr, size, offset) \ 389#define ext2_find_next_zero_bit(addr, size, offset) \
@@ -392,30 +392,24 @@ static inline int sched_find_first_bit(unsigned long *b)
392static __inline__ int ext2_set_bit(int nr, volatile void * addr) 392static __inline__ int ext2_set_bit(int nr, volatile void * addr)
393{ 393{
394 int mask, retval; 394 int mask, retval;
395 unsigned long flags;
396 volatile unsigned char *ADDR = (unsigned char *) addr; 395 volatile unsigned char *ADDR = (unsigned char *) addr;
397 396
398 ADDR += nr >> 3; 397 ADDR += nr >> 3;
399 mask = 1 << (nr & 0x07); 398 mask = 1 << (nr & 0x07);
400 local_irq_save(flags);
401 retval = (mask & *ADDR) != 0; 399 retval = (mask & *ADDR) != 0;
402 *ADDR |= mask; 400 *ADDR |= mask;
403 local_irq_restore(flags);
404 return retval; 401 return retval;
405} 402}
406 403
407static __inline__ int ext2_clear_bit(int nr, volatile void * addr) 404static __inline__ int ext2_clear_bit(int nr, volatile void * addr)
408{ 405{
409 int mask, retval; 406 int mask, retval;
410 unsigned long flags;
411 volatile unsigned char *ADDR = (unsigned char *) addr; 407 volatile unsigned char *ADDR = (unsigned char *) addr;
412 408
413 ADDR += nr >> 3; 409 ADDR += nr >> 3;
414 mask = 1 << (nr & 0x07); 410 mask = 1 << (nr & 0x07);
415 local_irq_save(flags);
416 retval = (mask & *ADDR) != 0; 411 retval = (mask & *ADDR) != 0;
417 *ADDR &= ~mask; 412 *ADDR &= ~mask;
418 local_irq_restore(flags);
419 return retval; 413 return retval;
420} 414}
421 415
@@ -502,9 +496,9 @@ found_middle:
502 }) 496 })
503 497
504/* Bitmap functions for the minix filesystem. */ 498/* Bitmap functions for the minix filesystem. */
505#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr) 499#define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr)
506#define minix_set_bit(nr,addr) set_bit(nr,addr) 500#define minix_set_bit(nr,addr) __set_bit(nr,addr)
507#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr) 501#define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr)
508#define minix_test_bit(nr,addr) test_bit(nr,addr) 502#define minix_test_bit(nr,addr) test_bit(nr,addr)
509#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) 503#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
510 504