From 06615f62b17d7de6e12d2f5ec6b88cf30af08413 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 23 Nov 2000 02:00:47 +0000 Subject: Merge with Linux 2.4.0-test10. --- arch/mips/kernel/ptrace.c | 21 ++++++++++++++++----- arch/mips/kernel/time.c | 14 +++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) (limited to 'arch/mips/kernel') diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 4a55e2325..fcebe3fe2 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -1,12 +1,11 @@ -/* $Id: ptrace.c,v 1.17 1999/09/28 22:25:47 ralf Exp $ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1992 Ross Biro * Copyright (C) Linus Torvalds - * Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle + * Copyright (C) 1994, 95, 96, 97, 98, 2000 Ralf Baechle * Copyright (C) 1996 David S. Miller */ #include @@ -269,7 +268,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) res = -EIO; if ((unsigned long) data > _NSIG) break; - child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); + child->ptrace = 0; child->exit_code = data; write_lock_irq(&tasklist_lock); REMOVE_LINKS(child); @@ -280,6 +279,15 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) res = 0; break; + case PTRACE_SETOPTIONS: { + if (data & PTRACE_O_TRACESYSGOOD) + child->ptrace |= PT_TRACESYSGOOD; + else + child->ptrace &= ~PT_TRACESYSGOOD; + ret = 0; + break; + } + default: res = -EIO; goto out; @@ -296,7 +304,10 @@ asmlinkage void syscall_trace(void) if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) != (PT_PTRACED|PT_TRACESYS)) return; - current->exit_code = SIGTRAP; + /* The 0x80 provides a way for the tracing parent to distinguish + between a syscall stop and SIGTRAP delivery */ + current->exit_code = SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) + ? 0x80 : 0); current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); schedule(); diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c index 609593c6b..6b65801d5 100644 --- a/arch/mips/kernel/time.c +++ b/arch/mips/kernel/time.c @@ -26,7 +26,7 @@ #include extern volatile unsigned long wall_jiffies; -unsigned long r4k_interval = 0; +unsigned long r4k_interval; extern rwlock_t xtime_lock; /* @@ -40,7 +40,7 @@ extern rwlock_t xtime_lock; /* Cycle counter value at the previous timer interrupt.. */ -static unsigned int timerhi = 0, timerlo = 0; +static unsigned int timerhi, timerlo; /* * On MIPS only R4000 and better have a cycle counter. @@ -53,14 +53,14 @@ static unsigned long do_fast_gettimeoffset(void) unsigned long res, tmp; /* Last jiffy when do_fast_gettimeoffset() was called. */ - static unsigned long last_jiffies=0; + static unsigned long last_jiffies; unsigned long quotient; /* * Cached "1/(clocks per usec)*2^32" value. * It has to be recalculated once each jiffy. */ - static unsigned long cached_quotient=0; + static unsigned long cached_quotient; tmp = jiffies; @@ -153,7 +153,7 @@ static unsigned long do_slow_gettimeoffset(void) int count; static int count_p = LATCH; /* for the first call after boot */ - static unsigned long jiffies_p = 0; + static unsigned long jiffies_p; /* * cache volatile jiffies temporarily; we have IRQs turned off. @@ -331,7 +331,7 @@ static int set_rtc_mmss(unsigned long nowtime) } /* last time the cmos clock got updated */ -static long last_rtc_update = 0; +static long last_rtc_update; /* * timer_interrupt() needs to keep up the real-time clock, @@ -341,7 +341,7 @@ static void inline timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) { #ifdef CONFIG_DDB5074 - static unsigned cnt = 0, period = 0, dist = 0; + static unsigned cnt, period, dist; if (cnt == 0 || cnt == dist) ddb5074_led_d2(1); -- cgit v1.2.3