diff options
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/bitops.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/asm-sh/bitops.h b/include/asm-sh/bitops.h index 1c5260860045..f8d504e7d9d6 100644 --- a/include/asm-sh/bitops.h +++ b/include/asm-sh/bitops.h | |||
@@ -339,8 +339,8 @@ static inline int sched_find_first_bit(const unsigned long *b) | |||
339 | } | 339 | } |
340 | 340 | ||
341 | #ifdef __LITTLE_ENDIAN__ | 341 | #ifdef __LITTLE_ENDIAN__ |
342 | #define ext2_set_bit(nr, addr) test_and_set_bit((nr), (addr)) | 342 | #define ext2_set_bit(nr, addr) __test_and_set_bit((nr), (addr)) |
343 | #define ext2_clear_bit(nr, addr) test_and_clear_bit((nr), (addr)) | 343 | #define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr), (addr)) |
344 | #define ext2_test_bit(nr, addr) test_bit((nr), (addr)) | 344 | #define ext2_test_bit(nr, addr) test_bit((nr), (addr)) |
345 | #define ext2_find_first_zero_bit(addr, size) find_first_zero_bit((addr), (size)) | 345 | #define ext2_find_first_zero_bit(addr, size) find_first_zero_bit((addr), (size)) |
346 | #define ext2_find_next_zero_bit(addr, size, offset) \ | 346 | #define ext2_find_next_zero_bit(addr, size, offset) \ |
@@ -349,30 +349,24 @@ static inline int sched_find_first_bit(const unsigned long *b) | |||
349 | static __inline__ int ext2_set_bit(int nr, volatile void * addr) | 349 | static __inline__ int ext2_set_bit(int nr, volatile void * addr) |
350 | { | 350 | { |
351 | int mask, retval; | 351 | int mask, retval; |
352 | unsigned long flags; | ||
353 | volatile unsigned char *ADDR = (unsigned char *) addr; | 352 | volatile unsigned char *ADDR = (unsigned char *) addr; |
354 | 353 | ||
355 | ADDR += nr >> 3; | 354 | ADDR += nr >> 3; |
356 | mask = 1 << (nr & 0x07); | 355 | mask = 1 << (nr & 0x07); |
357 | local_irq_save(flags); | ||
358 | retval = (mask & *ADDR) != 0; | 356 | retval = (mask & *ADDR) != 0; |
359 | *ADDR |= mask; | 357 | *ADDR |= mask; |
360 | local_irq_restore(flags); | ||
361 | return retval; | 358 | return retval; |
362 | } | 359 | } |
363 | 360 | ||
364 | static __inline__ int ext2_clear_bit(int nr, volatile void * addr) | 361 | static __inline__ int ext2_clear_bit(int nr, volatile void * addr) |
365 | { | 362 | { |
366 | int mask, retval; | 363 | int mask, retval; |
367 | unsigned long flags; | ||
368 | volatile unsigned char *ADDR = (unsigned char *) addr; | 364 | volatile unsigned char *ADDR = (unsigned char *) addr; |
369 | 365 | ||
370 | ADDR += nr >> 3; | 366 | ADDR += nr >> 3; |
371 | mask = 1 << (nr & 0x07); | 367 | mask = 1 << (nr & 0x07); |
372 | local_irq_save(flags); | ||
373 | retval = (mask & *ADDR) != 0; | 368 | retval = (mask & *ADDR) != 0; |
374 | *ADDR &= ~mask; | 369 | *ADDR &= ~mask; |
375 | local_irq_restore(flags); | ||
376 | return retval; | 370 | return retval; |
377 | } | 371 | } |
378 | 372 | ||
@@ -459,9 +453,9 @@ found_middle: | |||
459 | }) | 453 | }) |
460 | 454 | ||
461 | /* Bitmap functions for the minix filesystem. */ | 455 | /* Bitmap functions for the minix filesystem. */ |
462 | #define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr) | 456 | #define minix_test_and_set_bit(nr,addr) __test_and_set_bit(nr,addr) |
463 | #define minix_set_bit(nr,addr) set_bit(nr,addr) | 457 | #define minix_set_bit(nr,addr) __set_bit(nr,addr) |
464 | #define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr) | 458 | #define minix_test_and_clear_bit(nr,addr) __test_and_clear_bit(nr,addr) |
465 | #define minix_test_bit(nr,addr) test_bit(nr,addr) | 459 | #define minix_test_bit(nr,addr) test_bit(nr,addr) |
466 | #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) | 460 | #define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) |
467 | 461 | ||