Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: Add alignment flag to PCI expansion resources
  sparc: Avoid calling sigprocmask()
  sparc: Use set_current_blocked()
  sparc32,leon: SRMMU MMU Table probe fix
  • Loading branch information
torvalds committed Oct 20, 2011
2 parents 505f48b + aad4564 commit fd11e15
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 55 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/pgtsrmmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ static inline unsigned long srmmu_hwprobe(unsigned long vaddr)
return retval;
}
#else
#define srmmu_hwprobe(addr) (srmmu_swprobe(addr, 0) & SRMMU_PTE_PMASK)
#define srmmu_hwprobe(addr) srmmu_swprobe(addr, 0)
#endif

static inline int
Expand Down
3 changes: 2 additions & 1 deletion arch/sparc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ static void pci_parse_of_addrs(struct platform_device *op,
res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2];
} else if (i == dev->rom_base_reg) {
res = &dev->resource[PCI_ROM_RESOURCE];
flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE;
flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE
| IORESOURCE_SIZEALIGN;
} else {
printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
continue;
Expand Down
21 changes: 7 additions & 14 deletions arch/sparc/kernel/signal32.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,7 @@ void do_sigreturn32(struct pt_regs *regs)
case 1: set.sig[0] = seta[0] + (((long)seta[1]) << 32);
}
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
return;

segv:
Expand Down Expand Up @@ -377,10 +374,7 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
case 1: set.sig[0] = seta.sig[0] + (((long)seta.sig[1]) << 32);
}
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
return;
segv:
force_sig(SIGSEGV, current);
Expand Down Expand Up @@ -782,6 +776,7 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka,
siginfo_t *info,
sigset_t *oldset, struct pt_regs *regs)
{
sigset_t blocked;
int err;

if (ka->sa.sa_flags & SA_SIGINFO)
Expand All @@ -792,12 +787,10 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka,
if (err)
return err;

spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NOMASK))
sigaddset(&current->blocked,signr);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
sigaddset(&blocked, signr);
set_current_blocked(&blocked);

tracehook_signal_handler(signr, info, ka, regs, 0);

Expand Down Expand Up @@ -881,7 +874,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs,
*/
if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
set_current_blocked(&current->saved_sigmask);
}
}

Expand Down
32 changes: 13 additions & 19 deletions arch/sparc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ struct rt_signal_frame {

static int _sigpause_common(old_sigset_t set)
{
set &= _BLOCKABLE;
spin_lock_irq(&current->sighand->siglock);
sigset_t blocked;

current->saved_sigmask = current->blocked;
siginitset(&current->blocked, set);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

set &= _BLOCKABLE;
siginitset(&blocked, set);
set_current_blocked(&blocked);

current->state = TASK_INTERRUPTIBLE;
schedule();
Expand Down Expand Up @@ -139,10 +140,7 @@ asmlinkage void do_sigreturn(struct pt_regs *regs)
goto segv_and_exit;

sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
return;

segv_and_exit:
Expand Down Expand Up @@ -209,10 +207,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
}

sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
return;
segv:
force_sig(SIGSEGV, current);
Expand Down Expand Up @@ -470,6 +465,7 @@ static inline int
handle_signal(unsigned long signr, struct k_sigaction *ka,
siginfo_t *info, sigset_t *oldset, struct pt_regs *regs)
{
sigset_t blocked;
int err;

if (ka->sa.sa_flags & SA_SIGINFO)
Expand All @@ -480,12 +476,10 @@ handle_signal(unsigned long signr, struct k_sigaction *ka,
if (err)
return err;

spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NOMASK))
sigaddset(&current->blocked, signr);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
sigaddset(&blocked, signr);
set_current_blocked(&blocked);

tracehook_signal_handler(signr, info, ka, regs, 0);

Expand Down Expand Up @@ -581,7 +575,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
*/
if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
clear_thread_flag(TIF_RESTORE_SIGMASK);
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
set_current_blocked(&current->saved_sigmask);
}
}

Expand Down
32 changes: 13 additions & 19 deletions arch/sparc/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ asmlinkage void sparc64_set_context(struct pt_regs *regs)
goto do_sigsegv;
}
sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
}
if (test_thread_flag(TIF_32BIT)) {
pc &= 0xffffffff;
Expand Down Expand Up @@ -242,12 +239,13 @@ struct rt_signal_frame {

static long _sigpause_common(old_sigset_t set)
{
set &= _BLOCKABLE;
spin_lock_irq(&current->sighand->siglock);
sigset_t blocked;

current->saved_sigmask = current->blocked;
siginitset(&current->blocked, set);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

set &= _BLOCKABLE;
siginitset(&blocked, set);
set_current_blocked(&blocked);

current->state = TASK_INTERRUPTIBLE;
schedule();
Expand Down Expand Up @@ -327,10 +325,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
pt_regs_clear_syscall(regs);

sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
set_current_blocked(&set);
return;
segv:
force_sig(SIGSEGV, current);
Expand Down Expand Up @@ -484,18 +479,17 @@ static inline int handle_signal(unsigned long signr, struct k_sigaction *ka,
siginfo_t *info,
sigset_t *oldset, struct pt_regs *regs)
{
sigset_t blocked;
int err;

err = setup_rt_frame(ka, regs, signr, oldset,
(ka->sa.sa_flags & SA_SIGINFO) ? info : NULL);
if (err)
return err;
spin_lock_irq(&current->sighand->siglock);
sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NOMASK))
sigaddset(&current->blocked,signr);
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
sigaddset(&blocked, signr);
set_current_blocked(&blocked);

tracehook_signal_handler(signr, info, ka, regs, 0);

Expand Down Expand Up @@ -601,7 +595,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
*/
if (current_thread_info()->status & TS_RESTORE_SIGMASK) {
current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
set_current_blocked(&current->saved_sigmask);
}
}

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/mm/leon_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ unsigned long srmmu_swprobe(unsigned long vaddr, unsigned long *paddr)
printk(KERN_INFO "swprobe: padde %x\n", paddr_calc);
if (paddr)
*paddr = paddr_calc;
return paddrbase;
return pte;
}

void leon_flush_icache_all(void)
Expand Down

0 comments on commit fd11e15

Please sign in to comment.