diff options
Diffstat (limited to 'include/asm-sh64/bitops.h')
-rw-r--r-- | include/asm-sh64/bitops.h | 16 |
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) | |||
392 | static __inline__ int ext2_set_bit(int nr, volatile void * addr) | 392 | static __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 | ||
407 | static __inline__ int ext2_clear_bit(int nr, volatile void * addr) | 404 | static __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 | ||