diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-20 03:03:38 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-20 03:03:38 +0400 |
commit | 1cce92aef225171705c3f53a871938abca2177de (patch) | |
tree | a6a4cc523c6918d616ec719b1a3eb8788d64dc3d /arch/avr32/lib | |
parent | 79d57ab98b7bc32e5bb20683814cfb76dbb54a9e (diff) | |
parent | 3d431a742728e6b619ce57a030a92d228c13d1d2 (diff) | |
download | linux-1cce92aef225171705c3f53a871938abca2177de.tar.xz |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
avr32: nmi_enter() without nmi_exit()
avr32: fix sys_sync_file_range() call convention
avr32: add generic_find_next_le_bit bit function
avr32: add .gitignore files
atstk1000: fix build breakage with BOARD_ATSTK100X_SW2_CUSTOM=y
Diffstat (limited to 'arch/avr32/lib')
-rw-r--r-- | arch/avr32/lib/findbit.S | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/avr32/lib/findbit.S b/arch/avr32/lib/findbit.S index c6b91dee857c..997b33b2288a 100644 --- a/arch/avr32/lib/findbit.S +++ b/arch/avr32/lib/findbit.S @@ -123,6 +123,36 @@ ENTRY(find_next_bit) brgt 1b retal r11 +ENTRY(generic_find_next_le_bit) + lsr r8, r10, 5 + sub r9, r11, r10 + retle r11 + + lsl r8, 2 + add r12, r8 + andl r10, 31, COH + breq 1f + + /* offset is not word-aligned. Handle the first (32 - r10) bits */ + ldswp.w r8, r12[0] + sub r12, -4 + lsr r8, r8, r10 + brne .L_found + + /* r9 = r9 - (32 - r10) = r9 + r10 - 32 */ + add r9, r10 + sub r9, 32 + retle r11 + + /* Main loop. offset must be word-aligned */ +1: ldswp.w r8, r12[0] + cp.w r8, 0 + brne .L_found + sub r12, -4 + sub r9, 32 + brgt 1b + retal r11 + ENTRY(generic_find_next_zero_le_bit) lsr r8, r10, 5 sub r9, r11, r10 |