Commit Graph

449 Commits

Author SHA1 Message Date
Paul Mundt
63e2c80332 sh: Plug in SH-5 ffz()/__ffs() bitops.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:45 +09:00
Paul Mundt
8a7bcf0dd0 sh: Add SH-5 support to the consistent DMA impl.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:44 +09:00
Paul Mundt
acb499f0dd sh: Move vsyscall_init() defs up one level.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:44 +09:00
Paul Mundt
f3ef75b773 sh: Nopped out p3_cache_init() on SH-5 also.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:44 +09:00
Paul Mundt
0468b4bb12 sh: Fix up VMALLOC_START for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:44 +09:00
Paul Mundt
959f7d587e sh: Move over the SH-5 head.S and tlb.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:44 +09:00
Paul Mundt
256b22ca66 sh: Have SH-5 provide an {en,dis}able_fpu() impl.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:44 +09:00
Paul Mundt
781c63e68d sh: timer.h stub for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:43 +09:00
Paul Mundt
f7a7b15344 sh: Move in the SH-5 signal trampoline impl.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:43 +09:00
Paul Mundt
76168c21b7 sh: More SH-5 cpuinfo tidying.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:43 +09:00
Paul Mundt
01fed9311a sh: Consolidate slab/kmalloc minalign values.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:43 +09:00
Paul Mundt
9b01bd9ee6 sh: Split out uaccess.h in to _32 and _64 variants.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt
c0acca6789 sh: SH-5 also uses the ASID cache.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt
a62a3861e0 sh: Split out system.h in to _32 and _64 variants.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt
36bcd39dbc sh: Split out 29-bit and 32-bit physical mode definitions.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt
af3c7dfe82 sh: Split out processor.h in to _32 and _64 variants.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt
33f242ed11 sh: SH-5 pt_regs.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:42 +09:00
Paul Mundt
cdcc970829 sh: Move in the SH-5 mmu_context headers.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:41 +09:00
Paul Mundt
7a65eaf488 sh: SH-5 byteorder routines.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:41 +09:00
Paul Mundt
114f132975 sh: SH-5 version of current_thread_info().
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:40 +09:00
Paul Mundt
f64ee87614 sh: Split out irqflags.h in to _32 and _64 variants.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:40 +09:00
Paul Mundt
7960a1d02b sh: Split out asm/string.h for sh32 and sh64.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:40 +09:00
Paul Mundt
da06b8d054 sh: Add SH-5 support to io.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:40 +09:00
Paul Mundt
3b9e78868d sh: Add in cacheflush and DMA headers for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:40 +09:00
Paul Mundt
0fa70efbd4 sh: Correct SH-5 instruction size value.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:40 +09:00
Paul Mundt
d752542ade sh: Add cache definitions for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:39 +09:00
Paul Mundt
a096a7e476 sh: Add addrspace.h segmentation stub for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:39 +09:00
Paul Mundt
e1cd93ea44 sh: BUGFLAG_WARNING needs GENERIC_BUG.
Move the HAVE_ARCH_BUG/HAVE_ARCH_WARN_ON definitions underneath
CONFIG_GENERIC_BUG. This is needed for BUGFLAG_WARNING usage.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:39 +09:00
Paul Mundt
5a4a5bd127 sh: Fix up fixmap location for SH-5.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:39 +09:00
Paul Mundt
34cd6d3ab4 sh: Add SH-5 support to asm/module.h.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:39 +09:00
Paul Mundt
8d5fb297cc sh: Split out cache status bits per-CPU family.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:38 +09:00
Paul Mundt
5a668651bf sh: Split out PXSEG segmentation per-CPU family.
The CPU family abstraction already exists, so move out the PXSEG
definition for each one. SH-2A already has this special cased,
and SH-5 will as well.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28 13:18:38 +09:00
Paul Mundt
d7587b1445 sh: Force __access_ok() to obey address space limit.
When the thread_info->addr_limit changes were introduced, __access_ok()
was missed in the conversion, allowing user processes to perform P1/P2
accesses under certain conditions.

This has already been corrected with the nommu refactoring in later
kernels.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-11 13:18:16 +09:00
Carmelo Amoroso
844b43adba sh: Fix argument page dcache flushing regression.
In the do_execve() path, argument page handling used to explicitly call
flush_dcache_page() for each page, this has since been reworked and
uses flush_kernel_dcache_page() instead, which is presently a nop.

Doing a simple modprobe/rmmod in a loop under busybox consistently
manages to crash without providing a sane flush_kernel_dcache_page()
implementation, so, plug in a simple implementation.

