aboutsummaryrefslogtreecommitdiff
path: root/arch/sh/lib
AgeCommit message (Collapse)Author
2013-01-14sh: Fix up stack debugging build.Paul Mundt
Somewhere along the line the ebss label was taken out, resulting in pcrel branch too far errors. Restore the label to get things building again. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2012-06-27mtd/uclinux: Use generic __bss_stop instead of _ebssGeert Uytterhoeven
The standard (see BSS_SECTION() in <asm-generic/vmlinux.lds.h> and <asm-generic/sections.h>) symbol for the end of BSS is __bss_stop. This allows to remove all local declarations that have been added to several architectures just to please CONFIG_MTD_UCLINUX. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Michal Simek <monstr@monstr.eu> Acked-by: Greg Ungerer <gerg@uclinux.org>
2011-02-15sh: Ensure ST40-300 BogoMIPS value is consistentStuart Menefy
A strange variation was seen in the BogoMIPS figure for the ST40-300. This was eventually tracked down to sensitivity to the alignment of the loop. So add an align directive to ensure this doesn't occur. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-23sh: change to new flag variablematt mooney
Replace EXTRA_CFLAGS with ccflags-y. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-05-24arch/sh/lib/strlen.S: Checkpatch cleanupAndrea Gelmini
arch/sh/lib/strlen.S:38: ERROR: trailing whitespace Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-03-01arch/sh/lib/libgcc.h: Checkpatch cleanupAndrea Gelmini
arch/sh/lib/libgcc.h:21: ERROR: open brace '{' following union go on the same line Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-11-24sh: Optimised memset for SH4Stuart Menefy
Optimised version of memset for the SH4 which uses movca.l. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-09-08sh: Kill off dcache writeback from copy_page().Paul Mundt
Now that the cache purging is handled manually by all copy_page() callers, we can kill off copy_page()'s on writeback. This optimizes the non-aliasing case. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-09-01Merge branch 'master' into sh/smpPaul Mundt
Conflicts: arch/sh/mm/cache-sh4.c
2009-08-24sh: Fix underflow in SH udelay() code.Stuart Menefy
Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-08-24sh: Remove implicit sign extension from assembler immediatesStuart Menefy
The SH instruction set has several instructions which accept an 8 bit immediate operand. For logical instructions this operand is zero extended, for arithmetic instructions the operand is sign extended. After adding an option to the assembler to check this, it was found that several pieces of assembly code were assuming this behaviour, and in one case getting it wrong. So this patch explicitly sign extends any immediate operands, which makes it obvious what is happening, and fixes the one case which got it wrong. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-27sh: Rename arch/sh/lib/clear_page.S -> __clear_user.S.Paul Mundt
Now that this only contains the __clear_user() function, rename it accordingly. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-27sh: wire up clear_user_highpage() for sh4, convert sh7705.Paul Mundt
This wires up clear_user_highpage() on SH-4 and subsequently converts the SH7705 32kB cache mode over to using it. Now that the SH-4 implementation handles all of the dcache purging directly in the aliasing case, there is no need to do this in the default clear_page() implementation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11sh: Fix up stack overflow check with ftrace disabled.Paul Mundt
Presently the STACK_CHECK() code is called in to multiple times, although it's only necessary from the mcount entry. The code still attempts to treat the nop case as an ftrace path resulting in superfluous code flow for the case where ftrace is disabled. And finally, this also fixes up references to a few undefined symbols when FUNCTION_TRACER=n. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11sh: Fix up ftrace build error when STACK_DEBUG=n.Paul Mundt
Presently the closest reference to function_trace_stop is within a CONFIG_STACK_DEBUG block. When this is turned off, the build bails out with a pcrel too far error. Reorder things a bit to handle the various combinations. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11sh: Decouple mcount from ftrace.Paul Mundt
This adds a general CONFIG_MCOUNT in order to permit mcount generation without ftrace support. This is primarily for allowing platforms to enable aggressive stack overflow checking without having to enable ftrace support. Based on the sparc64 implementation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11sh: Function graph tracer supportMatt Fleming
Add both dynamic and static function graph tracer support for sh. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-11sh: Provide diagnostic kernel stack checksMatt Fleming
Enable kernel stack checking code in both the dynamic ftrace and mcount code paths. Check the stack to see if it's overflowing and make sure that the stack pointer contains an address that's either in init_stack or after the bss. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-06sh: Add ftrace syscall tracing supportMatt Fleming
Now that I've added TIF_SYSCALL_FTRACE the thread flags do not fit into a single byte any more. Code testing them now needs to be aware of the upper and lower bytes. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-07-06sh: Define HAVE_FUNCTION_TRACE_MCOUNT_TESTMatt Fleming
Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST and test the value of function_trace_stop from our assembly code as opposed to using the generic C function. This should optimise our mcount/ftrace code path. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-29sh: Handle calling csum_partial with misaligned dataStuart Menefy
In rare circumstances csum_partial() can be called with data which is not 16 or 32 bit aligned. This is been observed with RPC calls for NFS file systems for example. Add support for handling this without resorting to the misaligned fixup code (which is why this hasn't been seen as a problem). This mimics the i386 version, which has had this support for some time. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: Add plain udivsi3 (not _i4*) for gcc-4.1 and lower.Takashi YOSHII
We chan't share code for udivsi3 and udivsi3_i4, because they have a different clobber list. Copy udivsi3 from gcc-4.1.2. As shown in arch/sh/lib/udivsi3.S (and -Os.S), .global __udivsi3_i4i .global __udivsi3_i4 .global __udivsi3 __udivsi3_i4i: ... Three symbols are sharing one code, which is actually udivsi3_i4i. But, this results unwanted code with gcc 4.1. In gcc, these three are treated as pseudo instructions that have their own clobber list apart from the usual calling convention. According to sh's machine description. The clobber list is as follows: - udivsi3_i4i : t,r1,pr,mach,macl - udivsi3_i4 : t,r0,r1,r4,r5,pr,dr0,dr2,dr4 - udivsi3 : t,r4,pr The caller of udivsi3 will be left with a broken r1 and mac*. gcc-4.1.x and older(at least to 3.4) generate udivsi3. ST's gcc-4.1.1 seems to be OK because it has _i4i. Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: Add exports for __udivsi3/__sdivsi3 and the _i4 versions.Paul Mundt
Needed by older compilers. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: Migrate necessary libgcc bits in to arch/sh/lib for SUPERH32.Paul Mundt
This moves in the necessary libgcc bits for SUPERH32 and drops the libgcc linking for the regular targets. This in turn allows us to rip out quite a few hacks both in sh_ksyms_32 and arch/sh/Makefile. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: dynamic ftrace support.Matt Fleming
First cut at dynamic ftrace support. Signed-off-by: Matt Fleming <mjf@gentoo.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-11-13sh: __copy_user function can corrupt the stack in case of exceptionStuart MENEFY
The __copy_user function can corrupt the stack in the case of a non-trivial length of data, and either of the first two move instructions cause an exception. This is because the fixup for these two instructions is mapped to the no_pop case, but these instructions execute after the stack is pushed. This change creates an explicit NO_POP exception mapping macro, and uses it for the two instructions executed in the trivial case where no stack pushes occur. More information at ST Linux bugzilla: https://bugzilla.stlinux.com/show_bug.cgi?id=4824 Signed-off-by: Dylan Reid <dylan_reid@bose.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-01sh: Fix up the __raw_read/writeX() definitions.Paul Mundt
These were doing largely bogus things and using the wrong typing for the address. Bring these in line with the ARM definitions. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-09-08sh: fixup many sparse errors.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28move arch/sh/lib/io.o to obj-yAdrian Bunk
EXPORT_SYMBOL's in lib-y considered harmful: <-- snip --> ... MODPOST 1837 modules ERROR: "__raw_readsl" [drivers/ssb/ssb.ko] undefined! ERROR: "__raw_writesl" [drivers/ssb/ssb.ko] undefined! ERROR: "__raw_writesl" [drivers/net/smc91x.ko] undefined! ERROR: "__raw_readsl" [drivers/net/smc91x.ko] undefined! ERROR: "__raw_writesl" [drivers/net/3c59x.ko] undefined! ERROR: "__raw_readsl" [drivers/net/3c59x.ko] undefined! ... make[2]: *** [__modpost] Error 1 <-- snip --> Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-05-16sh: Fix up optimized SH-4 memcpy on big endian.Hideo Saito
Signed-off-by: Hideo Saito <saito@densan.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-04-18sh: Allow optimized clear/copy page routines to be used on SH-2.Paul Mundt
Presently these are restricted to SH-3 and SH-4, so we reorder the ifdefs a bit to let other parts use these also. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: Explicit alignment for PAGE_SIZE in copy/clear_page().Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: Build fixes for lib32 clear_page.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: clear/copy_page renames in lib and lib64.Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: Move sh32 optimized I/O routines to arch/sh/lib/Paul Mundt
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07sh: Add -Werror for clean directories.Paul Mundt
Follow the MIPS and sparc64 changes for -Werror instrumentation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-13sh: Revert __xdiv64_32 size change.Paul Mundt
It's only __div64_32 that needs the fix, __xdiv64_32 behaves as expected with the original size. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-07-06sh: Correct __xdiv64_32/div64_32 return value size.Paul Mundt
These should be returning a uint32_t, whereas they were erroneously returning a u64 before. As the register sizes are 32-bits, this doesn't really make a lot of sense. Reported-by: Katsuya MATSUBARA <matsu@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-09sh: Fixup ndelay() xloops calculation for alternate HZ.kogiidena
Currently the xloops calculation in ndelay() gets set to 0 when calculated with HZ=250, fix up how we do the HZ factoring in order to get this right for differing values. Signed-off-by: kogiidena <kogiidena@eggplant.ddo.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-05-07sh: Kill off udivdi3 div64_32 wrapping.Paul Mundt
Previously we've been handling udivdi3 references and wrapping them in to div64_32() automatically. This doesn't get a lot of use, however, and as akpm noted in the recent thread on l-k: http://lkml.org/lkml/2007/2/27/241 we're better off simply ripping it out and going the do_div() route if there happen to be any places that need it. Signed-off-by: Paul Mundt <lethal@linux-sh.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>
2006-09-27sh: Fix memcpy() build error on sh4eb.Nobuhiro Iwamatsu
A trivial bug breaking the build on sh4eb. Signed-off-by: Nobuhiro Iwamatsu <hemamu@t-base.ne.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2006-09-27sh: Fix TCP payload csum bug in csum_partial_copy_generic().Ollie Wild
There's a bug in the Hitachi SuperH csum_partial_copy_generic() implementation. If the supplied length is 1 (and several alignment conditions are met), the function immediately branches to label 4. However, the assembly at label 4 expects the length to be stored in register r2. Since this has not occurred, subsequent behavior is undefined. This can cause bad payload checksums in TCP connections. I've fixed the problem by initializing register r2 prior to the branch instruction. Signed-off-by: Ollie Wild <aaw@rincewind.tv> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2006-09-27sh: Fix a sign extension bug in memset().Toshinobu Sugioka
Minor sign-extension bug in SH-specific memset().. Signed-off-by: Toshinobu Sugioka <sugioka@itonet.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.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>
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-04-16Linux-2.6.12-rc2Linus Torvalds
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!