summaryrefslogtreecommitdiff
path: root/arch/ppc/lib
AgeCommit message (Collapse)Author
2008-06-10powerpc: Remove arch/ppc and include/asm-ppcPaul Mackerras
All the maintained platforms are now in arch/powerpc, so the old arch/ppc stuff can now go away. Acked-by: Adrian Bunk <bunk@kernel.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Becky Bruce <becky.bruce@freescale.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Jochen Friedrich <jochen@scram.de> Acked-by: John Linn <john.linn@xilinx.com> Acked-by: Jon Loeliger <jdl@freescale.com> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Olof Johansson <olof@lixom.net> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: Scott Wood <scottwood@freescale.com> Acked-by: Sean MacLennan <smaclennan@pikatech.com> Acked-by: Segher Boessenkool <segher@kernel.crashing.org> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> Acked-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-04-24[POWERPC] Add strncmp to arch/ppcJosh Boyer
Commit 0119536cd314ef95553604208c25bc35581f7f0a added an assembly version of strncmp to PowerPC. However, it changed a common header file between arch/ppc and arch/powerpc without adding strncmp to arch/ppc. This fixes that omission so that arch/ppc links again. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-05-09[POWERPC] User rheap from arch/powerpc/libKumar Gala
Removed rheap in arch/ppc/lib and changed build system to use the one in arch/powerpc/lib. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-05-09[POWERPC] Change rheap functions to use ulongs instead of pointersTimur Tabi
The rheap allocation functions return a pointer, but the actual value is based on how the heap was initialized, and so it can be anything, e.g. an offset into a buffer. A ulong is a better representation of the value returned by the allocation functions. This patch changes all of the relevant rheap functions to use a unsigned long integers instead of a pointer. In case of an error, the value returned is a negative error code that has been cast to an unsigned long. The caller can use the IS_ERR_VALUE() macro to check for this. All code which calls the rheap functions is updated accordingly. Macros IS_MURAM_ERR() and IS_DPERR(), have been deleted in favor of IS_ERR_VALUE(). Also added error checking to rh_attach_region(). Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2007-04-26[STRING]: Move strcasecmp/strncasecmp to lib/string.cDavid S. Miller
We have several platforms using local copies of identical code. Signed-off-by: David S. Miller <davem@davemloft.net>
2007-02-08[POWERPC] PPC: Use ARRAY_SIZE macro when appropriateAhmed S. Darwish
Use ARRAY_SIZE macro already defined in linux/kernel.h Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Kumar Gala <galak@gate.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-30Remove obsolete #include <linux/config.h>Jörn Engel
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-28ppc: Fix compile error in arch/ppc/lib/strcase.cPaul Mackerras
Now that the strncasecmp implementation takes a size_t third parameter, we need to get a definition of size_t from somewhere. Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-03-27ppc: fix strncasecmp prototypeKumar Gala
Match, Linus's fix to arch/powerpc in arch/ppc. strcasecmp takes a size_t, not an int, as its third argument. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2006-02-10[PATCH] powerpc: trivial: modify comments to refer to new location of filesJon Mason
This patch removes all self references and fixes references to files in the now defunct arch/ppc64 tree. I think this accomplises everything wanted, though there might be a few references I missed. Signed-off-by: Jon Mason <jdmason@us.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-17ppc32: use L1_CACHE_SHIFT/L1_CACHE_BYTESStephen Rothwell
instead of L1_CACHE_LINE_SIZE and LG_L1_CACHE_LINE_SIZE Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
2005-09-14[LIB]: Consolidate _atomic_dec_and_lock()David S. Miller
Several implementations were essentialy a common piece of C code using the cmpxchg() macro. Put the implementation in one spot that everyone can share, and convert sparc64 over to using this. Alpha is the lone arch-specific implementation, which codes up a special fast path for the common case in order to avoid GP reloading which a pure C version would require. Signed-off-by: David S. Miller <davem@davemloft.net>
2005-09-10[PATCH] spinlock consolidationIngo Molnar
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 <grundler@parisc-linux.org> 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" <tony.luck@intel.com> ia64 fix Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjanv@infradead.org> Signed-off-by: Grant Grundler <grundler@parisc-linux.org> Cc: Matthew Wilcox <willy@debian.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Mikael Pettersson <mikpe@csd.uu.se> Signed-off-by: Benoit Boissinot <benoit.boissinot@ens-lyon.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-21[PATCH] smp_processor_id() cleanupIngo Molnar
This patch implements a number of smp_processor_id() cleanup ideas that Arjan van de Ven and I came up with. The previous __smp_processor_id/_smp_processor_id/smp_processor_id API spaghetti was hard to follow both on the implementational and on the usage side. Some of the complexity arose from picking wrong names, some of the complexity comes from the fact that not all architectures defined __smp_processor_id. In the new code, there are two externally visible symbols: - smp_processor_id(): debug variant. - raw_smp_processor_id(): nondebug variant. Replaces all existing uses of _smp_processor_id() and __smp_processor_id(). Defined by every SMP architecture in include/asm-*/smp.h. There is one new internal symbol, dependent on DEBUG_PREEMPT: - debug_smp_processor_id(): internal debug variant, mapped to smp_processor_id(). Also, i moved debug_smp_processor_id() from lib/kernel_lock.c into a new lib/smp_processor_id.c file. All related comments got updated and/or clarified. I have build/boot tested the following 8 .config combinations on x86: {SMP,UP} x {PREEMPT,!PREEMPT} x {DEBUG_PREEMPT,!DEBUG_PREEMPT} I have also build/boot tested x64 on UP/PREEMPT/DEBUG_PREEMPT. (Other architectures are untested, but should work just fine.) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-20[PATCH] ppc32: Fix __copy_tofrom_user return valuePaul Mackerras
Recently the __copy_tofrom_user routine was modified to avoid doing prefetches past the end of the source array. However, in doing so we introduced a bug in that it now returns the wrong value for the number of bytes not copied when a fault is encountered. This fixes it to return the correct number. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-02-04[PATCH] Fix PPC rwlock code on SMPPaul Mackerras
Currently, the kernel won't compile for SMP ppc32 if preempt is enabled. This patch adds suitable read_can_lock and write_can_lock definitions. This patch also adds a real _raw_read_trylock (inline and out-of-line versions), changes the rwlock->lock field to a signed int, which is what it really was all along, and cleans up the out-of-line rwlock code in arch/ppc/lib/locks.c. It removes the debug fields from the rwlock struct because we were never using them, even with CONFIG_DEBUG_SPINLOCK set. I have compile and boot tested this with the four combinations of CONFIG_DEBUG_SPINLOCKS on and off, and CONFIG_PREEMPT on and off. Please put this patch into 2.6.11 so that 2.6.11 will work for ppc32 with CONFIG_SMP and CONFIG_PREEMPT. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-01-23[PATCH] removing bcopy... because it's half brokenArjan van de Ven
Nothing in the kernel is using bcopy right know, and that is a good thing. Why? Because a lot of the architectures implement a broken bcopy().... the userspace standard bcopy() is basically a memmove() with a weird parameter order, however a bunch of architectures implement a memcpy() not a memmove(). Instead of fixing this inconsistency, I decided to remove it entirely, explicit memcpy() and memmove() are prefered anyway (welcome to the 1990's) and nothing in the kernel is using these functions, so this saves code size as well for everyone. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Adrian Bunk <bunk@stusta.de> [ Side note: the only reason for bcopy appears to be totally ancient gcc versions for OSF/1, used to originally cross-compile Linux on alpha. Possibly some other similar cases. Time to move on ;-] Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-10[PATCH] ppc32: fix rheap warningKumar Gala
Here is patch that fixes a compile warning with rheap Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-30Make "atomic_dec_and_lock()" a macro.Linus Torvalds
We rename the actual architecture-specific low-level implementation to have a prepended underscore: "_atomic_dec_and_lock()". This extra macro indirection is so that we can make the macro do the lock context counting. That will be the next patch.
2004-10-07[PATCH] PPC64 Replace cmp instructions with cmpw/cmpdDavid Woodhouse
On Fri, 2004-10-08 at 15:37 +1000, Paul Mackerras wrote: > This patch replaces cmp{,l}{,i} with cmp{,l}[wd]{,i} as appropriate. > The original patch was from Segher Boessenkool, slightly modified by > me. And also for ppc32 and arch/ppc64/kernel/ItLpQueue.c... Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-14ppc32: Fix some warnings in rheap from newer compilersTom Rini
Signed-off-by: Pantelis Antoniou <panto@intracom.gr> Signed-off-by: Tom Rini <trini@kernel.crashing.org>
2004-07-15ppc32: reworked cpm alloc functionsKumar Gala
* Unified function names between CPM1 & CPM2 * changed rheap to use ERR_PTR * fixed drivers to use new functions and names
2004-06-22[PPC32] Update CPM2 (MPC82xx/MPC85xx) code to use rheap for DP memoryTom Rini
Originally from: Rune Torgersen <runet@innovsys.com> Signed-off-by: Tom Rini <trini@kernel.crashing.org>
2004-06-22[PPC32] Change how we handle DP memory on MPC8xx.Tom Rini
We now have a 'remote heap' implemented (see comments in arch/ppc/lib/rheap.c) which manages this memory. From Pantelis Antoniou <panto@intracom.gr>. Signed-off-by: Tom Rini <trini@kernel.crashing.org>
2004-06-03[PATCH] ppc32: Fix locks.c properly this timePaul Mackerras
When I moved the exports into arch/ppc/lib/locks.c, I forgot to include module.h, so it doesn't compile (with CONFIG_SMP + CONFIG_SPINLOCK_DEBUG). This patch fixes it. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-06-02[PATCH] ppc32: Add _raw_write_trylockPaul Mackerras
I tried compiling a PPC32 kernel with PREEMPT + SMP and it failed because we didn't have a _raw_write_trylock. This patch adds _raw_write_trylock, moves the exports of _raw_*lock from arch/ppc/kernel/ppc_ksyms.c to arch/ppc/lib/locks.c, and makes __spin_trylock static since it is only used in locks.c. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-05-14[PATCH] PPC32: Fix copy prefetch on non coherent PPCsAndrew Morton
From: Matt Porter <mporter@kernel.crashing.org> This patch fixes the condition where prefetching cache lines beyond a buffer can cause data corruption on non cache coherent PPCs. It is a port of the version that went into 2.4. From Eugene Surovegin <ebs@ebshome.net>.
2003-09-22PPC32: Minor cleanups.Tom Rini
2003-09-11PPC32: Remove trailing blanks from PPC32 files.Tom Rini
2003-08-05PPC32: Make strncpy clear the unused part of the destination.Paul Mackerras
2003-02-03kbuild: Remove export-objs := ... statementsKai Germaschewski
One of the goals of the whole new modversions implementation: export-objs is gone for good!
2003-01-14PPC32: Fix copy_from_user to copy as much as possible.Dale Farnsworth
copy_from_user is supposed to transfer as much data as is valid and then to return the number of bytes not tranferred. That's how it works on x86. On ppc it can be as much as 15 bytes short. I initially saw the problem with the mount system call. Note that the fifth argument to mount is an address 8 bytes from the end of user data space. There is a null byte at that address, since no mount options are being passed. In the kernel, sys_mount() allocates a page for the options and does copy_from_user(new_page, 0x1005eff8, PAGE_SIZE). copy_from_user should copy 8 bytes and return (PAGE_SIZE-8). Instead, on ppc it reads 8 bytes, faults, writes no bytes, and returns PAGE_SIZE, which causes the EFAULT to be erroneously reported.
2002-12-14[PATCH] Remove Rules.make from Makefiles (1/3)Brian Gerst
Makefiles no longer need to include Rules.make, which is currently an empty file. This patch removes it from the arch tree Makefiles.
2002-10-19PPC32: make do_div handle all 64 bits of the dividend (not just 32).Paul Mackerras
We do this with an out-of-line assembler function, __div64_32, for the case when the high word of the dividend is non-zero.
2002-09-22kbuild: arch/ppc cleanup / O_TARGET removalKai Germaschewski
2002-09-17PPC32: Rip out the BK Id tags from arch/ppc and include/asm-ppc.Paul Mackerras
The tags were slightly useful when the kernel maintainers weren't using BK, but these days they are more trouble than they are worth. They tend to cause patch rejects, and often end up getting turned into the fixed form (rather than the %x% tag form).
2002-06-26PPC32: Fixes for bugs in exception handling in copy_to_user and clear_user.Paul Mackerras
2002-06-08[PATCH] 2.5.20 locks.h cleanupMartin Dalecki
Since I have been looking in to the lcoking issues recently the following rather trivial gabrage code collection became obvious... - Remove "not yet used" code from 1995 in asm/locks.h. It's garbage. - Remove useless DEBUG_SPINLOCK code from generic spinlock.h code. Just compiling for SMP does the trick already. - Replace all usages of SPINLOCK_DEBUG with the now global CONFIG_DEBUG_SPINLOCK.
2002-05-20kbuild: Make USE_STANDARD_AS_RULE defaultKai Germaschewski
2002-03-03PPC update for the recent changes to the pgd/pmd/pte functions.Paul Mackerras
This implements ptes-in-highmem for PPC, removes the quicklist and zero-page stuff. PTEs in highmem on SMP turned out to need some significant changes to avoid deadlocks on the hash_table_lock (now renamed to mmu_hash_lock). The PMDs now contain the physical address of the PTE page rather than the virtual address. Anything that takes the mmu_hash_lock now operates with the DMMU off to avoid MMU hash-table misses.
2002-02-16PPC fixes for SMP; also fix the stack overflow detection, removePaul Mackerras
various bits of cruft, and remove the third argument to switch_to.
2002-02-11Import arch/ppc and include/asm-ppc changes from linuxppc_2_5 treePaul Mackerras
2002-02-04v2.4.14.5 -> v2.4.14.6Linus Torvalds
- Russell King: /proc/cpuinfo for ARM - Paul Mackerras: PPC update (cpuinfo etc) - Nicolas Aspert: fix Intel 8xx agptlb flush - Marko Myllynen: "Lindent" doesn't really need bash ;) - Alexander Viro: /proc/cpuinfo for s390/s390x/sh, /proc/pci cleanup - Alexander Viro: make lseek work on seqfiles
2002-02-04v2.4.13.7 -> v2.4.13.8Linus Torvalds
- Andrea: fix races in do_wp_page, free_swap_and_cache - me: clena up page dirty handling - Tim Waugh: parport IRQ probing and documentation fixes - Greg KH: USB updates - Michael Warfield: computone driver update - Randy Dunlap: add knowledge about some new io-apics - Richard Henderson: alpha updates - Trond Myklebust: make readdir xdr verify the reply packet - Paul Mackerras: PPC update - Jens Axboe: make cpqarray and cciss play nice with the request layer - Massimo Dal Zotto: SMM driver for Dell Inspiron 8000 - Richard Gooch: devfs symlink deadlock fix - Anton Altaparmakov: make NTFS compile on sparc
2002-02-04v2.4.9.1 -> v2.4.9.2Linus Torvalds
- Al Viro: block device cleanups - Marcelo Tosatti: make bounce buffer allocations more robust (it's ok for them to do IO, just not cause recursive bounce IO. So allow them) - Anton Altaparmakov: NTFS update (1.1.17) - Paul Mackerras: PPC update (big re-org) - Petko Manolov: USB pegasus driver fixes - David Miller: networking and sparc updates - Trond Myklebust: Export atomic_dec_and_lock - OGAWA Hirofumi: find and fix umsdos "filldir" users that were broken by the 64-bit-cleanups. Fix msdos warnings. - Al Viro: superblock handling cleanups and race fixes - Johannes Erdfelt++: USB updates
2002-02-04v2.4.4.4 -> v2.4.4.5Linus Torvalds
- Al Viro: fs cleanups - David Miller: sparc semaphores - Christoph Hellwig: VxFS update - Asit Mallick: set machine check bit with set_in_cr4 - Richard Henderson: fix alpha pci_controller_num(), sg_fill, SRM poweroff. - Johannes Erdfelt: USB updates - Cort Dougan: bitkeeper Id's on the ppc side - Matt Chapman: NFS file locking SMP lock fix - Alan Cox: further merging
2002-02-04v2.4.4.2 -> v2.4.4.3Linus Torvalds
- Al Viro: sanity-check user arguments, zero-terminated strings etc. - Urban Widmark: smbfs update (server/client cache coherency etc) - Rik van Riel, Marcelo Tosatti: VM updates - Cort Dougan: PPC updates - Neil Brown: raid1/5 failed drive fixups, NULL ptr checking, md error cleanup - Neil Brown: knfsd fix for 64-bit architectures, and filehandle resolveir - Ken Brownfield: workaround for menuconfig CPU selection glitch - David Miller: sparc64 MM setup fix, arpfilter forward port - Keith Owens: Remove obsolete IPv6 provider based addressing - Jari Ruusu: block_write error case cleanup fix - Jeff Garzik: netdriver update
2002-02-04v2.4.0.9 -> v2.4.0.10Linus Torvalds
- got a few too-new R128 #defines in the Radeon merge. Fix. - tulip driver update from Jeff Garzik - more cpq and DAC elevator fixes from Jens. Looks good. - Petr Vandrovec: nicer ncpfs behaviour - Andy Grover: APCI update - Cort Dougan: PPC update - David Miller: sparc updates - David Miller: networking updates - Neil Brown: RAID5 fixes
2002-02-04Import changesetLinus Torvalds