Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20111
b: refs/heads/master
c: 7b3e2fc
h: refs/heads/master
i:
  20109: c48f0a1
  20107: be661d3
  20103: 7aedd4d
  20095: a6c425e
v: v3
  • Loading branch information
Ralf Baechle committed Feb 8, 2006
1 parent 78f6481 commit 2867e30
Show file tree
Hide file tree
Showing 37 changed files with 326 additions and 306 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: 423ab71a8bd2345f87724abe320092a3a516b0bb
refs/heads/master: 7b3e2fc847c8325a7b35185fa1fc2f1729ed9c5b
25 changes: 21 additions & 4 deletions trunk/arch/alpha/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ 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 @@ -439,7 +442,7 @@ setup_smp(void)
if ((cpu->flags & 0x1cc) == 0x1cc) {
smp_num_probed++;
/* Assume here that "whami" == index */
cpu_set(i, cpu_possible_map);
hwrpb_cpu_present_mask |= (1UL << i);
cpu->pal_revision = boot_cpu_palrev;
}

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

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

/*
Expand All @@ -464,6 +467,8 @@ 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 @@ -481,7 +486,19 @@ smp_prepare_cpus(unsigned int max_cpus)

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

smp_num_cpus = smp_num_probed;
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;
}

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

config ARCH_MTD_XIP
bool

source "init/Kconfig"

menu "System Type"
Expand Down Expand Up @@ -139,7 +136,6 @@ config ARCH_L7200

config ARCH_PXA
bool "PXA2xx-based"
select ARCH_MTD_XIP

config ARCH_RPC
bool "RiscPC"
Expand All @@ -156,7 +152,6 @@ config ARCH_SA1100
bool "SA1100-based"
select ISA
select ARCH_DISCONTIGMEM_ENABLE
select ARCH_MTD_XIP

config ARCH_S3C2410
bool "Samsung S3C2410"
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,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 int do_signal(struct pt_regs *regs);
extern int do_signal32(struct pt_regs *regs);

/*
* Native o32 and N64 ABI without DSP ASE
Expand Down
86 changes: 50 additions & 36 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)
int do_signal(struct pt_regs *regs)
{
struct k_sigaction ka;
sigset_t *oldset;
siginfo_t info;
int signr;

Expand All @@ -437,12 +428,26 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
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,27 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
regs->cp0_epc -= 4;
}
}

/*
* 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);
}

return 0;
}

/*
* 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);
}
8 changes: 4 additions & 4 deletions trunk/arch/mips/kernel/signal32.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,11 +694,11 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
current->comm, current->pid,
frame, regs->cp0_epc, frame->sf_code);
#endif
return 1;
return 0;

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

int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
Expand Down Expand Up @@ -765,11 +765,11 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
current->comm, current->pid,
frame, regs->cp0_epc, frame->rs_code);
#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 Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/kernel/signal_n32.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ int setup_rt_frame_n32(struct k_sigaction * ka,
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;
}
18 changes: 11 additions & 7 deletions trunk/arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
return 0;
}

#define to_user_ptr(p) ptr_to_compat(p)
static inline compat_uptr_t to_user_ptr(void *kp)
{
return (compat_uptr_t)(u64)kp;
}

#define from_user_ptr(p) compat_ptr(p)

static inline int save_general_regs(struct pt_regs *regs,
Expand Down Expand Up @@ -209,8 +213,8 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka,
return 0;
}

#define to_user_ptr(p) ((unsigned long)(p))
#define from_user_ptr(p) ((void __user *)(p))
#define to_user_ptr(p) (p)
#define from_user_ptr(p) (p)

static inline int save_general_regs(struct pt_regs *regs,
struct mcontext __user *frame)
Expand Down Expand Up @@ -522,7 +526,7 @@ long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act,

ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
if (!ret && oact) {
ret = put_user(to_user_ptr(old_ka.sa.sa_handler), &oact->sa_handler);
ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler);
ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask);
ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
}
Expand Down Expand Up @@ -671,8 +675,8 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo
int compat_sys_sigaltstack(u32 __new, u32 __old, int r5,
int r6, int r7, int r8, struct pt_regs *regs)
{
stack_32_t __user * newstack = compat_ptr(__new);
stack_32_t __user * oldstack = compat_ptr(__old);
stack_32_t __user * newstack = (stack_32_t __user *)(long) __new;
stack_32_t __user * oldstack = (stack_32_t __user *)(long) __old;
stack_t uss, uoss;
int ret;
mm_segment_t old_fs;
Expand Down Expand Up @@ -704,7 +708,7 @@ int compat_sys_sigaltstack(u32 __new, u32 __old, int r5,
set_fs(old_fs);
/* Copy the stack information to the user output buffer */
if (!ret && oldstack &&
(put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) ||
(put_user((long)uoss.ss_sp, &oldstack->ss_sp) ||
__put_user(uoss.ss_flags, &oldstack->ss_flags) ||
__put_user(uoss.ss_size, &oldstack->ss_size)))
return -EFAULT;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/kernel/signal_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ struct rt_sigframe {
struct ucontext uc;
unsigned long _unused[2];
unsigned int tramp[TRAMP_SIZE];
struct siginfo __user *pinfo;
void __user *puc;
struct siginfo *pinfo;
void *puc;
struct siginfo info;
/* 64 bit ABI allows for 288 bytes below sp before decrementing it. */
char abigap[288];
Expand Down
Loading

0 comments on commit 2867e30

Please sign in to comment.