Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20136
b: refs/heads/master
c: cce0cac
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Feb 8, 2006
1 parent d84dccc commit 28296c8
Show file tree
Hide file tree
Showing 43 changed files with 475 additions and 342 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18f49ea207fbcf37f81395037f0dc1cacb2aac3c
refs/heads/master: cce0cac125623f9b68f25dd1350f6d616220a8dd
25 changes: 4 additions & 21 deletions trunk/arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ cpumask_t cpu_online_map;

EXPORT_SYMBOL(cpu_online_map);

/* cpus reported in the hwrpb */
static unsigned long hwrpb_cpu_present_mask __initdata = 0;

int smp_num_probed; /* Internal processor count */
int smp_num_cpus = 1; /* Number that came online. */

Expand Down Expand Up @@ -442,7 +439,7 @@ setup_smp(void)
if ((cpu->flags & 0x1cc) == 0x1cc) {
smp_num_probed++;
/* Assume here that "whami" == index */
hwrpb_cpu_present_mask |= (1UL << i);
cpu_set(i, cpu_possible_map);
cpu->pal_revision = boot_cpu_palrev;
}

Expand All @@ -453,12 +450,12 @@ setup_smp(void)
}
} else {
smp_num_probed = 1;
hwrpb_cpu_present_mask = (1UL << boot_cpuid);
cpu_set(boot_cpuid, cpu_possible_map);
}
cpu_present_mask = cpumask_of_cpu(boot_cpuid);

printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n",
smp_num_probed, hwrpb_cpu_present_mask);
smp_num_probed, cpu_possible_map.bits[0]);
}

/*
Expand All @@ -467,8 +464,6 @@ setup_smp(void)
void __init
smp_prepare_cpus(unsigned int max_cpus)
{
int cpu_count, i;

/* Take care of some initial bookkeeping. */
memset(ipi_data, 0, sizeof(ipi_data));

Expand All @@ -486,19 +481,7 @@ smp_prepare_cpus(unsigned int max_cpus)

printk(KERN_INFO "SMP starting up secondaries.\n");

cpu_count = 1;
for (i = 0; (i < NR_CPUS) && (cpu_count < max_cpus); i++) {
if (i == boot_cpuid)
continue;

if (((hwrpb_cpu_present_mask >> i) & 1) == 0)
continue;

cpu_set(i, cpu_possible_map);
cpu_count++;
}

smp_num_cpus = cpu_count;
smp_num_cpus = smp_num_probed;
}

void __devinit
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ config GENERIC_ISA_DMA
config FIQ
bool

config ARCH_MTD_XIP
bool

source "init/Kconfig"

menu "System Type"
Expand Down Expand Up @@ -153,6 +156,7 @@ config ARCH_L7200

config ARCH_PXA
bool "PXA2xx-based"
select ARCH_MTD_XIP
help
Support for Intel's PXA2XX processor line.

Expand All @@ -171,6 +175,7 @@ config ARCH_SA1100
bool "SA1100-based"
select ISA
select ARCH_DISCONTIGMEM_ENABLE
select ARCH_MTD_XIP
help
Support for StrongARM 11x0 based boards.

Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/mips/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* for more details.
*
* Copyright (C) 1994 - 1999, 2000 by Ralf Baechle and others.
* Copyright (C) 2005, 2006 by Ralf Baechle (ralf@linux-mips.org)
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
* Copyright (C) 2004 Thiemo Seufer
*/
Expand Down Expand Up @@ -58,8 +59,8 @@ ATTRIB_NORET void cpu_idle(void)
}
}

extern int do_signal(sigset_t *oldset, struct pt_regs *regs);
extern int do_signal32(sigset_t *oldset, struct pt_regs *regs);
extern void do_signal(struct pt_regs *regs);
extern void do_signal32(struct pt_regs *regs);

