diff options
Diffstat (limited to 'arch/sh64/kernel')
-rw-r--r-- | arch/sh64/kernel/entry.S | 4 | ||||
-rw-r--r-- | arch/sh64/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/sh64/kernel/pci_sh5.c | 17 | ||||
-rw-r--r-- | arch/sh64/kernel/pci_sh5.h | 2 | ||||
-rw-r--r-- | arch/sh64/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/sh64/kernel/signal.c | 33 | ||||
-rw-r--r-- | arch/sh64/kernel/syscalls.S | 36 | ||||
-rw-r--r-- | arch/sh64/kernel/time.c | 18 |
8 files changed, 86 insertions, 30 deletions
diff --git a/arch/sh64/kernel/entry.S b/arch/sh64/kernel/entry.S index 40d45346248..7013fcb6665 100644 --- a/arch/sh64/kernel/entry.S +++ b/arch/sh64/kernel/entry.S @@ -947,14 +947,14 @@ ret_with_reschedule: ! FIXME:!!! ! no handling of TIF_SYSCALL_TRACE yet!! - movi (1 << TIF_NEED_RESCHED), r8 + movi _TIF_NEED_RESCHED, r8 and r8, r7, r8 pta work_resched, tr0 bne r8, ZERO, tr0 pta restore_all, tr1 - movi (1 << TIF_SIGPENDING), r8 + movi (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK), r8 and r8, r7, r8 pta work_notifysig, tr0 bne r8, ZERO, tr0 diff --git a/arch/sh64/kernel/irq.c b/arch/sh64/kernel/irq.c index f68b4f6c9b3..9412b716670 100644 --- a/arch/sh64/kernel/irq.c +++ b/arch/sh64/kernel/irq.c @@ -94,6 +94,7 @@ asmlinkage void do_NMI(unsigned long vector_num, struct pt_regs * regs) */ asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs) { + struct pt_regs *old_regs = set_irq_regs(regs); int irq; irq_enter(); @@ -101,13 +102,14 @@ asmlinkage int do_IRQ(unsigned long vector_num, struct pt_regs * regs) irq = irq_demux(vector_num); if (irq >= 0) { - __do_IRQ(irq, regs); + __do_IRQ(irq); } else { printk("unexpected IRQ trap at vector %03lx\n", vector_num); } irq_exit(); + set_irq_regs(old_regs); return 1; } diff --git a/arch/sh64/kernel/pci_sh5.c b/arch/sh64/kernel/pci_sh5.c index 49862e165c0..fb51660847c 100644 --- a/arch/sh64/kernel/pci_sh5.c +++ b/arch/sh64/kernel/pci_sh5.c @@ -340,8 +340,9 @@ static int __init map_cayman_irq(struct pci_dev *dev, u8 slot, u8 pin) return result; } -irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t pcish5_err_irq(int irq, void *dev_id) { + struct pt_regs *regs = get_irq_regs(); unsigned pci_int, pci_air, pci_cir, pci_aint; pci_int = SH5PCI_READ(INT); @@ -368,15 +369,13 @@ irqreturn_t pcish5_err_irq(int irq, void *dev_id, struct pt_regs *regs) return IRQ_HANDLED; } -irqreturn_t pcish5_serr_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t pcish5_serr_irq(int irq, void *dev_id) { printk("SERR IRQ\n"); return IRQ_NONE; } -#define ROUND_UP(x, a) (((x) + (a) - 1) & ~((a) - 1)) - static void __init pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, struct resource *memr) @@ -433,8 +432,8 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, mem_res.end -= mem_res.start; /* Align the sizes up by bridge rules */ - io_res.end = ROUND_UP(io_res.end, 4*1024) - 1; - mem_res.end = ROUND_UP(mem_res.end, 1*1024*1024) - 1; + io_res.end = ALIGN(io_res.end, 4*1024) - 1; + mem_res.end = ALIGN(mem_res.end, 1*1024*1024) - 1; /* Adjust the bridge's allocation requirements */ bridge->resource[0].end = bridge->resource[0].start + io_res.end; @@ -447,18 +446,16 @@ pcibios_size_bridge(struct pci_bus *bus, struct resource *ior, /* adjust parent's resource requirements */ if (ior) { - ior->end = ROUND_UP(ior->end, 4*1024); + ior->end = ALIGN(ior->end, 4*1024); ior->end += io_res.end; } if (memr) { - memr->end = ROUND_UP(memr->end, 1*1024*1024); + memr->end = ALIGN(memr->end, 1*1024*1024); memr->end += mem_res.end; } } -#undef ROUND_UP - static void __init pcibios_size_bridges(void) { struct resource io_res, mem_res; diff --git a/arch/sh64/kernel/pci_sh5.h b/arch/sh64/kernel/pci_sh5.h index 8f21f5d2aa3..c71159dd04b 100644 --- a/arch/sh64/kernel/pci_sh5.h +++ b/arch/sh64/kernel/pci_sh5.h @@ -4,7 +4,7 @@ * May be copied or modified under the terms of the GNU General Public * License. See linux/COPYING for more information. * - * Defintions for the SH5 PCI hardware. + * Definitions for the SH5 PCI hardware. */ /* Product ID */ diff --git a/arch/sh64/kernel/process.c b/arch/sh64/kernel/process.c index 525d0ec19b7..1b89c9dfb93 100644 --- a/arch/sh64/kernel/process.c +++ b/arch/sh64/kernel/process.c @@ -387,7 +387,7 @@ ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *)) * NOTE! Only a kernel-only process(ie the swapper or direct descendants * who haven't done an "execve()") should use this: it will work within * a system call from a "real" process, but the process memory space will - * not be free'd until both the parent and the child have exited. + * not be freed until both the parent and the child have exited. */ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { diff --git a/arch/sh64/kernel/signal.c b/arch/sh64/kernel/signal.c index b76bdfa473d..c8525ade056 100644 --- a/arch/sh64/kernel/signal.c +++ b/arch/sh64/kernel/signal.c @@ -698,7 +698,9 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) if (try_to_freeze()) goto no_signal; - if (!oldset) + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else if (!oldset) oldset = ¤t->blocked; signr = get_signal_to_deliver(&info, &ka, regs, 0); @@ -706,6 +708,15 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) if (signr > 0) { /* Whee! Actually deliver the signal. */ handle_signal(signr, &info, &ka, oldset, regs); + + /* + * If a signal was successfully delivered, the saved sigmask + * is in its frame, and we can clear the TIF_RESTORE_SIGMASK + * flag. + */ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + clear_thread_flag(TIF_RESTORE_SIGMASK); + return 1; } @@ -713,13 +724,27 @@ no_signal: /* Did we come from a system call? */ if (regs->syscall_nr >= 0) { /* Restart the system call - no handlers present */ - if (regs->regs[REG_RET] == -ERESTARTNOHAND || - regs->regs[REG_RET] == -ERESTARTSYS || - regs->regs[REG_RET] == -ERESTARTNOINTR) { + switch (regs->regs[REG_RET]) { + case -ERESTARTNOHAND: + case -ERESTARTSYS: + case -ERESTARTNOINTR: /* Decode Syscall # */ regs->regs[REG_RET] = regs->syscall_nr; regs->pc -= 4; + break; + + case -ERESTART_RESTARTBLOCK: + regs->regs[REG_RET] = __NR_restart_syscall; + regs->pc -= 4; + break; } } + + /* No signal to deliver -- put the saved sigmask back */ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { + clear_thread_flag(TIF_RESTORE_SIGMASK); + sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); + } + return 0; } diff --git a/arch/sh64/kernel/syscalls.S b/arch/sh64/kernel/syscalls.S index c0079d54c85..a5c680d2938 100644 --- a/arch/sh64/kernel/syscalls.S +++ b/arch/sh64/kernel/syscalls.S @@ -2,7 +2,7 @@ * arch/sh64/kernel/syscalls.S * * Copyright (C) 2000, 2001 Paolo Alberelli - * Copyright (C) 2004 Paul Mundt + * Copyright (C) 2004 - 2007 Paul Mundt * Copyright (C) 2003, 2004 Richard Curnow * * This file is subject to the terms and conditions of the GNU General Public @@ -20,7 +20,7 @@ */ .globl sys_call_table sys_call_table: - .long sys_ni_syscall /* 0 - old "setup()" system call */ + .long sys_restart_syscall /* 0 - old "setup()" system call */ .long sys_exit .long sys_fork .long sys_read @@ -347,4 +347,34 @@ sys_call_table: .long sys_inotify_init .long sys_inotify_add_watch .long sys_inotify_rm_watch /* 320 */ - + .long sys_ni_syscall + .long sys_migrate_pages + .long sys_openat + .long sys_mkdirat + .long sys_mknodat /* 325 */ + .long sys_fchownat + .long sys_futimesat + .long sys_fstatat64 + .long sys_unlinkat + .long sys_renameat /* 330 */ + .long sys_linkat + .long sys_symlinkat + .long sys_readlinkat + .long sys_fchmodat + .long sys_faccessat /* 335 */ + .long sys_pselect6 + .long sys_ppoll + .long sys_unshare + .long sys_set_robust_list + .long sys_get_robust_list /* 340 */ + .long sys_splice + .long sys_sync_file_range + .long sys_tee + .long sys_vmsplice + .long sys_move_pages /* 345 */ + .long sys_getcpu + .long sys_epoll_pwait + .long sys_utimensat + .long sys_signalfd + .long sys_timerfd /* 350 */ + .long sys_eventfd diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c index 390b40de7ce..b37f4f4981d 100644 --- a/arch/sh64/kernel/time.c +++ b/arch/sh64/kernel/time.c @@ -123,7 +123,7 @@ static unsigned long long usecs_per_jiffy = 1000000/HZ; /* Approximation */ static unsigned long long scaled_recip_ctc_ticks_per_jiffy; /* Estimate number of microseconds that have elapsed since the last timer tick, - by scaling the delta that has occured in the CTC register. + by scaling the delta that has occurred in the CTC register. WARNING WARNING WARNING : This algorithm relies on the CTC decrementing at the CPU clock rate. If the CPU sleeps, the CTC stops counting. Bear this @@ -282,7 +282,7 @@ static long last_rtc_update = 0; * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static inline void do_timer_interrupt(int irq, struct pt_regs *regs) +static inline void do_timer_interrupt(void) { unsigned long long current_ctc; asm ("getcon cr62, %0" : "=r" (current_ctc)); @@ -290,9 +290,10 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs) do_timer(1); #ifndef CONFIG_SMP - update_process_times(user_mode(regs)); + update_process_times(user_mode(get_irq_regs())); #endif - profile_tick(CPU_PROFILING, regs); + if (current->pid) + profile_tick(CPU_PROFILING); #ifdef CONFIG_HEARTBEAT { @@ -323,7 +324,7 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs) * Time Stamp Counter value at the time of the timer interrupt, so that * we later on can estimate the time of day more exactly. */ -static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t timer_interrupt(int irq, void *dev_id) { unsigned long timer_status; @@ -340,7 +341,7 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) * locally disabled. -arca */ write_lock(&xtime_lock); - do_timer_interrupt(irq, regs); + do_timer_interrupt(); write_unlock(&xtime_lock); return IRQ_HANDLED; @@ -465,9 +466,10 @@ static __init unsigned int get_cpu_hz(void) #endif } -static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id) { + struct pt_regs *regs = get_irq_regs(); + ctrl_outb(0, RCR1); /* Disable Carry Interrupts */ regs->regs[3] = 1; /* Using r3 */ |