aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/bitops_32.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:25:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:25:51 -0400
commit9e9abecfc0ff3a9ad2ead954b37bbfcb863c775e (patch)
tree0c3ffda953b82750638a06507591ad587b565ff2 /include/asm-x86/bitops_32.h
parentd7bb545d86825e635cab33a1dd81ca0ad7b92887 (diff)
parent77ad386e596c6b0930cc2e09e3cce485e3ee7f72 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (613 commits) x86: standalone trampoline code x86: move suspend wakeup code to C x86: coding style fixes to arch/x86/kernel/acpi/sleep.c x86: setup_trampoline() - fix section mismatch warning x86: section mismatch fixes, #1 x86: fix paranoia about using BIOS quickboot mechanism. x86: print out buggy mptable x86: use cpu_online() x86: use cpumask_of_cpu() x86: remove unnecessary tmp local variable x86: remove unnecessary memset() x86: use ioapic_read_entry() and ioapic_write_entry() x86: avoid redundant loop in io_apic_level_ack_pending() x86: remove superfluous initialisation in boot code. x86: merge mpparse_{32,64}.c x86: unify mp_register_gsi x86: unify mp_config_acpi_legacy_irqs x86: unify mp_register_ioapic x86: unify uniq_io_apic_id x86: unify smp_scan_config ...
Diffstat (limited to 'include/asm-x86/bitops_32.h')
-rw-r--r--include/asm-x86/bitops_32.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/include/asm-x86/bitops_32.h b/include/asm-x86/bitops_32.h
index e4d75fcf9c03..2513a81f82aa 100644
--- a/include/asm-x86/bitops_32.h
+++ b/include/asm-x86/bitops_32.h
@@ -20,20 +20,22 @@ static inline int find_first_zero_bit(const unsigned long *addr, unsigned size)
20 20
21 if (!size) 21 if (!size)
22 return 0; 22 return 0;
23 /* This looks at memory. Mark it volatile to tell gcc not to move it around */ 23 /* This looks at memory.
24 __asm__ __volatile__( 24 * Mark it volatile to tell gcc not to move it around
25 "movl $-1,%%eax\n\t" 25 */
26 "xorl %%edx,%%edx\n\t" 26 asm volatile("movl $-1,%%eax\n\t"
27 "repe; scasl\n\t" 27 "xorl %%edx,%%edx\n\t"
28 "je 1f\n\t" 28 "repe; scasl\n\t"
29 "xorl -4(%%edi),%%eax\n\t" 29 "je 1f\n\t"
30 "subl $4,%%edi\n\t" 30 "xorl -4(%%edi),%%eax\n\t"
31 "bsfl %%eax,%%edx\n" 31 "subl $4,%%edi\n\t"
32 "1:\tsubl %%ebx,%%edi\n\t" 32 "bsfl %%eax,%%edx\n"
33 "shll $3,%%edi\n\t" 33 "1:\tsubl %%ebx,%%edi\n\t"
34 "addl %%edi,%%edx" 34 "shll $3,%%edi\n\t"
35 :"=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2) 35 "addl %%edi,%%edx"
36 :"1" ((size + 31) >> 5), "2" (addr), "b" (addr) : "memory"); 36 : "=d" (res), "=&c" (d0), "=&D" (d1), "=&a" (d2)
37 : "1" ((size + 31) >> 5), "2" (addr),
38 "b" (addr) : "memory");
37 return res; 39 return res;
38} 40}
39 41
@@ -75,7 +77,7 @@ static inline unsigned find_first_bit(const unsigned long *addr, unsigned size)
75 unsigned long val = *addr++; 77 unsigned long val = *addr++;
76 if (val) 78 if (val)
77 return __ffs(val) + x; 79 return __ffs(val) + x;
78 x += (sizeof(*addr)<<3); 80 x += sizeof(*addr) << 3;
79 } 81 }
80 return x; 82 return x;
81} 83}
@@ -152,10 +154,10 @@ static inline int fls(int x)
152 154
153#include <asm-generic/bitops/ext2-non-atomic.h> 155#include <asm-generic/bitops/ext2-non-atomic.h>
154 156
155#define ext2_set_bit_atomic(lock, nr, addr) \ 157#define ext2_set_bit_atomic(lock, nr, addr) \
156 test_and_set_bit((nr), (unsigned long *)addr) 158 test_and_set_bit((nr), (unsigned long *)(addr))
157#define ext2_clear_bit_atomic(lock, nr, addr) \ 159#define ext2_clear_bit_atomic(lock, nr, addr) \
158 test_and_clear_bit((nr), (unsigned long *)addr) 160 test_and_clear_bit((nr), (unsigned long *)(addr))
159 161
160#include <asm-generic/bitops/minix.h> 162#include <asm-generic/bitops/minix.h>
161 163