aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc/lib
AgeCommit message (Collapse)AuthorFilesLines
2008-12-09sparc: Unify strlen assembler.David S. Miller3-102/+21
Use the new asm/asm.h header to help commonize the strlen assembler between 32-bit and 64-bit While we're here, use proper linux/linkage.h macros instead of by-hand stuff. Signed-off-by: David S. Miller <[email protected]>
2008-12-08sparc: Kill memcmp_32.S code which has been ifdef'd out for centuries.David S. Miller1-282/+0
Signed-off-by: David S. Miller <[email protected]>
2008-12-04sparc,sparc64: unify lib/Sam Ravnborg49-0/+6493
o Renamed files in sparc64 to <name>_64.S when identical to sparc32 files. o iomap.c were equal for sparc32 and sparc64 o adjusted sparc/Makefile now we have only one lib/ Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-12-04sparc: prepare lib/ for unificationSam Ravnborg10-8/+17
Identical named files renamed to <name>_32.S Refactored Makefile to prepare for unification. Linking order was altered slightly - but this is a lib.a file so it should not matter. Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-05-20sparc: remove CVS keywordsAdrian Bunk15-15/+13
This patch removes the CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-04-29iomap: fix 64 bits resources on 32 bitsBenjamin Herrenschmidt1-2/+2
Almost all implementations of pci_iomap() in the kernel, including the generic lib/iomap.c one, copies the content of a struct resource into unsigned long's which will break on 32 bits platforms with 64 bits resources. This fixes all definitions of pci_iomap() to use resource_size_t. I also "fixed" the 64bits arch for consistency. Signed-off-by: Benjamin Herrenschmidt <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-01-31[SPARC/SPARC64]: Fix usage of .section .sched.text in assembler code.Sam Ravnborg1-1/+1
ld will generate an unique named section when assembler do not use "ax" but gcc does. Add the missing annotation. Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-08-26[SPARC32]: Add __cmpdi2() libcall implementation ala. MIPS.David S. Miller3-1/+47
Device mapper generates calls to this with recent versions of gcc. Signed-off-by: David S. Miller <[email protected]>
2007-07-24[SPARC32]: Fix bug in sparc optimized memset.Alexander Shmelev1-1/+1
Sparc optimized memset (arch/sparc/lib/memset.S) does not fill last byte of the memory area, if area size is less than 8 bytes and start address is not word (4-bytes) aligned. Here is code chunk where bug located: /* %o0 - memory address, %o1 - size, %g3 - value */ 8: add %o0, 1, %o0 subcc %o1, 1, %o1 bne,a 8b stb %g3, [%o0 - 1] This code should write byte every loop iteration, but last time delay instruction stb is not executed because branch instruction sets "annul" bit. Patch replaces bne,a by bne instruction. Error can be reproduced by simple kernel module: -------------------- #include <linux/module.h> #include <linux/config.h> #include <linux/kernel.h> #include <linux/errno.h> #include <string.h> static void do_memset(void **p, int size) { memset(p, 0x00, size); } static int __init memset_test_init(void) { char fooc[8]; int *fooi; memset(fooc, 0xba, sizeof(fooc)); do_memset((void**)(fooc + 3), 1); fooi = (int*) fooc; printk("%08X %08X\n", fooi[0], fooi[1]); return -1; } static void __exit memset_test_cleanup(void) { return; } module_init(memset_test_init); module_exit(memset_test_cleanup); MODULE_LICENSE("GPL"); EXPORT_NO_SYMBOLS; -------------------- Signed-off-by: Alexander Shmelev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-05-31[SPARC32]: Build fix.Andrew Morton1-2/+2
Fix 6197fe4d720ea3e2ee94cdc7ef32d6c0151199de arch/sparc/lib/atomic32.c: In function '__cmpxchg_u32': arch/sparc/lib/atomic32.c:127: error: 'addr' undeclared (first use in this function) arch/sparc/lib/atomic32.c:127: error: (Each undeclared identifier is reported only once arch/sparc/lib/atomic32.c:127: error: for each function it appears in.) I assume this is what was intended.. Signed-off-by: Andrew Morton <[email protected]> Acked-by: William Irwin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-05-29[SPARC]: Emulate cmpxchg like pariscKyle McMartin1-0/+15
Signed-off-by: Kyle McMartin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap1-1/+0
Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-03-26[SPARC32]: Fix SMP build regressionRobert Reif1-0/+2
commit b19cbe2a1695c09c74f83646c4b82b51123b3690 [BRIDGE]: Fix fdb RCU race breaks sparc SMP build because atomic_add_unless is not exported. This patch exports atomic_add_unless and atomic_cmpxchg. Signed-off-by: Robert Reif <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-12-17[SPARC]: Make bitops use same spinlocks as atomics.David S. Miller3-111/+41
Recent workqueue changes basically make this a formal requirement. Also, move atomic32.o from lib-y to obj-y since it exports symbols to modules. Signed-off-by: David S. Miller <[email protected]>
2006-10-08[PATCH] sparc32 rwlock fixAl Viro1-0/+20
read_trylock() is broken on sparc32 (doesn't build and didn't work right, actually). Proposed fix: - make "writer holds lock" distinguishable from "reader tries to grab lock" - have __raw_read_trylock() try to acquire the mutex (in LSB of lock), terminating spin if we see that there's writer holding it. Then do the rest as we do in read_lock(). Thanks to Ingo for discussion... Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-09-29[SPARC]: Don't zero out tail during copy_from_user_inatomic().David S. Miller1-0/+4
Actually, since we use the same code for all the copying types in and out of userspace, we check at runtime whether preemption is disabled. Signed-off-by: David S. Miller <[email protected]>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel3-3/+0
Signed-off-by: Jörn Engel <[email protected]> Signed-off-by: Adrian Bunk <[email protected]>
2006-06-25[SPARC]: Add iomap interfaces.David S. Miller2-0/+50
Signed-off-by: David S. Miller <[email protected]>
2005-12-12[SPARC]: atomic_clear_mask build fixPaul Jackson1-1/+0
This fixes one build error introduced in sparc with the patch of Oct 30, resent Nov 4 "[patch 3/5] atomic: atomic_inc_not_zero" I still can't get sparc to build, but at least it gets further after I remove this line. Apparently, this change was agreed to by Andrew and Nick on Nov 14, but everyone thought someone else was doing it. Signed-off-by: Paul Jackson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2005-11-13[PATCH] atomic: inc_not_zeroNick Piggin1-0/+15
Introduce an atomic_inc_not_zero operation. Make this a special case of atomic_add_unless because lockless pagecache actually wants atomic_inc_not_negativeone due to its offset refcount. Signed-off-by: Nick Piggin <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-11-13[PATCH] atomic: cmpxchgNick Piggin1-5/+16
Introduce an atomic_cmpxchg operation. Signed-off-by: Nick Piggin <[email protected]> Cc: "Paul E. McKenney" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-11-13[PATCH] m68k: thread_info header cleanupAl Viro1-0/+1
a) in smp_lock.h #include of sched.h and spinlock.h moved under #ifdef CONFIG_LOCK_KERNEL. b) interrupt.h now explicitly pulls sched.h (not via smp_lock.h from hardirq.h as it used to) c) in three more places we need changes to compensate for (a) - one place in arch/sparc needs string.h now, hardirq.h needs forward declaration of task_struct and preempt.h needs direct include of thread_info.h. d) thread_info-related helpers in sched.h and thread_info.h put under ifndef __HAVE_THREAD_FUNCTIONS. Obviously safe. Signed-off-by: Al Viro <[email protected]> Signed-off-by: Roman Zippel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-09-11[SPARC]: Fix dot-symbol exporting for good.Al Viro6-0/+12
From: Al Viro <[email protected]> Instead of playing all of these hand-coded assembler aliasing games, just translate symbol names in the name space ".sym" to "_Sym" at module load time. Signed-off-by: David S. Miller <[email protected]>
2005-09-10[PATCH] spinlock consolidationIngo Molnar2-204/+0
This patch (written by me and also containing many suggestions of Arjan van de Ven) does a major cleanup of the spinlock code. It does the following things: - consolidates and enhances the spinlock/rwlock debugging code - simplifies the asm/spinlock.h files - encapsulates the raw spinlock type and moves generic spinlock features (such as ->break_lock) into the generic code. - cleans up the spinlock code hierarchy to get rid of the spaghetti. Most notably there's now only a single variant of the debugging code, located in lib/spinlock_debug.c. (previously we had one SMP debugging variant per architecture, plus a separate generic one for UP builds) Also, i've enhanced the rwlock debugging facility, it will now track write-owners. There is new spinlock-owner/CPU-tracking on SMP builds too. All locks have lockup detection now, which will work for both soft and hard spin/rwlock lockups. The arch-level include files now only contain the minimally necessary subset of the spinlock code - all the rest that can be generalized now lives in the generic headers: include/asm-i386/spinlock_types.h | 16 include/asm-x86_64/spinlock_types.h | 16 I have also split up the various spinlock variants into separate files, making it easier to see which does what. The new layout is: SMP | UP ----------------------------|----------------------------------- asm/spinlock_types_smp.h | linux/spinlock_types_up.h linux/spinlock_types.h | linux/spinlock_types.h asm/spinlock_smp.h | linux/spinlock_up.h linux/spinlock_api_smp.h | linux/spinlock_api_up.h linux/spinlock.h | linux/spinlock.h /* * here's the role of the various spinlock/rwlock related include files: * * on SMP builds: * * asm/spinlock_types.h: contains the raw_spinlock_t/raw_rwlock_t and the * initializers * * linux/spinlock_types.h: * defines the generic type and initializers * * asm/spinlock.h: contains the __raw_spin_*()/etc. lowlevel * implementations, mostly inline assembly code * * (also included on UP-debug builds:) * * linux/spinlock_api_smp.h: * contains the prototypes for the _spin_*() APIs. * * linux/spinlock.h: builds the final spin_*() APIs. * * on UP builds: * * linux/spinlock_type_up.h: * contains the generic, simplified UP spinlock type. * (which is an empty structure on non-debug builds) * * linux/spinlock_types.h: * defines the generic type and initializers * * linux/spinlock_up.h: * contains the __raw_spin_*()/etc. version of UP * builds. (which are NOPs on non-debug, non-preempt * builds) * * (included on UP-non-debug builds:) * * linux/spinlock_api_up.h: * builds the _spin_*() APIs. * * linux/spinlock.h: builds the final spin_*() APIs. */ All SMP and UP architectures are converted by this patch. arm, i386, ia64, ppc, ppc64, s390/s390x, x64 was build-tested via crosscompilers. m32r, mips, sh, sparc, have not been tested yet, but should be mostly fine. From: Grant Grundler <[email protected]> Booted and lightly tested on a500-44 (64-bit, SMP kernel, dual CPU). Builds 32-bit SMP kernel (not booted or tested). I did not try to build non-SMP kernels. That should be trivial to fix up later if necessary. I converted bit ops atomic_hash lock to raw_spinlock_t. Doing so avoids some ugly nesting of linux/*.h and asm/*.h files. Those particular locks are well tested and contained entirely inside arch specific code. I do NOT expect any new issues to arise with them. If someone does ever need to use debug/metrics with them, then they will need to unravel this hairball between spinlocks, atomic ops, and bit ops that exist only because parisc has exactly one atomic instruction: LDCW (load and clear word). From: "Luck, Tony" <[email protected]> ia64 fix Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Grant Grundler <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Hirokazu Takata <[email protected]> Signed-off-by: Mikael Pettersson <[email protected]> Signed-off-by: Benoit Boissinot <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-09-09[PATCH] more SPIN_LOCK_UNLOCKED -> DEFINE_SPINLOCK conversionsIngo Molnar1-1/+1
This converts the final 20 DEFINE_SPINLOCK holdouts. (another 580 places are already using DEFINE_SPINLOCK). Build tested on x86. Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds32-0/+7186
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!