aboutsummaryrefslogtreecommitdiff
path: root/include/asm-mips/bitops.h
AgeCommit message (Collapse)AuthorFilesLines
2008-05-12[MIPS] Get rid of __ilog2Ralf Baechle1-7/+2
56a6b1eb7bfb5ace0b5cb9c149f502fbd101b8ab was a bit too conservative and left __ilog2 around which is only used as an internal function for other bitops. Signed-off-by: Ralf Baechle <[email protected]>
2008-05-12[MIPS] Fix __fls for non-MIPS32/MIPS64 cpusThomas Bogendoerfer1-2/+3
Only MIPS32 and MIPS64 CPUs implement clz/dclz. Therefore don't export __ilog2() for non MIPS32/MIPS64 cpus and use generic __fls bitop code for these cpus. Signed-off-by: Thomas Bogendoerfer <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2008-04-26generic: implement __fls on all 64-bit archsAlexander van Heukelum1-0/+5
Implement __fls on all 64-bit archs: alpha has an implementation of fls64. Added __fls(x) = fls64(x) - 1. ia64 has fls, but not __fls. Added __fls based on code of fls. mips and powerpc have __ilog2, which is the same as __fls. Added __fls = __ilog2. parisc, s390, sh and sparc64: Include generic __fls. x86_64 already has __fls. Signed-off-by: Alexander van Heukelum <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2007-10-19forbid asm/bitops.h direct inclusionJiri Slaby1-0/+4
forbid asm/bitops.h direct inclusion Because of compile errors that may occur after bit changes if asm/bitops.h is included directly without e.g. linux/kernel.h which includes linux/bitops.h, forbid direct inclusion of asm/bitops.h. Thanks to Adrian Bunk. Signed-off-by: Jiri Slaby <[email protected]> Cc: Adrian Bunk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-18mips: lock bitopsNick Piggin1-1/+96
mips can avoid one mb when acquiring a lock with test_and_set_bit_lock. Signed-off-by: Nick Piggin <[email protected]> Cc: Ralf Baechle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-18mips: fix bitopsNick Piggin1-0/+6
Documentation/atomic_ops.txt defines these primitives must contain a memory barrier both before and after their memory operation. This is consistent with the atomic ops implementation on mips. Signed-off-by: Nick Piggin <[email protected]> Cc: Ralf Baechle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-18bitops: introduce lock opsNick Piggin1-0/+1
Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics. Convert all architectures to use the generic implementation. Signed-off-by: Nick Piggin <[email protected]> Acked-By: David Howells <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Russell King <[email protected]> Cc: Haavard Skinnemoen <[email protected]> Cc: Bryan Wu <[email protected]> Cc: Mikael Starvik <[email protected]> Cc: David Howells <[email protected]> Cc: Yoshinori Sato <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Hirokazu Takata <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Roman Zippel <[email protected]> Cc: Greg Ungerer <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Kyle McMartin <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Kazumoto Kojima <[email protected]> Cc: Richard Curnow <[email protected]> Cc: William Lee Irwin III <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Jeff Dike <[email protected]> Cc: Paolo 'Blaisorblade' Giarrusso <[email protected]> Cc: Miles Bader <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Chris Zankel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-10-11[MIPS] Fix "no space between function name and open parenthesis" warnings.Ralf Baechle1-6/+6
Signed-off-by: Ralf Baechle <[email protected]>
2007-07-20[MIPS] Make support for weakly ordered LL/SC a config option.Ralf Baechle1-5/+5
None of weakly ordered processor supported in tree need this but it seems like this could change ... Signed-off-by: Ralf Baechle <[email protected]>
2007-06-26[MIPS] Remove a duplicated local variable in test_and_clear_bit()Atsushi Nemoto1-1/+1
Fix a sparse warning caused by 2c921d07f8c641e691b0dfd80a5cfe14c60ec489 include2/asm/bitops.h:313:23: warning: symbol 'res' shadows an earlier one include2/asm/bitops.h:309:16: originally declared here Signed-off-by: Atsushi Nemoto <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2007-06-11[MIPS] Fix smp barriers in test_and_{change,clear,set}_bitRalf Baechle1-32/+19
Signed-off-by: Ralf Baechle <[email protected]>
2007-03-17[MIPS] Lockdep: Fix recursion bug.Ralf Baechle1-12/+12
trace_hardirqs_off -> atomic_inc -> local_irq_restore -> trace_hardirqs_off Signed-off-by: Ralf Baechle <[email protected]>
2007-03-07[MIPS] R2 bitops compile fix for gcc < 4.0.Ralf Baechle1-23/+33
Signed-off-by: Ralf Baechle <[email protected]>
2007-02-18[MIPS] Use MIPS R2 instructions for bitops.Ralf Baechle1-1/+51
Add R2 optimized variants of clear_bit, set_bit and test_and_clear_bit. With gcc 4.1.1 this saves 1592 bytes on a defconfig (minus IPv6) kernel. Turns out that R2 bitop instructions are no gain for the other bitop functions. Signed-off-by: Ralf Baechle <[email protected]>
2007-02-13[MIPS] Improve branch prediction in ll/sc atomic operations.Ralf Baechle1-6/+27
Now that finally all supported versions of binutils have functioning support for .subsection use .subsection to tweak the branch prediction I did not modify the R10000 errata variants because it seems unclear if this will invalidate the workaround which actually relies on the cheesy prediction of branch likely to cause a misspredict if the sc was successful. Signed-off-by: Ralf Baechle <[email protected]>
2006-12-04[MIPS] Cleanup memory barriers for weakly ordered systems.Ralf Baechle1-19/+8
Also the R4000 / R4600 LL/SC instructions imply a sync so no explicit sync needed. Signed-off-by: Ralf Baechle <[email protected]>
2006-11-30[MIPS] Remove unused definition of cpu_to_lelongp()Ralf Baechle1-2/+0
Signed-off-by: Ralf Baechle <[email protected]>
2006-11-30[MIPS] Remove userspace proofing from <asm/bitops.h>.Ralf Baechle1-42/+21
Signed-off-by: Ralf Baechle <[email protected]>
2006-07-13[MIPS] TRACE_IRQFLAGS_SUPPORT support.Ralf Baechle1-1/+1
Signed-off-by: Ralf Baechle <[email protected]>
2006-04-29Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6David Woodhouse1-32/+24
2006-04-27[MIPS] Fix bitops for MIPS32/MIPS64 CPUs.Atsushi Nemoto1-32/+24
With recent rewrite for generic bitops, fls() for 32bit kernel with MIPS64_CPU is broken. Also, ffs(), fls() should be defined the same way as the libc and compiler built-in routines (returns int instead of unsigned long). Signed-off-by: Atsushi Nemoto <[email protected]> Signed-off-by: Ralf Baechle <[email protected]>
2006-04-26Don't include linux/config.h from anywhere else in include/David Woodhouse1-1/+0
Signed-off-by: David Woodhouse <[email protected]>
2006-03-26[PATCH] bitops: mips: use generic bitopsAkinobu Mita1-449/+16
- remove __{,test_and_}{set,clear,change}_bit() and test_bit() - unless defined(CONFIG_CPU_MIPS32) or defined(CONFIG_CPU_MIPS64) - remove __ffs() - remove ffs() - remove ffz() - remove fls() - remove fls64() - remove find_{next,first}{,_zero}_bit() - remove sched_find_first_bit() - remove generic_hweight64() - remove generic_hweight{32,16,8}() - remove ext2_{set,clear,test,find_first_zero,find_next_zero}_bit() - remove ext2_{set,clear}_bit_atomic() - remove minix_{test,set,test_and_clear,test,find_first_zero}_bit() Signed-off-by: Akinobu Mita <[email protected]> Cc: Ralf Baechle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-03-26[PATCH] bitops: use non atomic operations for minix_*_bit() and ext2_*_bit()Akinobu Mita1-3/+3
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-02-07[MIPS] Cleanup fls implementation.Ralf Baechle1-26/+32
fls was the only called of flz, so fold flz into fls, same for the __ilog2 call. Delete the now unused flz function. Signed-off-by: Ralf Baechle <[email protected]>
2006-01-03[FLS64]: generic versionStephen Hemminger1-1/+1
Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-10-29Fixup a few lose ends in explicit support for MIPS R1/R2.Ralf Baechle1-27/+27
Signed-off-by: Ralf Baechle <[email protected]>
2005-10-29Use clz / dclz on MIPS32 / MIPS64 processors.Ralf Baechle1-22/+115
Signed-off-by: Ralf Baechle <[email protected]>
2005-10-29Always use ".set mips3" rather than select between "mips2" or "mips3"Maciej W. Rozycki1-14/+12
for assembling ll/sc sequences to avoid problems with 64-bit configurations. Signed-off-by: Ralf Baechle <[email protected]>
2005-10-29Enable a suitable ISA for the assembler around ll/sc so that codeMaciej W. Rozycki1-24/+50
builds even for processors that don't support the instructions. Plus minor formatting fixes. Signed-off-by: Ralf Baechle <[email protected]>
2005-09-05[PATCH] mips: nuke trailing whitespaceRalf Baechle1-2/+2
Signed-off-by: Ralf Baechle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-09-05[PATCH] mips: clean up 32/64-bit configurationRalf Baechle1-4/+4
Start cleaning 32-bit vs. 64-bit configuration. Signed-off-by: Ralf Baechle <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+850
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!