Signed-off-by: Carmelo Amoroso <carmelo73@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-07 13:50:18 +09:00
Heiko Schocher
0349337467 sh: Fix copy_{to,from}_user_page() with cache disabled.
Signed-off-by: Heiko Schocher <heiko.schocher@invitel.hu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-19 12:55:51 +09:00
Jiri Olsa
3d9144c222 sh: remove dead config symbols from SH code
Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-09 04:45:29 +09:00
Paul Mundt
541c547731 Merge branch 'page_colouring_despair' 2007-11-08 17:01:42 +09:00
Paul Mundt
cbeb13447f sh: Add a dummy vga.h.
We have nothing to do here, but there are continually drivers that
fail to build without it. Stub it in.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 20:19:30 +09:00
Paul Mundt
ac11584ccb sh: Fix up PAGE_KERNEL_PCC() for nommu.
PAGE_KERNEL_PCC() takes two arguments, which weren't reflected in the
nommu case. Fix it up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:40:24 +09:00
Paul Mundt
af39c16bd8 sh: Kill off __{copy,clear}_user_page().
Now that copy_to_user_page()/copy_from_user_page() are wired up, we
can drop the old __copy_xxx() implementations. Now that the page
colouring scheme has changed via kmap_coherent(), we can avoid the
flush in these specific helpers.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:14:12 +09:00
Paul Mundt
ba1789efea sh: Optimized copy_{to,from}_user_page() for SH-4.
This moves copy_{to,from}_user_page() out-of-line on SH-4 and
converts for the kmap_coherent() API. Based on the MIPS
implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:14:12 +09:00
Paul Mundt
7747b9a493 sh: Wire up clear_user_highpage().
With the kmap_coherent() API in place, this is trivial to implement,
and lets us avoid the cache flush in certain cases.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:14:12 +09:00
Paul Mundt
f966918724 sh: Kill off the remaining ST40 cruft.
The ST40 stuff in-tree hasn't built for some time, and hasn't been
updated for over 3 years. ST maintains their own out-of-tree changes
and rebases occasionally, and that's ultimately where all of the ST40
users go anyways.

In order for the ST40 code to be brought up to date most of the stuff
removed in this changeset would have to be rewritten anyways, so there's
very little benefit in keeping the remnants around either.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:13:55 +09:00
Mike Frysinger
b5f2d739e1 sh: remove PTRACE_O_TRACESYSGOOD from asm/ptrace.h
The common linux/ptrace.h already defines PTRACE_O_TRACESYSGOOD so there is no
need to have arches do it.  This also keeps glibc-2.7 from breaking since it
has an enum for the PTRACE_O_* flags.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-07 11:13:54 +09:00
Paul Mundt
110ed28246 sh: Decouple 4k and soft/hardirq stacks.
While using separate IRQ stacks can cut down on stack consumption,
many users can also use 4k stacks directly without the additional
need of separate stacks for soft and hardirqs.

With this split, we support the same rationale for 4KSTACKS as
m68knommu, with the IRQSTACKS abstraction as per ppc64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-11-02 12:16:51 +09:00
Paul Mundt
121fc47db6 sh: Provide a __read_mostly section wrapper.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-10-30 17:39:07 +09:00
Paul Mundt
69d1ef4caf sh: Move zero page param defs somewhere sensible.
Follows s390 and others.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-10-30 17:32:08 +09:00
Paul Mundt
2278caa3c8 sh: Use generic SMP_CACHE_BYTES/L1_CACHE_ALIGN.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-10-30 17:28:52 +09:00
Paul Mundt
afca035745 sh: Correct pte_page() breakage.
As noted by David:

pte_page() is a macro defined as follows;

    include/asm-sh/pgtable.h
    #define pte_page(x)    phys_to_page(pte_val(x)&PTE_PHYS_MASK)

    include/asm-sh/page.h
    #define phys_to_page(phys)    (pfn_to_page(phys >> PAGE_SHIFT))

So as you can see the phys_to_page() macro doesn't wrap the 'phys'
parameter in parentheses so we end up with;

    pte_val(x)&PTE_PHYS_MASK >> PAGE_SHIFT

Which is not what we wanted as '>>' has a higher precedence than bitwise
AND. I dug into the git repository and I believe this bug was added with
this commit (104b8deaa5);

2006-03-27 KAMEZAWA Hiroyuki [PATCH] unify pfn_to_page: sh pfn_to_page

-#define phys_to_page(phys)     (mem_map + (((phys)-__MEMORY_START) >>
PAGE_SHIFT))
-#define page_to_phys(page)     (((page - mem_map) << PAGE_SHIFT) +
__MEMORY_START)
+#define phys_to_page(phys)     (pfn_to_page(phys >> PAGE_SHIFT))
+#define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)

Reported-by: David ADDISON <david.addison@st.com>
Reported-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2007-10-30 08:44:13 +09:00
Jens Axboe
71df50a4e4 sh/sh64: fixup dma-mapping for new sg layout
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-23 12:52:48 +02:00