/*
* Native o32 and N64 ABI without DSP ASE
Expand Down
17 changes: 17 additions & 0 deletions trunk/arch/mips/kernel/scall32-o32.S
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,23 @@ einval: li v0, -EINVAL
sys sys_inotify_init 0
sys sys_inotify_add_watch 3 /* 4285 */
sys sys_inotify_rm_watch 2
sys sys_migrate_pages 4
sys sys_openat 4
sys sys_mkdirat 3
sys sys_mknodat 4 /* 4290 */
sys sys_fchownat 5
sys sys_futimesat 3
sys sys_newfstatat 4
sys sys_unlinkat 3
sys sys_renameat 4 /* 4295 */
sys sys_linkat 4
sys sys_symlinkat 3
sys sys_readlinkat 4
sys sys_fchmodat 3
sys sys_faccessat 3 /* 4300 */
sys sys_pselect6 6
sys sys_ppoll 5
sys sys_unshare 1
.endm

/* We pre-compute the number of _instruction_ bytes needed to
Expand Down
17 changes: 17 additions & 0 deletions trunk/arch/mips/kernel/scall64-64.S
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,20 @@ sys_call_table:
PTR sys_inotify_init
PTR sys_inotify_add_watch
PTR sys_inotify_rm_watch /* 5245 */
PTR sys_migrate_pages
PTR sys_openat
PTR sys_mkdirat
PTR sys_mknodat
PTR sys_fchownat /* 5250 */
PTR sys_futimesat
PTR sys_newfstatat
PTR sys_unlinkat
PTR sys_renameat
PTR sys_linkat /* 5255 */
PTR sys_symlinkat
PTR sys_readlinkat
PTR sys_fchmodat
PTR sys_faccessat
PTR sys_pselect6 /* 5260 */
PTR sys_ppoll
PTR sys_unshare
17 changes: 17 additions & 0 deletions trunk/arch/mips/kernel/scall64-n32.S
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,20 @@ EXPORT(sysn32_call_table)
PTR sys_inotify_init
PTR sys_inotify_add_watch
PTR sys_inotify_rm_watch
PTR sys_migrate_pages /* 6250 */
PTR sys_openat
PTR sys_mkdirat
PTR sys_mknodat
PTR sys_fchownat
PTR sys_futimesat /* 6255 */
PTR sys_newfstatat
PTR sys_unlinkat
PTR sys_renameat
PTR sys_linkat
PTR sys_symlinkat /* 6260 */
PTR sys_readlinkat
PTR sys_fchmodat
PTR sys_faccessat
PTR sys_pselect6
PTR sys_ppoll /* 6265 */
PTR sys_unshare
17 changes: 17 additions & 0 deletions trunk/arch/mips/kernel/scall64-o32.S
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,21 @@ sys_call_table:
PTR sys_inotify_init
PTR sys_inotify_add_watch /* 4285 */
PTR sys_inotify_rm_watch
PTR sys_migrate_pages
PTR compat_sys_openat
PTR sys_mkdirat
PTR sys_mknodat /* 4290 */
PTR sys_fchownat
PTR compat_sys_futimesat
PTR compat_sys_newfstatat
PTR sys_unlinkat
PTR sys_renameat /* 4295 */
PTR sys_linkat
PTR sys_symlinkat
PTR sys_readlinkat
PTR sys_fchmodat
PTR sys_faccessat /* 4300 */
PTR sys_pselect6
PTR sys_ppoll
PTR sys_unshare
.size sys_call_table,.-sys_call_table
88 changes: 50 additions & 38 deletions trunk/arch/mips/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@

#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))

int do_signal(sigset_t *oldset, struct pt_regs *regs);

/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
Expand All @@ -50,7 +48,7 @@ save_static_function(sys_sigsuspend);
__attribute_used__ noinline static int
_sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
{
sigset_t saveset, newset;
sigset_t newset;
sigset_t __user *uset;

uset = (sigset_t __user *) regs.regs[4];
Expand All @@ -59,27 +57,23 @@ _sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
sigdelsetmask(&newset, ~_BLOCKABLE);

spin_lock_irq(&current->sighand->siglock);
saveset = current->blocked;
current->saved_sigmask = current->blocked;
current->blocked = newset;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

regs.regs[2] = EINTR;
regs.regs[7] = 1;
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
if (do_signal(&saveset, &regs))
return -EINTR;
}
current->state = TASK_INTERRUPTIBLE;
schedule();
set_thread_flag(TIF_RESTORE_SIGMASK);
return -ERESTARTNOHAND;
}
#endif

