source: freewrt/target/linux/ar7-2.4/patches/006-sched_use_tsc.patch@ a3abab6

freewrt_1_0 freewrt_2_0
Last change on this file since a3abab6 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@1 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 2.1 KB
  • arch/mips/kernel/time.c

    diff -urN linux.old/arch/mips/kernel/time.c linux.dev/arch/mips/kernel/time.c
    old new  
    151151unsigned int (*mips_hpt_read)(void);
    152152void (*mips_hpt_init)(unsigned int);
    153153
     154extern __u32 get_htscl(void)
     155{
     156        return timerhi;
     157}
     158
     159static __u64 tscll_last = 0;
     160
     161extern __u64 get_tscll(void)
     162{
     163        __u64 h = (__u64) timerhi;
     164        __u32 c = read_c0_count();
     165
     166        h <<= 32;
     167        h += c;
     168
     169        while (h < tscll_last)
     170                h += (((__u64) 1) << 32);
     171
     172        tscll_last = h;
     173        return h;       
     174}
    154175
    155176/*
    156177 * timeofday services, for syscalls.
     
    761782EXPORT_SYMBOL(to_tm);
    762783EXPORT_SYMBOL(rtc_set_time);
    763784EXPORT_SYMBOL(rtc_get_time);
     785EXPORT_SYMBOL(get_htscl);
     786EXPORT_SYMBOL(get_tscll);
  • include/asm-mips/timex.h

    diff -urN linux.old/include/asm-mips/timex.h linux.dev/include/asm-mips/timex.h
    old new  
    3131        return read_c0_count();
    3232}
    3333
     34extern __u32 get_htscl(void);
     35extern __u64 get_tscll(void);
     36
     37#define rdtsc(low, high) \
     38                high = get_htscl(); \
     39                low = read_c0_count();
     40
     41#define rdtscl(low) \
     42                low = read_c0_count();
     43
     44#define rdtscll(val) \
     45                val = get_tscll();
     46
    3447#define vxtime_lock()           do {} while (0)
    3548#define vxtime_unlock()         do {} while (0)
    3649
  • include/net/pkt_sched.h

    diff -urN linux.old/include/net/pkt_sched.h linux.dev/include/net/pkt_sched.h
    old new  
    55#define PSCHED_JIFFIES          2
    66#define PSCHED_CPU              3
    77
     8#ifdef __mips__
     9#define PSCHED_CLOCK_SOURCE     PSCHED_CPU
     10#else
    811#define PSCHED_CLOCK_SOURCE     PSCHED_JIFFIES
     12#endif
    913
    1014#include <linux/config.h>
    1115#include <linux/types.h>
     
    271275#define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
    272276#define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
    273277
    274 #ifdef CONFIG_X86_TSC
     278#if defined(CONFIG_X86_TSC) || defined(__mips__)
    275279
    276280#define PSCHED_GET_TIME(stamp) \
    277281({ u64 __cur; \
Note: See TracBrowser for help on using the repository browser.