Commit cc2cb79b authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/linux-2.5_ppc64
parents 4ce6b618 f6c3f3ce
...@@ -18,7 +18,8 @@ KERNELLOAD =0xc000000000000000 ...@@ -18,7 +18,8 @@ KERNELLOAD =0xc000000000000000
LINKFLAGS = -T arch/ppc64/vmlinux.lds -Bstatic \ LINKFLAGS = -T arch/ppc64/vmlinux.lds -Bstatic \
-e $(KERNELLOAD) -Ttext $(KERNELLOAD) -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
CFLAGS := $(CFLAGS) -fsigned-char -msoft-float -pipe \ CFLAGS := $(CFLAGS) -fsigned-char -msoft-float -pipe \
-Wno-uninitialized -mminimal-toc -mtraceback=full -Wno-uninitialized -mminimal-toc -mtraceback=full \
-Wa,-mpower4
CPP = $(CC) -E $(CFLAGS) CPP = $(CC) -E $(CFLAGS)
......
...@@ -153,7 +153,7 @@ make_bi_recs(unsigned long addr) ...@@ -153,7 +153,7 @@ make_bi_recs(unsigned long addr)
rec = bi_rec_alloc(rec, 2); rec = bi_rec_alloc(rec, 2);
rec->tag = BI_MACHTYPE; rec->tag = BI_MACHTYPE;
rec->data[0] = _MACH_pSeries; rec->data[0] = PLATFORM_PSERIES;
rec->data[1] = 1; rec->data[1] = 1;
if ( initrd_size > 0 ) { if ( initrd_size > 0 ) {
......
...@@ -103,8 +103,12 @@ if [ "$CONFIG_SCSI" != "n" ]; then ...@@ -103,8 +103,12 @@ if [ "$CONFIG_SCSI" != "n" ]; then
fi fi
endmenu endmenu
source drivers/message/fusion/Config.in
source drivers/ieee1394/Config.in source drivers/ieee1394/Config.in
source drivers/message/i2o/Config.in
if [ "$CONFIG_NET" = "y" ]; then if [ "$CONFIG_NET" = "y" ]; then
mainmenu_option next_comment mainmenu_option next_comment
comment 'Network device support' comment 'Network device support'
...@@ -181,6 +185,9 @@ if [ "$CONFIG_VIOCD" = "y" ]; then ...@@ -181,6 +185,9 @@ if [ "$CONFIG_VIOCD" = "y" ]; then
fi fi
source drivers/char/Config.in source drivers/char/Config.in
source drivers/media/Config.in
source fs/Config.in source fs/Config.in
mainmenu_option next_comment mainmenu_option next_comment
...@@ -194,6 +201,8 @@ endmenu ...@@ -194,6 +201,8 @@ endmenu
source drivers/usb/Config.in source drivers/usb/Config.in
source net/bluetooth/Config.in
mainmenu_option next_comment mainmenu_option next_comment
comment 'Kernel hacking' comment 'Kernel hacking'
......
...@@ -146,3 +146,8 @@ int cpu_idle(void) ...@@ -146,3 +146,8 @@ int cpu_idle(void)
} }
#endif /* CONFIG_PPC_ISERIES */ #endif /* CONFIG_PPC_ISERIES */
void default_idle(void)
{
barrier();
}
...@@ -3756,6 +3756,7 @@ COMPATIBLE_IOCTL(TCSETSW), ...@@ -3756,6 +3756,7 @@ COMPATIBLE_IOCTL(TCSETSW),
COMPATIBLE_IOCTL(TCSETSF), COMPATIBLE_IOCTL(TCSETSF),
COMPATIBLE_IOCTL(TIOCLINUX), COMPATIBLE_IOCTL(TIOCLINUX),
COMPATIBLE_IOCTL(TIOCSTART), COMPATIBLE_IOCTL(TIOCSTART),
COMPATIBLE_IOCTL(TIOCSTOP),
/* Little t */ /* Little t */
COMPATIBLE_IOCTL(TIOCGETD), COMPATIBLE_IOCTL(TIOCGETD),
COMPATIBLE_IOCTL(TIOCSETD), COMPATIBLE_IOCTL(TIOCSETD),
...@@ -4336,8 +4337,6 @@ COMPATIBLE_IOCTL(RNDCLEARPOOL), ...@@ -4336,8 +4337,6 @@ COMPATIBLE_IOCTL(RNDCLEARPOOL),
COMPATIBLE_IOCTL(HCIDEVUP), COMPATIBLE_IOCTL(HCIDEVUP),
COMPATIBLE_IOCTL(HCIDEVDOWN), COMPATIBLE_IOCTL(HCIDEVDOWN),
COMPATIBLE_IOCTL(HCIDEVRESET), COMPATIBLE_IOCTL(HCIDEVRESET),
COMPATIBLE_IOCTL(HCIRESETSTAT),
COMPATIBLE_IOCTL(HCIGETINFO),
COMPATIBLE_IOCTL(HCIGETDEVLIST), COMPATIBLE_IOCTL(HCIGETDEVLIST),
COMPATIBLE_IOCTL(HCISETRAW), COMPATIBLE_IOCTL(HCISETRAW),
COMPATIBLE_IOCTL(HCISETSCAN), COMPATIBLE_IOCTL(HCISETSCAN),
......
...@@ -359,7 +359,7 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va, ...@@ -359,7 +359,7 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
/* Invalidate the tlb */ /* Invalidate the tlb */
if (!large && local && __is_processor(PV_POWER4)) { if (!large && local && __is_processor(PV_POWER4)) {
_tlbiel(va, large); _tlbiel(va);
} else { } else {
spin_lock_irqsave(&pSeries_tlbie_lock, flags); spin_lock_irqsave(&pSeries_tlbie_lock, flags);
_tlbie(va, large); _tlbie(va, large);
......
/* /*
* linux/arch/ppc64/kernel/signal.c * linux/arch/ppc64/kernel/signal.c
* *
*
*
* PowerPC version * PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
* *
...@@ -107,11 +105,6 @@ long sys_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7, ...@@ -107,11 +105,6 @@ long sys_sigsuspend(old_sigset_t mask, int p2, int p3, int p4, int p6, int p7,
struct pt_regs *regs) struct pt_regs *regs)
{ {
sigset_t saveset; sigset_t saveset;
PPCDBG(PPCDBG_SYS64X, "sys_sigsuspend - running - pid=%ld current=%lx comm=%s \n",
current->pid, current, current->comm);
mask &= _BLOCKABLE; mask &= _BLOCKABLE;
spin_lock_irq(&current->sigmask_lock); spin_lock_irq(&current->sigmask_lock);
...@@ -142,11 +135,7 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int ...@@ -142,11 +135,7 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int
{ {
sigset_t saveset, newset; sigset_t saveset, newset;
/* XXX: Don't preclude handling different sized sigset_t's. */
PPCDBG(PPCDBG_SYS64X, "sys_rt_sigsuspend - running - pid=%ld current=%lx comm=%s \n",
current->pid, current, current->comm);
/* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset_t)) if (sigsetsize != sizeof(sigset_t))
return -EINVAL; return -EINVAL;
...@@ -171,14 +160,10 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int ...@@ -171,14 +160,10 @@ long sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, int p3, int p4, int
asmlinkage long sys_sigaltstack(const stack_t *uss, stack_t *uoss) long sys_sigaltstack(const stack_t *uss, stack_t *uoss)
{ {
struct pt_regs *regs = (struct pt_regs *) &uss; struct pt_regs *regs = (struct pt_regs *) &uss;
return do_sigaltstack(uss, uoss, regs->gpr[1]);
PPCDBG(PPCDBG_SYS64X, "sys_sigaltstack - running - pid=%ld current=%lx comm=%s \n",
current->pid, current, current->comm);
return do_sigaltstack(uss, uoss, regs->gpr[1]);
} }
long sys_sigaction(int sig, const struct old_sigaction *act, long sys_sigaction(int sig, const struct old_sigaction *act,
...@@ -187,11 +172,6 @@ long sys_sigaction(int sig, const struct old_sigaction *act, ...@@ -187,11 +172,6 @@ long sys_sigaction(int sig, const struct old_sigaction *act,
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
PPCDBG(PPCDBG_SYS64X, "sys_sigaction - running - pid=%ld current=%lx comm=%s \n",
current->pid, current, current->comm);
if (act) { if (act) {
old_sigset_t mask; old_sigset_t mask;
if (verify_area(VERIFY_READ, act, sizeof(*act)) || if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
...@@ -203,7 +183,7 @@ long sys_sigaction(int sig, const struct old_sigaction *act, ...@@ -203,7 +183,7 @@ long sys_sigaction(int sig, const struct old_sigaction *act,
siginitset(&new_ka.sa.sa_mask, mask); siginitset(&new_ka.sa.sa_mask, mask);
} }
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); ret = do_sigaction(sig, (act? &new_ka: NULL), (oact? &old_ka: NULL));
if (!ret && oact) { if (!ret && oact) {
if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
...@@ -214,9 +194,6 @@ long sys_sigaction(int sig, const struct old_sigaction *act, ...@@ -214,9 +194,6 @@ long sys_sigaction(int sig, const struct old_sigaction *act,
__put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
} }
return ret; return ret;
} }
...@@ -224,7 +201,7 @@ long sys_sigaction(int sig, const struct old_sigaction *act, ...@@ -224,7 +201,7 @@ long sys_sigaction(int sig, const struct old_sigaction *act,
* When we have signals to deliver, we set up on the * When we have signals to deliver, we set up on the
* user stack, going down from the original stack pointer: * user stack, going down from the original stack pointer:
* a sigregs struct * a sigregs struct
* one or more sigcontext structs * one or more sigcontext structs with
* a gap of __SIGNAL_FRAMESIZE bytes * a gap of __SIGNAL_FRAMESIZE bytes
* *
* Each of these things must be a multiple of 16 bytes in size. * Each of these things must be a multiple of 16 bytes in size.
...@@ -241,8 +218,6 @@ struct sigregs { ...@@ -241,8 +218,6 @@ struct sigregs {
int abigap[72]; int abigap[72];
}; };
struct rt_sigframe struct rt_sigframe
{ {
unsigned long _unused[2]; unsigned long _unused[2];
...@@ -394,7 +369,6 @@ setup_rt_frame(struct pt_regs *regs, struct sigregs *frame, ...@@ -394,7 +369,6 @@ setup_rt_frame(struct pt_regs *regs, struct sigregs *frame,
regs->gpr[6] = (unsigned long) rt_sf; regs->gpr[6] = (unsigned long) rt_sf;
regs->link = (unsigned long) frame->tramp; regs->link = (unsigned long) frame->tramp;
return; return;
badframe: badframe:
...@@ -419,7 +393,7 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -419,7 +393,7 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
sigset_t set; sigset_t set;
unsigned long prevsp; unsigned long prevsp;
sc = (struct sigcontext_struct *)(regs->gpr[1] + __SIGNAL_FRAMESIZE); sc = (struct sigcontext_struct *)(regs->gpr[1] + __SIGNAL_FRAMESIZE);
if (copy_from_user(&sigctx, sc, sizeof(sigctx))) if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
goto badframe; goto badframe;
...@@ -479,7 +453,7 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -479,7 +453,7 @@ long sys_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
*/ */
static void static void
setup_frame(struct pt_regs *regs, struct sigregs *frame, setup_frame(struct pt_regs *regs, struct sigregs *frame,
unsigned long newsp) unsigned long newsp)
{ {
/* Handler is *really* a pointer to the function descriptor for /* Handler is *really* a pointer to the function descriptor for
...@@ -525,14 +499,9 @@ setup_frame(struct pt_regs *regs, struct sigregs *frame, ...@@ -525,14 +499,9 @@ setup_frame(struct pt_regs *regs, struct sigregs *frame,
regs->gpr[4] = (unsigned long) sc; regs->gpr[4] = (unsigned long) sc;
regs->link = (unsigned long) frame->tramp; regs->link = (unsigned long) frame->tramp;
PPCDBG(PPCDBG_SIGNAL, "setup_frame - returning - regs->gpr[1]=%lx, regs->gpr[4]=%lx, regs->link=%lx \n",
regs->gpr[1], regs->gpr[4], regs->link);
return; return;
badframe: badframe:
PPCDBG(PPCDBG_SIGNAL, "setup_frame - badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); PPCDBG_ENTER_DEBUGGER();
#if DEBUG_SIG #if DEBUG_SIG
printk("badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", printk("badframe in setup_frame, regs=%p frame=%p newsp=%lx\n",
regs, frame, newsp); regs, frame, newsp);
...@@ -549,22 +518,21 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, ...@@ -549,22 +518,21 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
unsigned long *newspp, unsigned long frame) unsigned long *newspp, unsigned long frame)
{ {
struct sigcontext_struct *sc; struct sigcontext_struct *sc;
struct rt_sigframe *rt_sf; struct rt_sigframe *rt_sf;
if (regs->trap == 0x0C00 /* System Call! */ if (regs->trap == 0x0C00 /* System Call! */
&& ((int)regs->result == -ERESTARTNOHAND || && ((int)regs->result == -ERESTARTNOHAND ||
((int)regs->result == -ERESTARTSYS && ((int)regs->result == -ERESTARTSYS &&
!(ka->sa.sa_flags & SA_RESTART)))) !(ka->sa.sa_flags & SA_RESTART))))
regs->result = -EINTR; regs->result = -EINTR;
/* Set up Signal Frame */
/* Set up Signal Frame */
if (ka->sa.sa_flags & SA_SIGINFO) { if (ka->sa.sa_flags & SA_SIGINFO) {
/* Put a Real Time Context onto stack */ /* Put a Real Time Context onto stack */
*newspp -= sizeof(*rt_sf); *newspp -= sizeof(*rt_sf);
rt_sf = (struct rt_sigframe *) *newspp; rt_sf = (struct rt_sigframe *) *newspp;
if (verify_area(VERIFY_WRITE, rt_sf, sizeof(*rt_sf))) if (verify_area(VERIFY_WRITE, rt_sf, sizeof(*rt_sf)))
goto badframe; goto badframe;
if (__put_user((unsigned long) ka->sa.sa_handler, &rt_sf->uc.uc_mcontext.handler) if (__put_user((unsigned long) ka->sa.sa_handler, &rt_sf->uc.uc_mcontext.handler)
|| __put_user(&rt_sf->info, &rt_sf->pinfo) || __put_user(&rt_sf->info, &rt_sf->pinfo)
...@@ -583,22 +551,21 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, ...@@ -583,22 +551,21 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
|| __put_user((struct pt_regs *)frame, &rt_sf->uc.uc_mcontext.regs) || __put_user((struct pt_regs *)frame, &rt_sf->uc.uc_mcontext.regs)
|| __put_user(sig, &rt_sf->uc.uc_mcontext.signal)) || __put_user(sig, &rt_sf->uc.uc_mcontext.signal))
goto badframe; goto badframe;
} else { } else {
/* Put another sigcontext on the stack */ /* Put another sigcontext on the stack */
*newspp -= sizeof(*sc); *newspp -= sizeof(*sc);
sc = (struct sigcontext_struct *) *newspp; sc = (struct sigcontext_struct *) *newspp;
if (verify_area(VERIFY_WRITE, sc, sizeof(*sc))) if (verify_area(VERIFY_WRITE, sc, sizeof(*sc)))
goto badframe; goto badframe;
if (__put_user((unsigned long) ka->sa.sa_handler, &sc->handler) if (__put_user((unsigned long) ka->sa.sa_handler, &sc->handler)
|| __put_user(oldset->sig[0], &sc->oldmask) || __put_user(oldset->sig[0], &sc->oldmask)
#if _NSIG_WORDS > 1 #if _NSIG_WORDS > 1
|| __put_user(oldset->sig[1], &sc->_unused[3]) || __put_user(oldset->sig[1], &sc->_unused[3])
#endif #endif
|| __put_user((struct pt_regs *)frame, &sc->regs) || __put_user((struct pt_regs *)frame, &sc->regs)
|| __put_user(sig, &sc->signal)) || __put_user(sig, &sc->signal))
goto badframe; goto badframe;
} }
if (ka->sa.sa_flags & SA_ONESHOT) if (ka->sa.sa_flags & SA_ONESHOT)
...@@ -649,11 +616,9 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -649,11 +616,9 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
for (;;) { for (;;) {
unsigned long signr; unsigned long signr;
PPCDBG(PPCDBG_SIGNAL, "do_signal - (pre) dequeueing signal - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm);
spin_lock_irq(&current->sigmask_lock); spin_lock_irq(&current->sigmask_lock);
signr = dequeue_signal(&current->blocked, &info); signr = dequeue_signal(&current->blocked, &info);
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
PPCDBG(PPCDBG_SIGNAL, "do_signal - (aft) dequeueing signal - signal=%lx - pid=%ld current=%lx comm=%s \n", signr, current->pid, current, current->comm);
if (!signr) if (!signr)
break; break;
...@@ -691,12 +656,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -691,12 +656,7 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
} }
ka = &current->sig->action[signr-1]; ka = &current->sig->action[signr-1];
PPCDBG(PPCDBG_SIGNAL, "do_signal - ka=%p, action handler=%lx \n", ka, ka->sa.sa_handler);
if (ka->sa.sa_handler == SIG_IGN) { if (ka->sa.sa_handler == SIG_IGN) {
PPCDBG(PPCDBG_SIGNAL, "do_signal - into SIG_IGN logic \n");
if (signr != SIGCHLD) if (signr != SIGCHLD)
continue; continue;
/* Check for SIGCHLD: it's special. */ /* Check for SIGCHLD: it's special. */
...@@ -707,14 +667,13 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -707,14 +667,13 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
if (ka->sa.sa_handler == SIG_DFL) { if (ka->sa.sa_handler == SIG_DFL) {
int exit_code = signr; int exit_code = signr;
PPCDBG(PPCDBG_SIGNAL, "do_signal - into SIG_DFL logic \n");
/* Init gets no signals it doesn't want. */ /* Init gets no signals it doesn't want. */
if (current->pid == 1) if (current->pid == 1)
continue; continue;
switch (signr) { switch (signr) {
case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
continue; continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU: case SIGTSTP: case SIGTTIN: case SIGTTOU:
...@@ -751,35 +710,25 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs) ...@@ -751,35 +710,25 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
newsp = frame = newsp - sizeof(struct sigregs); newsp = frame = newsp - sizeof(struct sigregs);
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
PPCDBG(PPCDBG_SIGNAL, "do_signal - GOING TO RUN SIGNAL HANDLER - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm);
handle_signal(signr, ka, &info, oldset, regs, &newsp, frame); handle_signal(signr, ka, &info, oldset, regs, &newsp, frame);
PPCDBG(PPCDBG_SIGNAL, "do_signal - after running signal handler - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm); break;
break;
} }
if (regs->trap == 0x0C00 /* System Call! */ && if (regs->trap == 0x0C00 /* System Call! */ &&
((int)regs->result == -ERESTARTNOHAND || ((int)regs->result == -ERESTARTNOHAND ||
(int)regs->result == -ERESTARTSYS || (int)regs->result == -ERESTARTSYS ||
(int)regs->result == -ERESTARTNOINTR)) { (int)regs->result == -ERESTARTNOINTR)) {
PPCDBG(PPCDBG_SIGNAL, "do_signal - going to back up & retry system call \n");
regs->gpr[3] = regs->orig_gpr3; regs->gpr[3] = regs->orig_gpr3;
regs->nip -= 4; /* Back up & retry system call */ regs->nip -= 4; /* Back up & retry system call */
regs->result = 0; regs->result = 0;
} }
if (newsp == frame) if (newsp == frame)
{ return 0; /* no signals delivered */
PPCDBG(PPCDBG_SIGNAL, "do_signal - returning w/ no signal delivered \n");
return 0; /* no signals delivered */
}
if (ka->sa.sa_flags & SA_SIGINFO) if (ka->sa.sa_flags & SA_SIGINFO)
setup_rt_frame(regs, (struct sigregs *) frame, newsp); setup_rt_frame(regs, (struct sigregs *) frame, newsp);
else else
setup_frame(regs, (struct sigregs *) frame, newsp); setup_frame(regs, (struct sigregs *) frame, newsp);
PPCDBG(PPCDBG_SIGNAL, "do_signal - returning a signal was delivered \n");
return 1; return 1;
} }
...@@ -136,8 +136,6 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old ...@@ -136,8 +136,6 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
int ret; int ret;
PPCDBG(PPCDBG_SYS32, "sys32_sigaction - entered - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm);
if (sig < 0) if (sig < 0)
{ {
sig = -sig; sig = -sig;
...@@ -153,12 +151,11 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old ...@@ -153,12 +151,11 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old
ret |= __get_user(mask, &act->sa_mask); ret |= __get_user(mask, &act->sa_mask);
if (ret) if (ret)
return ret; return ret;
PPCDBG(PPCDBG_SIGNAL, "sys32_sigaction flags =%lx \n", new_ka.sa.sa_flags);
siginitset(&new_ka.sa.sa_mask, mask); siginitset(&new_ka.sa.sa_mask, mask);
} }
ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); ret = do_sigaction(sig, (act? &new_ka: NULL), (oact? &old_ka: NULL));
if (!ret && oact) if (!ret && oact)
{ {
...@@ -168,9 +165,6 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old ...@@ -168,9 +165,6 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 *act, struct old
ret |= __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); ret |= __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
} }
PPCDBG(PPCDBG_SYS32, "sys32_sigaction - exited - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm);
return ret; return ret;
} }
...@@ -185,15 +179,11 @@ asmlinkage long sys32_sigpending(old_sigset_t32 *set) ...@@ -185,15 +179,11 @@ asmlinkage long sys32_sigpending(old_sigset_t32 *set)
int ret; int ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
PPCDBG(PPCDBG_SYS32, "sys32_sigpending - entered - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm);
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
ret = sys_sigpending(&s); ret = sys_sigpending(&s);
set_fs (old_fs); set_fs (old_fs);
if (put_user (s, set)) return -EFAULT; if (put_user (s, set)) return -EFAULT;
PPCDBG(PPCDBG_SYS32, "sys32_sigpending - exited - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm);
return ret; return ret;
} }
...@@ -213,8 +203,6 @@ asmlinkage long sys32_sigprocmask(u32 how, old_sigset_t32 *set, old_sigset_t32 * ...@@ -213,8 +203,6 @@ asmlinkage long sys32_sigprocmask(u32 how, old_sigset_t32 *set, old_sigset_t32 *
int ret; int ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
PPCDBG(PPCDBG_SYS32, "sys32_sigprocmask - entered - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm);
if (set && get_user (s, set)) return -EFAULT; if (set && get_user (s, set)) return -EFAULT;
set_fs (KERNEL_DS); set_fs (KERNEL_DS);
ret = sys_sigprocmask((int)how, set ? &s : NULL, oset ? &s : NULL); ret = sys_sigprocmask((int)how, set ? &s : NULL, oset ? &s : NULL);
...@@ -222,8 +210,6 @@ asmlinkage long sys32_sigprocmask(u32 how, old_sigset_t32 *set, old_sigset_t32 * ...@@ -222,8 +210,6 @@ asmlinkage long sys32_sigprocmask(u32 how, old_sigset_t32 *set, old_sigset_t32 *
if (ret) return ret; if (ret) return ret;
if (oset && put_user (s, oset)) return -EFAULT; if (oset && put_user (s, oset)) return -EFAULT;
PPCDBG(PPCDBG_SYS32, "sys32_sigprocmask - exited - pid=%ld current=%lx comm=%s\n", current->pid, current, current->comm);
return 0; return 0;
} }
...@@ -255,8 +241,6 @@ long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -255,8 +241,6 @@ long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
sigset_t set; sigset_t set;
unsigned int prevsp; unsigned int prevsp;
PPCDBG(PPCDBG_SIGNAL, "sys32_sigreturn - entered - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm);
sc = (struct sigcontext32_struct *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32); sc = (struct sigcontext32_struct *)(regs->gpr[1] + __SIGNAL_FRAMESIZE32);
if (copy_from_user(&sigctx, sc, sizeof(sigctx))) if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
goto badframe; goto badframe;
...@@ -380,12 +364,9 @@ long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -380,12 +364,9 @@ long sys32_sigreturn(unsigned long r3, unsigned long r4, unsigned long r5,
|| put_user(prevsp, (unsigned int*) regs->gpr[1])) || put_user(prevsp, (unsigned int*) regs->gpr[1]))
goto badframe; goto badframe;
} }
PPCDBG(PPCDBG_SIGNAL, "sys32_sigreturn - normal exit returning %ld - pid=%ld current=%lx comm=%s \n", ret, current->pid, current, current->comm);
return ret; return ret;
badframe: badframe:
PPCDBG(PPCDBG_SYS32NI, "sys32_sigreturn - badframe - pid=%ld current=%lx comm=%s \n", current->pid, current, current->comm);
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
...@@ -505,8 +486,7 @@ setup_frame32(struct pt_regs *regs, struct sigregs32 *frame, ...@@ -505,8 +486,7 @@ setup_frame32(struct pt_regs *regs, struct sigregs32 *frame,
regs->link = (unsigned long) frame->tramp; regs->link = (unsigned long) frame->tramp;
return; return;
badframe: badframe:
udbg_printf("setup_frame32 - badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); PPCDBG_ENTER_DEBUGGER();
#if DEBUG_SIG #if DEBUG_SIG
printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n", printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n",
regs, frame, newsp); regs, frame, newsp);
...@@ -715,8 +695,6 @@ asmlinkage long sys32_rt_sigaction(int sig, const struct sigaction32 *act, struc ...@@ -715,8 +695,6 @@ asmlinkage long sys32_rt_sigaction(int sig, const struct sigaction32 *act, struc
int ret; int ret;
sigset32_t set32; sigset32_t set32;
PPCDBG(PPCDBG_SIGNAL, "sys32_rt_sigaction - entered - sig=%x \n", sig);
/* XXX: Don't preclude handling different sized sigset_t's. */ /* XXX: Don't preclude handling different sized sigset_t's. */
if (sigsetsize != sizeof(sigset32_t)) if (sigsetsize != sizeof(sigset32_t))
return -EINVAL; return -EINVAL;
...@@ -765,8 +743,6 @@ asmlinkage long sys32_rt_sigaction(int sig, const struct sigaction32 *act, struc ...@@ -765,8 +743,6 @@ asmlinkage long sys32_rt_sigaction(int sig, const struct sigaction32 *act, struc
ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
} }
PPCDBG(PPCDBG_SIGNAL, "sys32_rt_sigaction - exiting - sig=%x \n", sig);
return ret; return ret;
} }
...@@ -786,8 +762,6 @@ asmlinkage long sys32_rt_sigprocmask(u32 how, sigset32_t *set, sigset32_t *oset, ...@@ -786,8 +762,6 @@ asmlinkage long sys32_rt_sigprocmask(u32 how, sigset32_t *set, sigset32_t *oset,
int ret; int ret;
mm_segment_t old_fs = get_fs(); mm_segment_t old_fs = get_fs();
PPCDBG(PPCDBG_SIGNAL, "sys32_rt_sigprocmask - entered how=%x \n", (int)how);
if (set) { if (set) {
if (copy_from_user (&s32, set, sizeof(sigset32_t))) if (copy_from_user (&s32, set, sizeof(sigset32_t)))
return -EFAULT; return -EFAULT;
...@@ -1172,9 +1146,7 @@ setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame, ...@@ -1172,9 +1146,7 @@ setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame,
return; return;
badframe:
badframe:
udbg_printf("setup_frame32 - badframe in setup_frame, regs=%p frame=%p newsp=%lx\n", regs, frame, newsp); PPCDBG_ENTER_DEBUGGER();
#if DEBUG_SIG #if DEBUG_SIG
printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n", printk("badframe in setup_frame32, regs=%p frame=%p newsp=%lx\n",
regs, frame, newsp); regs, frame, newsp);
...@@ -1182,7 +1154,6 @@ setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame, ...@@ -1182,7 +1154,6 @@ setup_rt_frame32(struct pt_regs *regs, struct sigregs32 *frame,
do_exit(SIGSEGV); do_exit(SIGSEGV);
} }
/* /*
* OK, we're invoking a handler * OK, we're invoking a handler
*/ */
...@@ -1259,7 +1230,6 @@ handle_signal32(unsigned long sig, struct k_sigaction *ka, ...@@ -1259,7 +1230,6 @@ handle_signal32(unsigned long sig, struct k_sigaction *ka,
recalc_sigpending(); recalc_sigpending();
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
} }
return; return;
badframe: badframe:
...@@ -1345,14 +1315,10 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -1345,14 +1315,10 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
for (;;) { for (;;) {
unsigned long signr; unsigned long signr;
spin_lock_irq(&current->sigmask_lock); spin_lock_irq(&current->sigmask_lock);
signr = dequeue_signal(&current->blocked, &info); signr = dequeue_signal(&current->blocked, &info);
spin_unlock_irq(&current->sigmask_lock); spin_unlock_irq(&current->sigmask_lock);
ifppcdebug(PPCDBG_SYS32) {
if (signr)
udbg_printf("do_signal32 - processing signal=%2lx - pid=%ld, comm=%s \n", signr, current->pid, current->comm);
}
if (!signr) if (!signr)
break; break;
...@@ -1390,7 +1356,6 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -1390,7 +1356,6 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
} }
ka = &current->sig->action[signr-1]; ka = &current->sig->action[signr-1];
if (ka->sa.sa_handler == SIG_IGN) { if (ka->sa.sa_handler == SIG_IGN) {
if (signr != SIGCHLD) if (signr != SIGCHLD)
continue; continue;
...@@ -1408,7 +1373,7 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -1408,7 +1373,7 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
continue; continue;
switch (signr) { switch (signr) {
case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGCONT: case SIGCHLD: case SIGWINCH: case SIGURG:
continue; continue;
case SIGTSTP: case SIGTTIN: case SIGTTOU: case SIGTSTP: case SIGTTIN: case SIGTTOU:
...@@ -1437,19 +1402,10 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -1437,19 +1402,10 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
} }
} }
PPCDBG(PPCDBG_SIGNAL, " do signal :sigaction flags = %lx \n" ,ka->sa.sa_flags);
PPCDBG(PPCDBG_SIGNAL, " do signal :on sig stack = %lx \n" ,on_sig_stack(regs->gpr[1]));
PPCDBG(PPCDBG_SIGNAL, " do signal :reg1 = %lx \n" ,regs->gpr[1]);
PPCDBG(PPCDBG_SIGNAL, " do signal :alt stack = %lx \n" ,current->sas_ss_sp);
PPCDBG(PPCDBG_SIGNAL, " do signal :alt stack size = %lx \n" ,current->sas_ss_size);
if ( (ka->sa.sa_flags & SA_ONSTACK) if ( (ka->sa.sa_flags & SA_ONSTACK)
&& (! on_sig_stack(regs->gpr[1]))) && (! on_sig_stack(regs->gpr[1])))
{
newsp = (current->sas_ss_sp + current->sas_ss_size); newsp = (current->sas_ss_sp + current->sas_ss_size);
} else else
newsp = regs->gpr[1]; newsp = regs->gpr[1];
newsp = frame = newsp - sizeof(struct sigregs32); newsp = frame = newsp - sizeof(struct sigregs32);
...@@ -1468,15 +1424,12 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) ...@@ -1468,15 +1424,12 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs)
} }
if (newsp == frame) if (newsp == frame)
{
return 0; /* no signals delivered */ return 0; /* no signals delivered */
}
// Invoke correct stack setup routine /* Invoke correct stack setup routine */
if (ka->sa.sa_flags & SA_SIGINFO) if (ka->sa.sa_flags & SA_SIGINFO)
setup_rt_frame32(regs, (struct sigregs32*)(u64)frame, newsp); setup_rt_frame32(regs, (struct sigregs32*)(u64)frame, newsp);
else else
setup_frame32(regs, (struct sigregs32*)(u64)frame, newsp); setup_frame32(regs, (struct sigregs32*)(u64)frame, newsp);
return 1; return 1;
} }
...@@ -22,7 +22,7 @@ int make_ste(unsigned long stab, ...@@ -22,7 +22,7 @@ int make_ste(unsigned long stab,
unsigned long esid, unsigned long vsid); unsigned long esid, unsigned long vsid);
void make_slbe(unsigned long esid, unsigned long vsid, void make_slbe(unsigned long esid, unsigned long vsid,
int large); int large);
extern struct Naca *naca; extern struct naca_struct *naca;
/* /*
* Build an entry for the base kernel segment and put it into * Build an entry for the base kernel segment and put it into
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define O_DIRECTORY 040000 /* must be a directory */ #define O_DIRECTORY 040000 /* must be a directory */
#define O_NOFOLLOW 0100000 /* don't follow links */ #define O_NOFOLLOW 0100000 /* don't follow links */
#define O_LARGEFILE 0200000 #define O_LARGEFILE 0200000
#define O_DIRECT 0400000 /* direct disk access hint - currently ignored */ #define O_DIRECT 0400000 /* direct disk access hint */
#define F_DUPFD 0 /* dup */ #define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */ #define F_GETFD 1 /* get close_on_exec */
......
...@@ -50,7 +50,7 @@ static inline void isync(void) ...@@ -50,7 +50,7 @@ static inline void isync(void)
#define HMT_LOW "\tor 1,1,1 # low priority\n" #define HMT_LOW "\tor 1,1,1 # low priority\n"
#define HMT_MEDIUM "\tor 2,2,2 # medium priority\n" #define HMT_MEDIUM "\tor 2,2,2 # medium priority\n"
#define HMT_MEDIUM "\tor 3,3,3 # high priority\n" #define HMT_HIGH "\tor 3,3,3 # high priority\n"
#else #else
#define HMT_low() do { } while(0) #define HMT_low() do { } while(0)
#define HMT_medium() do { } while(0) #define HMT_medium() do { } while(0)
......
...@@ -211,18 +211,11 @@ static inline void _tlbie(unsigned long va, int large) ...@@ -211,18 +211,11 @@ static inline void _tlbie(unsigned long va, int large)
asm volatile("eieio; tlbsync; ptesync": : :"memory"); asm volatile("eieio; tlbsync; ptesync": : :"memory");
} }
static inline void _tlbiel(unsigned long va, int large) static inline void _tlbiel(unsigned long va)
{ {
asm volatile("ptesync": : :"memory"); asm volatile("ptesync": : :"memory");
asm volatile("clrldi %0,%0,16\n\
if (large) { tlbiel %0" : : "r"(va) : "memory");
asm volatile("clrldi %0,%0,16\n\
tlbiel %0,1" : : "r"(va) : "memory");
} else {
asm volatile("clrldi %0,%0,16\n\
tlbiel %0,0" : : "r"(va) : "memory");
}
asm volatile("ptesync": : :"memory"); asm volatile("ptesync": : :"memory");
} }
......
...@@ -215,11 +215,14 @@ static inline int get_order(unsigned long size) ...@@ -215,11 +215,14 @@ static inline int get_order(unsigned long size)
#define __a2p(x) ((void *) absolute_to_phys(x)) #define __a2p(x) ((void *) absolute_to_phys(x))
#define __a2v(x) ((void *) __va(absolute_to_phys(x))) #define __a2v(x) ((void *) __va(absolute_to_phys(x)))
#define virt_to_page(kaddr) (mem_map+(__pa((unsigned long)kaddr) >> PAGE_SHIFT)) #define pfn_to_page(pfn) (mem_map + (pfn))
#define page_to_pfn(pfn) ((unsigned long)((pfn) - mem_map))
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) #define pfn_valid(pfn) ((pfn) < max_mapnr)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT) #define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
......
...@@ -167,24 +167,16 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)]; ...@@ -167,24 +167,16 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
* Conversion functions: convert a page and protection to a page entry, * Conversion functions: convert a page and protection to a page entry,
* and a page entry and page directory to the page they refer to. * and a page entry and page directory to the page they refer to.
* *
* mk_pte_phys takes a physical address as input
*
* mk_pte takes a (struct page *) as input * mk_pte takes a (struct page *) as input
*/ */
#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
#define mk_pte_phys(physpage,pgprot) \
({ \ #define pfn_pte(pfn,pgprot) \
pte_t pte; \ ({ \
pte_val(pte) = (((physpage)<<(PTE_SHIFT-PAGE_SHIFT)) | pgprot_val(pgprot)); \ pte_t pte; \
pte; \ pte_val(pte) = ((unsigned long)(pfn) << PTE_SHIFT) | \
}) pgprot_val(pgprot); \
pte; \
#define mk_pte(page,pgprot) \
({ \
pte_t pte; \
pte_val(pte) = ((unsigned long)((page) - mem_map) << PTE_SHIFT) | \
pgprot_val(pgprot); \
pte; \
}) })
#define pte_modify(_pte, newprot) \ #define pte_modify(_pte, newprot) \
...@@ -195,8 +187,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)]; ...@@ -195,8 +187,8 @@ extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
/* pte_clear moved to later in this file */ /* pte_clear moved to later in this file */
#define pte_pagenr(x) ((unsigned long)((pte_val(x) >> PTE_SHIFT))) #define pte_pfn(x) ((unsigned long)((pte_val(x) >> PTE_SHIFT)))
#define pte_page(x) (mem_map+pte_pagenr(x)) #define pte_page(x) pfn_to_page(pte_pfn(x))
#define pmd_set(pmdp, ptep) (pmd_val(*(pmdp)) = (__ba_to_bpn(ptep))) #define pmd_set(pmdp, ptep) (pmd_val(*(pmdp)) = (__ba_to_bpn(ptep)))
#define pmd_none(pmd) (!pmd_val(pmd)) #define pmd_none(pmd) (!pmd_val(pmd))
......
...@@ -65,6 +65,8 @@ static inline struct thread_info *current_thread_info(void) ...@@ -65,6 +65,8 @@ static inline struct thread_info *current_thread_info(void)
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define PREEMPT_ACTIVE 0x4000000
/* /*
* thread information flag bit numbers * thread information flag bit numbers
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment