summaryrefslogtreecommitdiff
path: root/arch/sparc
AgeCommit message (Collapse)AuthorFilesLines
2008-09-13sparc: Fix user_regset 'n' field values.David S. Miller1-2/+2
As noticed by Russell King, we were not setting this properly to the number of entries, but rather the total size. This results in the core dumping code allocating waayyyy too much memory. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-11sparc32: Fix function signature of of_bus_sbus_get_flags().David S. Miller1-1/+1
This doesn't match the function pointer type it gets assigned to. Luckily, this was harmless. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29sparc: Fix resource flags for PCI children in OF device tree.David S. Miller1-5/+14
When a device is under an EBUS or ISA bus, the resource flags don't get set properly. Fix this by re-evaluating the resource flags at each level of bus as we apply ranges on the way to the root. And let PCI override any existing flags setting, but don't let the default flags calculator make such overrides. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-28sparc32: Implement smp_call_function_single().David S. Miller3-20/+33
Reported by Stephen Rothwell. Needed to fix the build when CONFIG_RELAY is enabled. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-25sparc: Add target for a stripped kernelMartin Habets2-2/+12
Add a target for a stripped kernel. This is used for the various packaging targets (*-pkg). Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-13sparc64: Implement IRQ stacks.David S. Miller1-0/+4
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-13sparc: remove include of linux/of_device.h from asm/of_device.hStephen Rothwell1-2/+1
Now that all the direct includes of asm/of_device.h are gone, this is safe to do. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-08sparc: don't use asm/of_device.hStephen Rothwell7-7/+9
Use linux/of_device.h instead. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-07of/sparc: remove include of linux/of_platform.h from asm/of_platform.hStephen Rothwell1-3/+0
Now that we have removed all inclusions of asm/of_platform.h, this compatability include can be removed. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-01sparc: Add __KERNEL__ ifdef protection to pt_regs helpers.David S. Miller2-26/+25
Some of them use 'bool' and whatnot and therefore are not kosher for userspace, so don't export them there. Reported by Roland McGrath. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31sparc64: Hook up trigger_all_cpu_backtrace().David S. Miller1-0/+3
We already have code that does this, but it is only currently attached to sysrq-'y'. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31sparc64: Make global reg dumping even more useful.David S. Miller1-4/+4
Record one more level of stack frame program counter. Particularly when lockdep and all sorts of spinlock debugging is enabled, figuring out the caller of spin_lock() is difficult when the cpu is stuck on the lock. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-31sparc64: FUTEX_OP_ANDN fixMikael Pettersson1-1/+1
Correct sparc64's implementation of FUTEX_OP_ANDN to do a bitwise negate of the oparg parameter before applying the AND operation. All other archs that support FUTEX_OP_ANDN either negate oparg explicitly (frv, ia64, mips, sh, x86), or do so indirectly by using an and-not instruction (powerpc). Since sparc64 has and-not, I chose to use that solution. I've not found any use of FUTEX_OP_ANDN in glibc so the impact of this bug is probably minor. But other user-space components may try to use it so it should still get fixed. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-30sparc: merge of_platform_{32,64}.hStephen Rothwell3-53/+21
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-30sparc64: Kill isa_bus_type.David S. Miller1-1/+0
I forgot to delete this when I removed the ISA bus layer from the sparc ports. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: Set CONFIG_HAVE_ARCH_TRACEHOOKDavid S. Miller1-0/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: Add task_pt_regs().David S. Miller1-0/+1
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: Add call to tracehook_signal_handler().David S. Miller1-0/+2
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: Create and use TIF_NOTIFY_RESUME.David S. Miller3-4/+22
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: Use tracehook routines in syscall_trace().David S. Miller2-17/+21
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: Add user_stack_pointer().David S. Miller2-0/+2
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc64: tracehook: TIF_NOTIFY_RESUMERoland McGrath1-3/+5
This adds TIF_NOTIFY_RESUME support for sparc64. When set, we call tracehook_notify_resume() on the way to user mode. Signed-off-by: Roland McGrath <roland@redhat.com>
2008-07-28sparc: Add asm/syscall.hDavid S. Miller1-0/+120
Based upon a patch by Roland McGrath. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-28sparc: enable headers_export againSam Ravnborg1-1/+45
Update include/asm/Kbuild so we export all relvant headers for sparc. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-07-28sparc, sparc64: use arch/sparc/includeSam Ravnborg327-0/+32037
The majority of this patch was created by the following script: *** ASM=arch/sparc/include/asm mkdir -p $ASM git mv include/asm-sparc64/ftrace.h $ASM git rm include/asm-sparc64/* git mv include/asm-sparc/* $ASM sed -ie 's/asm-sparc64/asm/g' $ASM/* sed -ie 's/asm-sparc/asm/g' $ASM/* *** The rest was an update of the top-level Makefile to use sparc for header files when sparc64 is being build. And a small fixlet to pick up the correct unistd.h from sparc64 code. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-07-26Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6Linus Torvalds1-1/+2
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: sparc: Wire up new system calls.
2008-07-26sparc: Wire up new system calls.David S. Miller1-1/+2
This wires up the recently added Wire up signalfd4, eventfd2, epoll_create1, dup3, pipe2, and inotify_init1 system calls. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-25pty: remove unused UNIX98_PTY_COUNT optionsAdrian Bunk1-14/+0
The h8300 and sparc options somehow survived when the code stopped using CONFIG_UNIX98_PTY_COUNT. Reviewed-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24flag parameters: pipeUlrich Drepper1-1/+1
This patch introduces the new syscall pipe2 which is like pipe but it also takes an additional parameter which takes a flag value. This patch implements the handling of O_CLOEXEC for the flag. I did not add support for the new syscall for the architectures which have a special sys_pipe implementation. I think the maintainers of those archs have the chance to go with the unified implementation but that's up to them. The implementation introduces do_pipe_flags. I did that instead of changing all callers of do_pipe because some of the callers are written in assembler. I would probably screw up changing the assembly code. To avoid breaking code do_pipe is now a small wrapper around do_pipe_flags. Once all callers are changed over to do_pipe_flags the old do_pipe function can be removed. The following test must be adjusted for architectures other than x86 and x86-64 and in case the syscall numbers changed. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include <sys/syscall.h> #ifndef __NR_pipe2 # ifdef __x86_64__ # define __NR_pipe2 293 # elif defined __i386__ # define __NR_pipe2 331 # else # error "need __NR_pipe2" # endif #endif int main (void) { int fd[2]; if (syscall (__NR_pipe2, fd, 0) != 0) { puts ("pipe2(0) failed"); return 1; } for (int i = 0; i < 2; ++i) { int coe = fcntl (fd[i], F_GETFD); if (coe == -1) { puts ("fcntl failed"); return 1; } if (coe & FD_CLOEXEC) { printf ("pipe2(0) set close-on-exit for fd[%d]\n", i); return 1; } } close (fd[0]); close (fd[1]); if (syscall (__NR_pipe2, fd, O_CLOEXEC) != 0) { puts ("pipe2(O_CLOEXEC) failed"); return 1; } for (int i = 0; i < 2; ++i) { int coe = fcntl (fd[i], F_GETFD); if (coe == -1) { puts ("fcntl failed"); return 1; } if ((coe & FD_CLOEXEC) == 0) { printf ("pipe2(O_CLOEXEC) does not set close-on-exit for fd[%d]\n", i); return 1; } } close (fd[0]); close (fd[1]); puts ("OK"); return 0; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Ulrich Drepper <drepper@redhat.com> Acked-by: Davide Libenzi <davidel@xmailserver.org> Cc: Michael Kerrisk <mtk.manpages@googlemail.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24mm: drop unneeded pgdat argument from free_area_init_node()Johannes Weiner2-4/+2
free_area_init_node() gets passed in the node id as well as the node descriptor. This is redundant as the function can trivially get the node descriptor itself by means of NODE_DATA() and the node's id. I checked all the users and NODE_DATA() seems to be usable everywhere from where this function is called. Signed-off-by: Johannes Weiner <hannes@saeurebad.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-23sparc32: pass -m32 when building vmlinux.ldsStephen Rothwell1-0/+1
Otherwise it breaks since we merged asm/page.h Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-19sparc: Remove Sparc's asm-offsets for sclow.SDavid Howells1-12/+0
Remove Sparc's asm-offsets for sclow.S as the (E)UID/(E)GID size and offset definitions will cease to be correct if COW credentials are merged. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-18sparc: Use new '%pS' infrastructure to print symbols.David S. Miller2-10/+8
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-18sparc32: fix init.c allnoconfig build errorRobert Reif1-0/+1
Fix allnoconfig build error. Signed-off-by: Robert Reif <reif@earthlink.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-18sparc: arch/sparc/kernel/apc.c to unlocked_ioctlStoyan Gaydarov1-12/+28
This changes arch/sparc/kernel/apc.c to use unlocked_ioctl Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-18sparc: export openprom.h to userspaceSam Ravnborg1-0/+1
sparc64 exports openprom.h to userspace so let sparc follow the example. As openprom.h pulled in another not-for-export vaddrs.h header file it required a few changes to fix the build. The definition af VMALLOC_* were moved to pgtable as this is where sparc64 has them. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2008-07-18sparc/mm/: possible cleanupsAdrian Bunk4-24/+25
This patch contains the following possible cleanups: - make the following needlessly global code static: - fault.c: force_user_fault() - init.c: calc_max_low_pfn() - init.c: pgt_cache_water[] - init.c: map_high_region() - srmmu.c: hwbug_bitmask - srmmu.c: srmmu_swapper_pg_dir - srmmu.c: srmmu_context_table - srmmu.c: is_hypersparc - srmmu.c: srmmu_cache_pagetables - srmmu.c: srmmu_nocache_size - srmmu.c: srmmu_nocache_end - srmmu.c: srmmu_get_nocache() - srmmu.c: srmmu_free_nocache() - srmmu.c: srmmu_early_allocate_ptable_skeleton() - srmmu.c: srmmu_nocache_calcsize() - srmmu.c: srmmu_nocache_init() - srmmu.c: srmmu_alloc_thread_info() - srmmu.c: early_pgtable_allocfail() - srmmu.c: srmmu_early_allocate_ptable_skeleton() - srmmu.c: srmmu_allocate_ptable_skeleton() - srmmu.c: srmmu_inherit_prom_mappings() - sunami.S: tsunami_copy_1page - remove the following unused code: - init.c: struct sparc_aliases Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-18sparc/kernel/: possible cleanupsAdrian Bunk20-54/+38
This patch contains the following possible cleanups: - make the following needlessly global code static: - apc.c: apc_swift_idle() - ebus.c: ebus_blacklist_irq() - ebus.c: fill_ebus_child() - ebus.c: fill_ebus_device() - entry.S: syscall_is_too_hard - etra: tsetup_sun4c_stackchk - head.S: cputyp - head.S: prom_vector_p - idprom.c: Sun_Machines[] - ioport.c: _sparc_find_resource() - ioport.c: create_proc_read_entry() - irq.c: struct sparc_irq[] - rtrap.S: sun4c_rett_stackchk - setup.c: prom_sync_me() - setup.c: boot_flags - sun4c_irq.c: sun4c_sbint_to_irq() - sun4d_irq.c: sbus_tid[] - sun4d_irq.c: struct sbus_actions - sun4d_irq.c: sun4d_sbint_to_irq() - sun4m_irq.c: sun4m_sbint_to_irq() - sun4m_irq.c: sun4m_get_irqmask() - sun4m_irq.c: sun4m_timers - sun4m_smp.c: smp4m_cross_call() - sun4m_smp.c: smp4m_blackbox_id() - sun4m_smp.c: smp4m_blackbox_current() - time.c: sp_clock_typ - time.c: sbus_time_init() - traps.c: instruction_dump() - wof.S: spwin_sun4c_stackchk - wuf.S: sun4c_fwin_stackchk - #if 0 the following unused code: - process.c: sparc_backtrace_lock - process.c: __show_backtrace() - process.c: show_backtrace() - process.c: smp_show_backtrace_all_cpus() - remove the following unused code: - entry.S: __handle_exception - smp.c: smp_num_cpus - smp.c: smp_activated - smp.c: __cpu_number_map[] - smp.c: __cpu_logical_map[] - smp.c: bitops_spinlock - traps.c: trap_curbuf - traps.c: trapbuf[] - traps.c: linux_smp_still_initting - traps.c: thiscpus_tbr - traps.c: thiscpus_mid Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-15Merge commit 'v2.6.26' into bkl-removalJonathan Corbet62-74/+75
2008-07-03sparc-apc: BKL pushdownArnd Bergmann1-0/+2
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-06-04sparc: switch /proc/led to seq_fileAlexey Dobriyan1-13/+21
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-20sparc: remove CVS keywordsAdrian Bunk60-60/+54
This patch removes the CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-17[PATCH] take init_files to fs/file.cAl Viro1-1/+0
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-05-13sparc: Fix mremap address range validation.David S. Miller1-43/+5
Just like mmap, we need to validate address ranges regardless of MAP_FIXED. sparc{,64}_mmap_check()'s flag argument is unused, remove. Based upon a report and preliminary patch by Jan Lieskovsky <jlieskov@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-12sparc32: fix rtrap.S typoRobert Reif1-1/+1
Fix compile problem in rtrap.S arch/sparc/kernel/built-in.o: In function `ret_trap_userwins_ok': arch/sparc/kernel/rtrap.S:(.text+0x1900): undefined reference to `PSR_SYCALL' Signed-off-by: Robert Reif <reif@earthlink.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc: Fix debugger syscall restart interactions.David S. Miller4-41/+40
So, forever, we've had this ptrace_signal_deliver implementation which tries to handle all of the nasties that can occur when the debugger looks at a process about to take a signal. It's meant to address all of these issues inside of the kernel so that the debugger need not be mindful of such things. Problem is, this doesn't work. The idea was that we should do the syscall restart business first, so that the debugger captures that state. Otherwise, if the debugger for example saves the child's state, makes the child execute something else, then restores the saved state, we won't handle the syscall restart properly because we lose the "we're in a syscall" state. The code here worked for most cases, but if the debugger actually passes the signal through to the child unaltered, it's possible that we would do a syscall restart when we shouldn't have. In particular this breaks the case of debugging a process under a gdb which is being debugged by yet another gdb. gdb uses sigsuspend to wait for SIGCHLD of the inferior, but if gdb itself is being debugged by a top-level gdb we get a ptrace_stop(). The top-level gdb does a PTRACE_CONT with SIGCHLD to let the inferior gdb see the signal. But ptrace_signal_deliver() assumed the debugger would cancel out the signal and therefore did a syscall restart, because the return error was ERESTARTNOHAND. Fix this by simply making ptrace_signal_deliver() a nop, and providing a way for the debugger to control system call restarting properly: 1) Report a "in syscall" software bit in regs->{tstate,psr}. It is set early on in trap entry to a system call and is fully visible to the debugger via ptrace() and regsets. 2) Test this bit right before doing a syscall restart. We have to do a final recheck right after get_signal_to_deliver() in case the debugger cleared the bit during ptrace_stop(). 3) Clear the bit in trap return so we don't accidently try to set that bit in the real register. As a result we also get a ptrace_{is,clear}_syscall() for sparc32 just like sparc64 has. M68K has this same exact bug, and is now the only other user of the ptrace_signal_deliver hook. It needs to be fixed in the same exact way as sparc. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc: Fix ptrace() detach.David S. Miller1-0/+2
Forever we had a PTRACE_SUNOS_DETACH which was unconditionally recognized, regardless of the personality of the process. Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h header file on sparc as PTRACE_DETACH and PT_DETACH. So continue to recognize this old value. Luckily, it doesn't conflict with anything we actually care about. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-10sparc32: Don't twiddle PT_DTRACE in exec.David S. Miller1-5/+0
That bit isn't used on this platform. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-08sparc: Fix SA_ONSTACK signal handling.David S. Miller1-3/+17
We need to be more liberal about the alignment of the buffer given to us by sigaltstack(). The user should not need to be mindful of all of the alignment constraints we have for the stack frame. This mirrors how we handle this situation in clone() as well. Also, we align the stack even in non-SA_ONSTACK cases so that signals due to bad stack alignment can be delivered properly. This makes such errors easier to debug and recover from. Finally, add the sanity check x86 has to make sure we won't overflow the signal stack. This fixes glibc testcases nptl/tst-cancel20.c and nptl/tst-cancelx20.c Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-08sparc: Fix fork/clone/vfork system call restart.David S. Miller1-4/+16
We clobber %i1 as well as %i0 for these system calls, because they give two return values. Therefore, on error, we have to restore %i1 properly or else the restart explodes since it uses the wrong arguments. This fixes glibc's nptl/tst-eintr1.c testcase. Signed-off-by: David S. Miller <davem@davemloft.net>