Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139592
b: refs/heads/master
c: f927da1
h: refs/heads/master
v: v3
  • Loading branch information
Isaku Yamahata authored and Tony Luck committed Mar 26, 2009
1 parent 0b260ed commit 7eb1a16
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 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: 496203b15b7249599712525c2b6aafe231b4628d
refs/heads/master: f927da178671a824cf6c530f0623544206387e57
7 changes: 7 additions & 0 deletions trunk/arch/ia64/include/asm/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ struct pv_time_ops {
int (*do_steal_accounting)(unsigned long *new_itm);

void (*clocksource_resume)(void);

unsigned long long (*sched_clock)(void);
};

extern struct pv_time_ops pv_time_ops;
Expand All @@ -242,6 +244,11 @@ paravirt_do_steal_accounting(unsigned long *new_itm)
return pv_time_ops.do_steal_accounting(new_itm);
}

static inline unsigned long long paravirt_sched_clock(void)
{
return pv_time_ops.sched_clock();
}

#endif /* !__ASSEMBLY__ */

#else
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/ia64/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ get_cycles (void)
}

extern void ia64_cpu_local_tick (void);
extern unsigned long long ia64_native_sched_clock (void);

#endif /* _ASM_IA64_TIMEX_H */
10 changes: 8 additions & 2 deletions trunk/arch/ia64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ END(ia64_delay_loop)
* except that the multiplication and the shift are done with 128-bit
* intermediate precision so that we can produce a full 64-bit result.
*/
GLOBAL_ENTRY(sched_clock)
GLOBAL_ENTRY(ia64_native_sched_clock)
addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
mov.m r9=ar.itc // fetch cycle-counter (35 cyc)
;;
Expand All @@ -1066,7 +1066,13 @@ GLOBAL_ENTRY(sched_clock)
;;
shrp r8=r9,r8,IA64_NSEC_PER_CYC_SHIFT
br.ret.sptk.many rp
END(sched_clock)
END(ia64_native_sched_clock)
#ifndef CONFIG_PARAVIRT
//unsigned long long
//sched_clock(void) __attribute__((alias("ia64_native_sched_clock")));
.global sched_clock
sched_clock = ia64_native_sched_clock
#endif

#ifdef CONFIG_VIRT_CPU_ACCOUNTING
GLOBAL_ENTRY(cycle_to_cputime)
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/ia64/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,4 +366,5 @@ ia64_native_do_steal_accounting(unsigned long *new_itm)

struct pv_time_ops pv_time_ops = {
.do_steal_accounting = ia64_native_do_steal_accounting,
.sched_clock = ia64_native_sched_clock,
};
9 changes: 9 additions & 0 deletions trunk/arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ EXPORT_SYMBOL(last_cli_ip);

#endif

#ifdef CONFIG_PARAVIRT
/* We need to define a real function for sched_clock, to override the
weak default version */
unsigned long long sched_clock(void)
{
return paravirt_sched_clock();
}
#endif

#ifdef CONFIG_PARAVIRT
static void
paravirt_clocksource_resume(void)
Expand Down

0 comments on commit 7eb1a16

Please sign in to comment.