From: Linus Torvalds Date: Mon, 26 Feb 2007 20:48:06 +0000 (-0800) Subject: Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6 X-Git-Tag: v2.6.21-rc2~35 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=b0138a6cb7923a997d278b47c176778534d1095b;p=net-next-2.6.git Merge master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6 * master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (78 commits) [PARISC] Use symbolic last syscall in __NR_Linux_syscalls [PARISC] Add missing statfs64 and fstatfs64 syscalls Revert "[PARISC] Optimize TLB flush on SMP systems" [PARISC] Compat signal fixes for 64-bit parisc [PARISC] Reorder syscalls to match unistd.h Revert "[PATCH] make kernel/signal.c:kill_proc_info() static" [PARISC] fix sys_rt_sigqueueinfo [PARISC] fix section mismatch warnings in harmony sound driver [PARISC] do not export get_register/set_register [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code [PARISC] convert to use CONFIG_64BIT instead of __LP64__ [PARISC] use CONFIG_64BIT instead of __LP64__ [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro [PARISC] more ENTRY(), ENDPROC(), END() conversions [PARISC] fix ENTRY() and ENDPROC() for 64bit-parisc [PARISC] Fixes /proc/cpuinfo cache output on B160L [PARISC] implement standard ENTRY(), END() and ENDPROC() [PARISC] kill ENTRY_SYS_CPUS [PARISC] clean up debugging printks in smp.c [PARISC] factor syscall_restart code out of do_signal ... Fix conflict in include/linux/sched.h due to kill_proc_info() being made publicly available to PARISC again. --- b0138a6cb7923a997d278b47c176778534d1095b diff --cc arch/parisc/kernel/time.c index 5f1b51af06a,ccdce6ef67c..d1db8e51865 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c @@@ -172,122 -169,53 +169,42 @@@ unsigned long profile_pc(struct pt_reg EXPORT_SYMBOL(profile_pc); - /* - * Return the number of micro-seconds that elapsed since the last - * update to wall time (aka xtime). The xtime_lock - * must be at least read-locked when calling this routine. - */ - static inline unsigned long gettimeoffset (void) - { - #ifndef CONFIG_SMP - /* - * FIXME: This won't work on smp because jiffies are updated by cpu 0. - * Once parisc-linux learns the cr16 difference between processors, - * this could be made to work. - */ - unsigned long now; - unsigned long prev_tick; - unsigned long next_tick; - unsigned long elapsed_cycles; - unsigned long usec; - unsigned long cpuid = smp_processor_id(); - unsigned long cpt = clocktick; - - next_tick = cpu_data[cpuid].it_value; - now = mfctl(16); /* Read the hardware interval timer. */ + /* clock source code */ - prev_tick = next_tick - cpt; + static cycle_t read_cr16(void) + { + return get_cycles(); + } - /* Assume Scenario 1: "now" is later than prev_tick. */ - elapsed_cycles = now - prev_tick; + static int cr16_update_callback(void); - /* aproximate HZ with shifts. Intended math is "(elapsed/clocktick) > HZ" */ - #if HZ == 1000 - if (elapsed_cycles > (cpt << 10) ) - #elif HZ == 250 - if (elapsed_cycles > (cpt << 8) ) - #elif HZ == 100 - if (elapsed_cycles > (cpt << 7) ) - #else - #warn WTF is HZ set to anyway? - if (elapsed_cycles > (HZ * cpt) ) - #endif - { - /* Scenario 3: clock ticks are missing. */ - printk (KERN_CRIT "gettimeoffset(CPU %ld): missing %ld ticks!" - " cycles %lX prev/now/next %lX/%lX/%lX clock %lX\n", - cpuid, elapsed_cycles / cpt, - elapsed_cycles, prev_tick, now, next_tick, cpt); - } + static struct clocksource clocksource_cr16 = { + .name = "cr16", + .rating = 300, + .read = read_cr16, + .mask = CLOCKSOURCE_MASK(BITS_PER_LONG), + .mult = 0, /* to be set */ + .shift = 22, + .update_callback = cr16_update_callback, + .is_continuous = 1, + }; - /* FIXME: Can we improve the precision? Not with PAGE0. */ - usec = (elapsed_cycles * 10000) / PAGE0->mem_10msec; - return usec; - #else - return 0; - #endif - } - - void - do_gettimeofday (struct timeval *tv) + static int cr16_update_callback(void) { - unsigned long flags, seq, usec, sec; - - /* Hold xtime_lock and adjust timeval. */ - do { - seq = read_seqbegin_irqsave(&xtime_lock, flags); - usec = gettimeoffset(); - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); - - /* Move adjusted usec's into sec's. */ - while (usec >= USEC_PER_SEC) { - usec -= USEC_PER_SEC; - ++sec; + int change = 0; + + /* since the cr16 cycle counters are not syncronized across CPUs, + we'll check if we should switch to a safe clocksource: */ + if (clocksource_cr16.rating != 0 && num_online_cpus() > 1) { + clocksource_cr16.rating = 0; + clocksource_reselect(); + change = 1; } - /* Return adjusted result. */ - tv->tv_sec = sec; - tv->tv_usec = usec; + return change; } - EXPORT_SYMBOL(do_gettimeofday); - - int - do_settimeofday (struct timespec *tv) - { - time_t wtm_sec, sec = tv->tv_sec; - long wtm_nsec, nsec = tv->tv_nsec; - - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) - return -EINVAL; - - write_seqlock_irq(&xtime_lock); - { - /* - * This is revolting. We need to set "xtime" - * correctly. However, the value in this location is - * the value at the most recent update of wall time. - * Discover what correction gettimeofday would have - * done, and then undo it! - */ - nsec -= gettimeoffset() * 1000; - - wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); - wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); - - set_normalized_timespec(&xtime, sec, nsec); - set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); - - ntp_clear(); - } - write_sequnlock_irq(&xtime_lock); - clock_was_set(); - return 0; - } - EXPORT_SYMBOL(do_settimeofday); -/* - * XXX: We can do better than this. - * Returns nanoseconds - */ - -unsigned long long sched_clock(void) -{ - return (unsigned long long)jiffies * (1000000000 / HZ); -} - - void __init start_cpu_itimer(void) { unsigned int cpu = smp_processor_id(); diff --cc include/linux/sched.h index 5053dc01fad,c9045815e62..6f7c9a4d80e --- a/include/linux/sched.h +++ b/include/linux/sched.h @@@ -1329,6 -1327,9 +1329,7 @@@ extern int kill_pid_info(int sig, struc extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); extern int kill_pgrp(struct pid *pid, int sig, int priv); extern int kill_pid(struct pid *pid, int sig, int priv); -extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); -extern int kill_pg_info(int, struct siginfo *, pid_t); + extern int kill_proc_info(int, struct siginfo *, pid_t); extern void do_notify_parent(struct task_struct *, int); extern void force_sig(int, struct task_struct *); extern void force_sig_specific(int, struct task_struct *);