mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86 acpi: remove redundant function call.
PM_TIMER_TICKS_TO_US() and acpi_pm_tick_to_ns() does the almost the same stuff. Thus remove the old one. Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Signed-off-by: Wei Gang <wei.gang@intel.com>
This commit is contained in:
1 parent
3967bb3aff
commit
dcf9f950dc
3 files changed
+10
-7
No files matched your search
@@ -50,11 +50,6 @@
|
||||
|
||||
#define DEBUG_PM_CX
|
||||
|
||||
#define US_TO_PM_TIMER_TICKS(t) ((t * (PM_TIMER_FREQUENCY/1000)) / 1000)
|
||||
#define PM_TIMER_TICKS_TO_US(t) ((t * 1000) / (PM_TIMER_FREQUENCY / 1000))
|
||||
#define C2_OVERHEAD 4 /* 1us (3.579 ticks per us) */
|
||||
#define C3_OVERHEAD 4 /* 1us (3.579 ticks per us) */
|
||||
|
||||
static void (*lapic_timer_off)(void);
|
||||
static void (*lapic_timer_on)(void);
|
||||
|
||||
@@ -366,7 +361,7 @@ static void acpi_processor_idle(void)
|
||||
cx->usage++;
|
||||
if ( sleep_ticks > 0 )
|
||||
{
|
||||
power->last_residency = PM_TIMER_TICKS_TO_US(sleep_ticks);
|
||||
power->last_residency = acpi_pm_tick_to_ns(sleep_ticks) / 1000UL;
|
||||
cx->time += sleep_ticks;
|
||||
}
|
||||
|
||||
@@ -611,7 +606,7 @@ static void set_cx(
|
||||
cx->latency = xen_cx->latency;
|
||||
cx->power = xen_cx->power;
|
||||
|
||||
cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);
|
||||
cx->latency_ticks = ns_to_acpi_pm_tick(cx->latency * 1000UL);
|
||||
cx->target_residency = cx->latency * latency_factor;
|
||||
if ( cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2 )
|
||||
acpi_power->safe_state = cx;
|
||||
|
||||
@@ -532,9 +532,11 @@ static struct platform_timesource plt_pmtimer =
|
||||
};
|
||||
|
||||
static struct time_scale pmt_scale;
|
||||
static struct time_scale pmt_scale_r;
|
||||
static __init int init_pmtmr_scale(void)
|
||||
{
|
||||
set_time_scale(&pmt_scale, ACPI_PM_FREQUENCY);
|
||||
pmt_scale_r = scale_reciprocal(pmt_scale);
|
||||
return 0;
|
||||
}
|
||||
__initcall(init_pmtmr_scale);
|
||||
@@ -544,6 +546,11 @@ uint64_t acpi_pm_tick_to_ns(uint64_t ticks)
|
||||
return scale_delta(ticks, &pmt_scale);
|
||||
}
|
||||
|
||||
uint64_t ns_to_acpi_pm_tick(uint64_t ns)
|
||||
{
|
||||
return scale_delta(ns, &pmt_scale_r);
|
||||
}
|
||||
|
||||
/************************************************************
|
||||
* GENERIC PLATFORM TIMER INFRASTRUCTURE
|
||||
*/
|
||||
|
||||
@@ -39,5 +39,6 @@ void pit_broadcast_exit(void);
|
||||
int pit_broadcast_is_available(void);
|
||||
|
||||
uint64_t acpi_pm_tick_to_ns(uint64_t ticks);
|
||||
uint64_t ns_to_acpi_pm_tick(uint64_t ns);
|
||||
|
||||
#endif /* __X86_TIME_H__ */
|
||||