aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/ia32
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 16:38:45 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 16:38:45 -0400
commit38cb162b7585d837083b8365da1eb32687c5164c (patch)
treee4ae15715b23b320b1a92699fac767bc766c8f0b /arch/ia64/ia32
parentba7cc09c9c9e29a57045dc5bbf843ac1cfad3283 (diff)
parente180583b85f4a48bd55924712c88e5d8eb182e08 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64] wire up pselect, ppoll [IA64] Add TIF_RESTORE_SIGMASK [IA64] unwind did not work for processes born with CLONE_STOPPED [IA64] Optional method to purge the TLB on SN systems [IA64] SPIN_LOCK_UNLOCKED macro cleanup in arch/ia64 [IA64-SN2][KJ] mmtimer.c-kzalloc [IA64] fix stack alignment for ia32 signal handlers [IA64] - Altix: hotplug after intr redirect can crash system [IA64] save and restore cpus_allowed in cpu_idle_wait [IA64] Removal of percpu TR cleanup in kexec code [IA64] Fix some section mismatch errors
Diffstat (limited to 'arch/ia64/ia32')
-rw-r--r--arch/ia64/ia32/ia32_entry.S39
-rw-r--r--arch/ia64/ia32/ia32_signal.c65
2 files changed, 16 insertions, 88 deletions
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index 687e5fdc9683..99b665e2b1d5 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -52,43 +52,6 @@ ENTRY(ia32_clone)
52 br.ret.sptk.many rp 52 br.ret.sptk.many rp
53END(ia32_clone) 53END(ia32_clone)
54 54
55ENTRY(sys32_rt_sigsuspend)
56 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
57 alloc loc1=ar.pfs,8,2,3,0 // preserve all eight input regs
58 mov loc0=rp
59 mov out0=in0 // mask
60 mov out1=in1 // sigsetsize
61 mov out2=sp // out2 = &sigscratch
62 .fframe 16
63 adds sp=-16,sp // allocate dummy "sigscratch"
64 ;;
65 .body
66 br.call.sptk.many rp=ia32_rt_sigsuspend
671: .restore sp
68 adds sp=16,sp
69 mov rp=loc0
70 mov ar.pfs=loc1
71 br.ret.sptk.many rp
72END(sys32_rt_sigsuspend)
73
74ENTRY(sys32_sigsuspend)
75 .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
76 alloc loc1=ar.pfs,8,2,3,0 // preserve all eight input regs
77 mov loc0=rp
78 mov out0=in2 // mask (first two args are ignored)
79 ;;
80 mov out1=sp // out1 = &sigscratch
81 .fframe 16
82 adds sp=-16,sp // allocate dummy "sigscratch"
83 .body
84 br.call.sptk.many rp=ia32_sigsuspend
851: .restore sp
86 adds sp=16,sp
87 mov rp=loc0
88 mov ar.pfs=loc1
89 br.ret.sptk.many rp
90END(sys32_sigsuspend)
91
92GLOBAL_ENTRY(ia32_ret_from_clone) 55GLOBAL_ENTRY(ia32_ret_from_clone)
93 PT_REGS_UNWIND_INFO(0) 56 PT_REGS_UNWIND_INFO(0)
94{ /* 57{ /*
@@ -389,7 +352,7 @@ ia32_syscall_table:
389 data8 sys_rt_sigpending 352 data8 sys_rt_sigpending
390 data8 compat_sys_rt_sigtimedwait 353 data8 compat_sys_rt_sigtimedwait
391 data8 sys32_rt_sigqueueinfo 354 data8 sys32_rt_sigqueueinfo
392 data8 sys32_rt_sigsuspend 355 data8 compat_sys_rt_sigsuspend
393 data8 sys32_pread /* 180 */ 356 data8 sys32_pread /* 180 */
394 data8 sys32_pwrite 357 data8 sys32_pwrite
395 data8 sys_chown /* 16-bit version */ 358 data8 sys_chown /* 16-bit version */
diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
index 10510e585204..85e82f32e480 100644
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -451,59 +451,20 @@ sigact_set_handler (struct k_sigaction *sa, unsigned int handler, unsigned int r
451 sa->sa.sa_handler = (__sighandler_t) (((unsigned long) restorer << 32) | handler); 451 sa->sa.sa_handler = (__sighandler_t) (((unsigned long) restorer << 32) | handler);
452} 452}
453 453
454long 454asmlinkage long
455__ia32_rt_sigsuspend (compat_sigset_t *sset, unsigned int sigsetsize, struct sigscratch *scr) 455sys32_sigsuspend (int history0, int history1, old_sigset_t mask)
456{ 456{
457 extern long ia64_do_signal (sigset_t *oldset, struct sigscratch *scr, long in_syscall); 457 mask &= _BLOCKABLE;
458 sigset_t oldset, set;
459
460 scr->scratch_unat = 0; /* avoid leaking kernel bits to user level */
461 memset(&set, 0, sizeof(set));
462
463 memcpy(&set.sig, &sset->sig, sigsetsize);
464
465 sigdelsetmask(&set, ~_BLOCKABLE);
466
467 spin_lock_irq(&current->sighand->siglock); 458 spin_lock_irq(&current->sighand->siglock);
468 { 459 current->saved_sigmask = current->blocked;
469 oldset = current->blocked; 460 siginitset(&current->blocked, mask);
470 current->blocked = set; 461 recalc_sigpending();
471 recalc_sigpending();
472 }
473 spin_unlock_irq(&current->sighand->siglock); 462 spin_unlock_irq(&current->sighand->siglock);
474 463
475 /* 464 current->state = TASK_INTERRUPTIBLE;
476 * The return below usually returns to the signal handler. We need to pre-set the 465 schedule();
477 * correct error code here to ensure that the right values get saved in sigcontext 466 set_thread_flag(TIF_RESTORE_SIGMASK);
478 * by ia64_do_signal. 467 return -ERESTARTNOHAND;
479 */
480 scr->pt.r8 = -EINTR;
481 while (1) {
482 current->state = TASK_INTERRUPTIBLE;
483 schedule();
484 if (ia64_do_signal(&oldset, scr, 1))
485 return -EINTR;
486 }
487}
488
489asmlinkage long
490ia32_rt_sigsuspend (compat_sigset_t __user *uset, unsigned int sigsetsize, struct sigscratch *scr)
491{
492 compat_sigset_t set;
493
494 if (sigsetsize > sizeof(compat_sigset_t))
495 return -EINVAL;
496
497 if (copy_from_user(&set.sig, &uset->sig, sigsetsize))
498 return -EFAULT;
499
500 return __ia32_rt_sigsuspend(&set, sigsetsize, scr);
501}
502
503asmlinkage long
504ia32_sigsuspend (unsigned int mask, struct sigscratch *scr)
505{
506 return __ia32_rt_sigsuspend((compat_sigset_t *) &mask, sizeof(mask), scr);
507} 468}
508 469
509asmlinkage long 470asmlinkage long
@@ -810,7 +771,11 @@ get_sigframe (struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
810 } 771 }
811 /* Legacy stack switching not supported */ 772 /* Legacy stack switching not supported */
812 773
813 return (void __user *)((esp - frame_size) & -8ul); 774 esp -= frame_size;
775 /* Align the stack pointer according to the i386 ABI,
776 * i.e. so that on function entry ((sp + 4) & 15) == 0. */
777 esp = ((esp + 4) & -16ul) - 4;
778 return (void __user *) esp;
814} 779}
815 780
816static int 781static int