Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26532
b: refs/heads/master
c: 19ca5d2
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed May 6, 2006
1 parent df23d4c commit c4ec0b9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 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: f5b40e363ad6041a96e3da32281d8faa191597b9
refs/heads/master: 19ca5d27e15c10d8529984ecd98dcba2637edcd2
16 changes: 16 additions & 0 deletions trunk/arch/arm/mach-sa1100/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,26 @@ static void sa1100_unmask_irq(unsigned int irq)
ICMR |= (1 << irq);
}

/*
* Apart form GPIOs, only the RTC alarm can be a wakeup event.
*/
static int sa1100_set_wake(unsigned int irq, unsigned int on)
{
if (irq == IRQ_RTCAlrm) {
if (on)
PWER |= PWER_RTC;
else
PWER &= ~PWER_RTC;
return 0;
}
return -EINVAL;
}

static struct irqchip sa1100_normal_chip = {
.ack = sa1100_mask_irq,
.mask = sa1100_mask_irq,
.unmask = sa1100_unmask_irq,
.set_wake = sa1100_set_wake,
};

static struct resource irq_resource = {
Expand Down
39 changes: 18 additions & 21 deletions trunk/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,12 @@ int ptrace_may_attach(struct task_struct *task)
int ptrace_attach(struct task_struct *task)
{
int retval;

task_lock(task);
retval = -EPERM;
if (task->pid <= 1)
goto out;
goto bad;
if (task->tgid == current->tgid)
goto out;

write_lock_irq(&tasklist_lock);
task_lock(task);

goto bad;
/* the same process cannot be attached many times */
if (task->ptrace & PT_PTRACED)
goto bad;
Expand All @@ -170,15 +166,17 @@ int ptrace_attach(struct task_struct *task)
? PT_ATTACHED : 0);
if (capable(CAP_SYS_PTRACE))
task->ptrace |= PT_PTRACE_CAP;
task_unlock(task);

write_lock_irq(&tasklist_lock);
__ptrace_link(task, current);
write_unlock_irq(&tasklist_lock);

force_sig_specific(SIGSTOP, task);
return 0;

bad:
write_unlock_irq(&tasklist_lock);
task_unlock(task);
out:
return retval;
}

Expand Down Expand Up @@ -419,22 +417,21 @@ int ptrace_request(struct task_struct *child, long request,
*/
int ptrace_traceme(void)
{
int ret = -EPERM;
int ret;

/*
* Are we already being traced?
*/
task_lock(current);
if (!(current->ptrace & PT_PTRACED)) {
ret = security_ptrace(current->parent, current);
/*
* Set the ptrace bit in the process ptrace flags.
*/
if (!ret)
current->ptrace |= PT_PTRACED;
}
task_unlock(current);
return ret;
if (current->ptrace & PT_PTRACED)
return -EPERM;
ret = security_ptrace(current->parent, current);
if (ret)
return -EPERM;
/*
* Set the ptrace bit in the process ptrace flags.
*/
current->ptrace |= PT_PTRACED;
return 0;
}

/**
Expand Down

0 comments on commit c4ec0b9

Please sign in to comment.