David S. Miller wrote:
I also want to add sparc64 %tick register support here too.
This is an area with a lot of potential cleanup. We should
made an asm/pkt_sched.h to abstract out the clock source
implementation instead of loading net/pkt_sched.h up with
a pile of ifdefs.
Couldn't we just use get_cycles() ? Something like this:
#include <asm/timex.h>
#if sizeof(cycles_t) == sizeof(u64)
#define PSCHED_GET_TIME(stamp) \
do { \
u64 cur = get_cycles(); \
stamp) = cur >> psched_clock_scale; \
} while (0)
#else
#define PSCHED_WATCHER u32
extern PSCHED_WATCHER psched_time_mark;
#define PSCHED_GET_TIME(stamp) \
do { \
u32 cur = get_cycles(); \
if (cur <= psched_time_mark) \
psched_time_base += 0x100000000UL; \
psched_time_mark = cur; \
(stamp) = (psched_time_base + cur) >> psched_clock_scale; \
} while (0)
#endif
Regards
Patrick
|