Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104518
b: refs/heads/master
c: 00d21d8
h: refs/heads/master
v: v3
  • Loading branch information
Isaku Yamahata authored and Tony Luck committed May 27, 2008
1 parent a3c6fbb commit bb5d32d
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85cbc503787d577c215f9540c57294e1ec799144
refs/heads/master: 00d21d82b8a9e290286e09d8eedc20bfc33b0eee
15 changes: 15 additions & 0 deletions trunk/arch/ia64/kernel/paravirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,18 @@ struct pv_irq_ops pv_irq_ops = {

.resend_irq = ia64_native_resend_irq,
};

/***************************************************************************
* pv_time_ops
* time operations
*/

static int
ia64_native_do_steal_accounting(unsigned long *new_itm)
{
return 0;
}

struct pv_time_ops pv_time_ops = {
.do_steal_accounting = ia64_native_do_steal_accounting,
};
23 changes: 23 additions & 0 deletions trunk/arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <asm/machvec.h>
#include <asm/delay.h>
#include <asm/hw_irq.h>
#include <asm/paravirt.h>
#include <asm/ptrace.h>
#include <asm/sal.h>
#include <asm/sections.h>
Expand All @@ -48,6 +49,15 @@ EXPORT_SYMBOL(last_cli_ip);

#endif

#ifdef CONFIG_PARAVIRT
static void
paravirt_clocksource_resume(void)
{
if (pv_time_ops.clocksource_resume)
pv_time_ops.clocksource_resume();
}
#endif

static struct clocksource clocksource_itc = {
.name = "itc",
.rating = 350,
Expand All @@ -56,6 +66,9 @@ static struct clocksource clocksource_itc = {
.mult = 0, /*to be calculated*/
.shift = 16,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
#ifdef CONFIG_PARAVIRT
.resume = paravirt_clocksource_resume,
#endif
};
static struct clocksource *itc_clocksource;

Expand Down Expand Up @@ -156,6 +169,9 @@ timer_interrupt (int irq, void *dev_id)

profile_tick(CPU_PROFILING);

if (paravirt_do_steal_accounting(&new_itm))
goto skip_process_time_accounting;

while (1) {
update_process_times(user_mode(get_irq_regs()));

Expand Down Expand Up @@ -185,6 +201,8 @@ timer_interrupt (int irq, void *dev_id)
local_irq_disable();
}

skip_process_time_accounting:

do {
/*
* If we're too close to the next clock tick for
Expand Down Expand Up @@ -334,6 +352,11 @@ ia64_init_itm (void)
*/
clocksource_itc.rating = 50;

paravirt_init_missing_ticks_accounting(smp_processor_id());

/* avoid softlock up message when cpu is unplug and plugged again. */
touch_softlockup_watchdog();

/* Setup the CPU local timer tick */
ia64_cpu_local_tick();

Expand Down
32 changes: 32 additions & 0 deletions trunk/include/asm-ia64/paravirt.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,35 @@ ia64_resend_irq(unsigned int vector)
pv_irq_ops.resend_irq(vector);
}

/******************************************************************************
* replacement of time operations.
*/

extern struct itc_jitter_data_t itc_jitter_data;
extern volatile int time_keeper_id;

struct pv_time_ops {
void (*init_missing_ticks_accounting)(int cpu);
int (*do_steal_accounting)(unsigned long *new_itm);

void (*clocksource_resume)(void);
};

extern struct pv_time_ops pv_time_ops;

static inline void
paravirt_init_missing_ticks_accounting(int cpu)
{
if (pv_time_ops.init_missing_ticks_accounting)
pv_time_ops.init_missing_ticks_accounting(cpu);
}

static inline int
paravirt_do_steal_accounting(unsigned long *new_itm)
{
return pv_time_ops.do_steal_accounting(new_itm);
}

#endif /* !__ASSEMBLY__ */

#else
Expand All @@ -215,6 +244,9 @@ ia64_resend_irq(unsigned int vector)
#define paravirt_arch_setup_nomca() 0
#define paravirt_post_smp_prepare_boot_cpu() do { } while (0)

#define paravirt_init_missing_ticks_accounting(cpu) do { } while (0)
#define paravirt_do_steal_accounting(new_itm) 0

#endif /* __ASSEMBLY__ */


Expand Down

0 comments on commit bb5d32d

Please sign in to comment.