summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
Commit message (Collapse)AuthorAgeFilesLines
* sh: Save NUMA node data in vmcore for crash dumps.Paul Mundt2008-08-041-0/+8
| | | | | | | Presently the NUMA node data isn't saved on kexec. This implements a simple arch_crash_save_vmcoreinfo() for saving off the relevant data. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: module_alloc() should be using vmalloc_exec().Paul Mundt2008-08-041-1/+2
| | | | | | | | SH-X2 extended mode TLB allows for toggling of the exec bit, so make sure we are using the right protection bits for module space there also. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up __bug_table handling in module loader.Paul Mundt2008-08-041-1/+3
| | | | | | We should be calling in to the lib/bug.c module helpers, fix that up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up broken kerneldoc comments.Paul Mundt2008-08-041-1/+1
| | | | | | These were completely unparseable, so fix them up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up the audit arch endian specification.Paul Mundt2008-08-012-2/+27
| | | | | | | | Presently this was always being set to AUDIT_ARCH_SH, which assumes big endian. Fix this up so that the architecture actually reflects what we're running on. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Make syscall tracer use tracehook notifiers, add TIF_NOTIFY_RESUME.Paul Mundt2008-08-016-154/+167
| | | | | | | | | | | | | | This follows the changes in commits: 7d6d637dac2050f30a1b57b0a3dc5de4a10616ba 4f72c4279eab1e5f3ed1ac4e55d4527617582392 on powerpc. Adding in TIF_NOTIFY_RESUME, and cleaning up the syscall tracing to be more generic. This is an incremental step to turning on tracehook, as well as unifying more of the ptrace and signal code across the 32/64 split. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: ptrace single stepping cleanups.Paul Mundt2008-08-012-140/+30Star
| | | | | | | | This converts the single stepping done by sh/sh64 ptrace implementations to use the generic user_enable/disable_single_step(), and subsequently rips out a lot of ptrace request cases that are now handled generically. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: seccomp support.Paul Mundt2008-08-012-0/+6
| | | | | | | This hooks up the seccomp thread flag and associated callback from the syscall tracer. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Tidy up the _TIF work masks, and fix syscall trace bug on singlestep.Paul Mundt2008-08-012-3/+3
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* kdump: sh: parse elfcorehdr command line argumentSimon Horman2008-08-011-0/+20
| | | | | | | | | | | | A quick cut and paste from other architectures to allow SH to parse the elfcorehdr command line argument which is required for both is_kdump_kernel() and vmcore to function. (the former is as yet unused on SH). Tested compilation only Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Move out the solution engine headers to arch/sh/include/mach-se/Paul Mundt2008-07-291-3/+3
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add an arch/sh/kernel/.gitignorePaul Mundt2008-07-291-0/+1
| | | | | | Ignore vmlinux.lds. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: migrate to arch/sh/include/Paul Mundt2008-07-2911-13/+13
| | | | | | | | | | | | | This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac. Most of the moving about was done with Sam's directions at: http://marc.info/?l=linux-sh&m=121724823706062&w=2 with subsequent hacking and fixups entirely my fault. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Wire up new syscalls.Paul Mundt2008-07-282-0/+12
| | | | | | | This wires up the signalfd4, eventfd2, epoll_create1, dup3, pipe2, and inotify_init1 syscalls. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Don't miss pending signals returning to user mode after signal processingStuart MENEFY2008-07-281-1/+1
| | | | | | | | | | | | Without this patch, signals sent during architecture specific signal handling (typically as a result of the user's stack being inaccessible) are ignored. This is the SH version of commit c3ff8ec31c1249d268cd11390649768a12bec1b9 which was for the i386. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Use clk_always_enable() on sh7366Magnus Damm2008-07-281-0/+15
| | | | | | | Use clk_always_enable() in the sh7366 processor code. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Use clk_always_enable() on sh7343 / SE77343Magnus Damm2008-07-281-0/+15
| | | | | | | | Use clk_always_enable() on the sh7343 processor and in the board code for Solution Engine 7343. Remove duplicate MSTPCR register definitions. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Use clk_always_enable() on sh7722 / Migo-R / SE7722Magnus Damm2008-07-281-0/+14
| | | | | | | | | Use clk_always_enable() on the sh7722 processor and in the board code for Migo-R and Solution Engine 7722. Remove duplicate MSTPCR register definitions. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Use clk_always_enable() on sh7723 / ap325rxaMagnus Damm2008-07-281-0/+16
| | | | | | | | Use clk_always_enable() on the sh7723 processor and in the ap325rxa board code. Remove duplicate MSTPCR register definitions. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Show all clocks and their state in /proc/clocksMagnus Damm2008-07-281-9/+5Star
| | | | | | | | Show all clocks in /proc/clocks, and also show if they are enabled or disabled. This is useful to show MSTPCR bits on SuperH Mobile processors. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Merge sh7343 and sh7722 clock codeMagnus Damm2008-07-283-130/+41Star
| | | | | | | | | | | This code makes sh7343 share the sh7722 clock code. Instead of just using the good and very old sh7343 clock implmentation, switch to the new MSTPCR enabled clock code. SIU clocks are disabled on sh7343 for now. With this change all SuperH Mobile devices now use the same clock code. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add SuperH Mobile MSTPCR bits to clock frameworkMagnus Damm2008-07-281-0/+116
| | | | | | | | | Handle module stop clock bits in MSTPCRn through the clock framework. The clocks are named after the bits in the data sheet. The association between bit number and hardware block is processor specific. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Use arch_flags to simplify sh7722 siu clock codeMagnus Damm2008-07-281-38/+9Star
| | | | | | | Make use of arch_flags to simplify the SIU clock code. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add memory chunks to SH-Mobile UIO devicesMagnus Damm2008-07-284-0/+40
| | | | | | | | This patch adds physically contiguous memory chunks to the UIO devices. The same strategy can be used in the future for the CEU as well. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Export sh7366 VPU, VEU(1), VEU(2) using uio_pdrv_genirqMagnus Damm2008-07-281-1/+80
| | | | | | | | | | This patch exports the VPU, VEU(1) and VEU(2) blocks of the sh7366 to user space using the uio_pdrv_genirq platform driver. While at it, fix up the VEU(2) interrupt vector. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Export sh7723 VPU, VEU2H0, VEU2H1 using uio_pdrv_genirqMagnus Damm2008-07-281-0/+79
| | | | | | | | This patch exports the VPU, VEU2H0 and VEU2H1 blocks of the sh7723 to user space using the uio_pdrv_genirq platform driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Export sh7722 VPU and VEU using uio_pdrv_genirqMagnus Damm2008-07-281-0/+53
| | | | | | | | This patch exports the VPU and VEU blocks of the sh7722 to user space using the uio_pdrv_genirq platform driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Export sh7343 VPU and VEU using uio_pdrv_genirqMagnus Damm2008-07-281-0/+53
| | | | | | | | This patch exports the VPU and VEU blocks of the sh7343 to user space using the uio_pdrv_genirq platform driver. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh2(A) exception handler updateYoshinori Sato2008-07-286-90/+385
| | | | | | | | | | | | | | | | This patch is By sh2 - Remove duplicate code - Reduce stack usage - Cleanup and little optimize By sh2a - Add missing handler(256 to 511) - Use sh2a instructions handler Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: update sh7343 codeYoshihiro Shimoda2008-07-281-0/+135
| | | | | | | | | | updated the following codes for SH7343: - add register_intc_controller() - add EARLY_SCIF_CONSOLE_PORT - add define of CPG register Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: add SuperH Mobile I2C platform data to sh7366Magnus Damm2008-07-281-0/+21
| | | | | | | This patch adds platform data for the single I2C channel on sh7366. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: add SuperH Mobile I2C platform data to sh7723Magnus Damm2008-07-281-0/+21
| | | | | | | This patch adds platform data for the single I2C channel on sh7723. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: add SuperH Mobile I2C platform data to sh7343Magnus Damm2008-07-281-0/+42
| | | | | | | This patch adds platform data for two I2C channels to the sh7343. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: add interrupt ack code to sh4aYoshihiro Shimoda2008-07-287-26/+74
| | | | | | | | This patch is based on interrupt acknowledge code for external interrupt sources on sh3 processors and adds on sh4a processors. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Conditionally re-enable IRQs in fault path.Stuart Menefy2008-07-281-2/+1Star
| | | | | | | | | | | | | The current kernel behaviour is to reenable interrupts unconditionally when taking a page fault. This patch changes this to only enable them if interrupts were previously enabled. It also fixes a problem seen with this fix in place: the kernel previously flushed the vsyscall page when handling a signal, which is not only unncessary, but caused a possible sleep with interrupts disabled. Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Record the major cut revision for probed SH-4A parts.Paul Mundt2008-07-281-4/+5
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Optimized flush_icache_range() implementation.Chris Smith2008-07-281-8/+2Star
| | | | | | | | | Add implementation of flush_icache_range() suitable for signal handler and kprobes. Remove flush_cache_sigtramp() and change signal.c to use flush_icache_range(). Signed-off-by: Chris Smith <chris.smith@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Stub in silicon cut in CPU info.Stuart Menefy2008-07-282-0/+9
| | | | | Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Tidy up the SH-3 exception vector table.Paul Mundt2008-07-281-19/+19
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* SH7619 add ethernet controler supportYoshinori Sato2008-07-281-0/+24
| | | | | | | - Add EtherC + PHY resource define. Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh/kernel/ cleanupsAdrian Bunk2008-07-286-30/+6Star
| | | | | | | | | | | | | | | | | This patch contains the following cleanups: - make the following needlessly global code static: - cf-enabler.c: cf_init() - cpu/clock.c: __clk_enable() - cpu/clock.c: __clk_disable() - process_32.c: default_idle() - time_32.c: struct clocksource_sh - timers/timer-tmu.c: struct tmu_timer_ops - remove the following unused functions (no CONFIG_BLK_DEV_FD on sh): - process_{32,64}.c: disable_hlt() - process_{32,64}.c: enable_hlt() Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add SCIF2 support for SH7763.Nobuhiro Iwamatsu2008-07-281-2/+8
| | | | | | | | | SH7763 has 3 SCIF device. Current code supports SCIF0 and 1. SCIF0 and 1 are same register constitution, but only SCIF2 is different. I added support of SCIF2. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Make dump_task dependent on ELF core.Paul Mundt2008-07-281-1/+1
| | | | | | | | Currently this is only linked in for CONFIG_BINFMT_ELF, make it dependent on CONFIG_ELF_CORE, so it's both selectable there and also linked in for CONFIG_BINFMT_ELF_FDPIC. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Initial ELF FDPIC support.Paul Mundt2008-07-282-2/+46
| | | | | | | | | This adds initial support for ELF FDPIC on MMU-less SH, as per version 0.2 of the ABI definition at: http://www.codesourcery.com/public/docs/sh-fdpic/sh-fdpic-abi.txt Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: export get_cpu_subtypeAdrian Bunk2008-07-281-0/+1
| | | | | | | | | | | | | | | | | | This patch fixes the following build error: <-- snip --> ... MODPOST 1837 modules ERROR: "get_cpu_subtype" [arch/sh/oprofile/oprofile.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>
* kexec jumpHuang Ying2008-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides an enhancement to kexec/kdump. It implements the following features: - Backup/restore memory used by the original kernel before/after kexec. - Save/restore CPU state before/after kexec. The features of this patch can be used as a general method to call program in physical mode (paging turning off). This can be used to call BIOS code under Linux. kexec-tools needs to be patched to support kexec jump. The patches and the precompiled kexec can be download from the following URL: source: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec-tools-src_git_kh10.tar.bz2 patches: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec-tools-patches_git_kh10.tar.bz2 binary: http://khibernation.sourceforge.net/download/release_v10/kexec-tools/kexec_git_kh10 Usage example of calling some physical mode code and return: 1. Compile and install patched kernel with following options selected: CONFIG_X86_32=y CONFIG_KEXEC=y CONFIG_PM=y CONFIG_KEXEC_JUMP=y 2. Build patched kexec-tool or download the pre-built one. 3. Build some physical mode executable named such as "phy_mode" 4. Boot kernel compiled in step 1. 5. Load physical mode executable with /sbin/kexec. The shell command line can be as follow: /sbin/kexec --load-preserve-context --args-none phy_mode 6. Call physical mode executable with following shell command line: /sbin/kexec -e Implementation point: To support jumping without reserving memory. One shadow backup page (source page) is allocated for each page used by kexeced code image (destination page). When do kexec_load, the image of kexeced code is loaded into source pages, and before executing, the destination pages and the source pages are swapped, so the contents of destination pages are backupped. Before jumping to the kexeced code image and after jumping back to the original kernel, the destination pages and the source pages are swapped too. C ABI (calling convention) is used as communication protocol between kernel and called code. A flag named KEXEC_PRESERVE_CONTEXT for sys_kexec_load is added to indicate that the loaded kernel image is used for jumping back. Now, only the i386 architecture is supported. Signed-off-by: Huang Ying <ying.huang@intel.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Nigel Cunningham <nigel@nigel.suspend2.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'timers-fixes-for-linus' of ↵Linus Torvalds2008-07-241-1/+1
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: nohz: adjust tick_nohz_stop_sched_tick() call of s390 as well nohz: prevent tick stop outside of the idle loop
| * Merge branch 'linus' into timers/nohzIngo Molnar2008-07-188-87/+68Star
| |\
| * | nohz: prevent tick stop outside of the idle loopThomas Gleixner2008-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jack Ren and Eric Miao tracked down the following long standing problem in the NOHZ code: scheduler switch to idle task enable interrupts Window starts here ----> interrupt happens (does not set NEED_RESCHED) irq_exit() stops the tick ----> interrupt happens (does set NEED_RESCHED) return from schedule() cpu_idle(): preempt_disable(); Window ends here The interrupts can happen at any point inside the race window. The first interrupt stops the tick, the second one causes the scheduler to rerun and switch away from idle again and we end up with the tick disabled. The fact that it needs two interrupts where the first one does not set NEED_RESCHED and the second one does made the bug obscure and extremly hard to reproduce and analyse. Kudos to Jack and Eric. Solution: Limit the NOHZ functionality to the idle loop to make sure that we can not run into such a situation ever again. cpu_idle() { preempt_disable(); while(1) { tick_nohz_stop_sched_tick(1); <- tell NOHZ code that we are in the idle loop while (!need_resched()) halt(); tick_nohz_restart_sched_tick(); <- disables NOHZ mode preempt_enable_no_resched(); schedule(); preempt_disable(); } } In hindsight we should have done this forever, but ... /me grabs a large brown paperbag. Debugged-by: Jack Ren <jack.ren@marvell.com>, Debugged-by: eric miao <eric.y.miao@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
* | | Merge branch 'core-fixes-for-linus' of ↵Linus Torvalds2008-07-241-0/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: arch/mips/kernel/stacktrace.c: Heiko can't type kthread: reduce stack pressure in create_kthread and kthreadd fix core/stacktrace changes on avr32, mips, sh