save_static_function(sys_rt_sigsuspend);
__attribute_used__ noinline static int
_sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
{
sigset_t saveset, newset;
sigset_t newset;
sigset_t __user *unewset;
size_t sigsetsize;

Expand All @@ -94,19 +88,15 @@ _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
sigdelsetmask(&newset, ~_BLOCKABLE);

spin_lock_irq(&current->sighand->siglock);
saveset = current->blocked;
current->saved_sigmask = current->blocked;
current->blocked = newset;
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);

regs.regs[2] = EINTR;
regs.regs[7] = 1;
while (1) {
current->state = TASK_INTERRUPTIBLE;
schedule();
if (do_signal(&saveset, &regs))
return -EINTR;
}
current->state = TASK_INTERRUPTIBLE;
schedule();
set_thread_flag(TIF_RESTORE_SIGMASK);
return -ERESTARTNOHAND;
}

#ifdef CONFIG_TRAD_SIGNALS
Expand Down Expand Up @@ -315,11 +305,11 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
current->comm, current->pid,
frame, regs->cp0_epc, frame->regs[31]);
#endif
return 1;
return 0;

give_sigsegv:
force_sigsegv(signr, current);
return 0;
return -EFAULT;
}
#endif

Expand Down Expand Up @@ -375,11 +365,11 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
current->comm, current->pid,
frame, regs->cp0_epc, regs->regs[31]);
#endif
return 1;
return 0;

give_sigsegv:
force_sigsegv(signr, current);
return 0;
return -EFAULT;
}

static inline int handle_signal(unsigned long sig, siginfo_t *info,
Expand All @@ -393,7 +383,7 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info,
regs->regs[2] = EINTR;
break;
case ERESTARTSYS:
if(!(ka->sa.sa_flags & SA_RESTART)) {
if (!(ka->sa.sa_flags & SA_RESTART)) {
regs->regs[2] = EINTR;
break;
}
Expand All @@ -420,9 +410,10 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info,
return ret;
}

int do_signal(sigset_t *oldset, struct pt_regs *regs)
void do_signal(struct pt_regs *regs)
{
struct k_sigaction ka;
sigset_t *oldset;
siginfo_t info;
int signr;

Expand All @@ -432,17 +423,31 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
* if so.
*/
if (!user_mode(regs))
return 1;
return;

if (try_to_freeze())
goto no_signal;

if (!oldset)
if (test_thread_flag(TIF_RESTORE_SIGMASK))
oldset = &current->saved_sigmask;
else
oldset = &current->blocked;


signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0)
return handle_signal(signr, &info, &ka, oldset, regs);
if (signr > 0) {
/* Whee! Actually deliver the signal. */
if (handle_signal(signr, &info, &ka, oldset, regs) == 0) {
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if (test_thread_flag(TIF_RESTORE_SIGMASK))
clear_thread_flag(TIF_RESTORE_SIGMASK);
}
}

no_signal:
/*
Expand All @@ -463,18 +468,25 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
regs->cp0_epc -= 4;
}
}
return 0;

/*
* If there's no signal to deliver, we just put the saved sigmask
* back
*/
if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
clear_thread_flag(TIF_RESTORE_SIGMASK);
sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
}
}

/*
* notification of userspace execution resumption
* - triggered by current->work.notify_resume
* - triggered by the TIF_WORK_MASK flags
*/
asmlinkage void do_notify_resume(struct pt_regs *regs, sigset_t *oldset,
asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
__u32 thread_info_flags)
{
/* deal with pending signal delivery */
if (thread_info_flags & _TIF_SIGPENDING) {
current->thread.abi->do_signal(oldset, regs);
}
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
current->thread.abi->do_signal(regs);
}
Loading

0 comments on commit 28296c8

Please sign in to comment.