Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173124
b: refs/heads/master
c: 5946fa3
h: refs/heads/master
v: v3
  • Loading branch information
Jan Beulich authored and Ingo Molnar committed Aug 21, 2009
1 parent fc0d468 commit 0a4f72a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 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: 39fe05e58c5e448601ce46e6b03900d5bf31c4b0
refs/heads/master: 5946fa3d5cdeb846a647a1900026af9f8b08c8b5
2 changes: 1 addition & 1 deletion trunk/arch/x86/include/asm/hpet.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern int hpet_force_user;
extern int is_hpet_enabled(void);
extern int hpet_enable(void);
extern void hpet_disable(void);
extern unsigned long hpet_readl(unsigned long a);
extern unsigned int hpet_readl(unsigned int a);
extern void force_hpet_resume(void);

extern void hpet_msi_unmask(unsigned int irq);
Expand Down
45 changes: 23 additions & 22 deletions trunk/arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ struct hpet_dev {
char name[10];
};

unsigned long hpet_readl(unsigned long a)
inline unsigned int hpet_readl(unsigned int a)
{
return readl(hpet_virt_address + a);
}

static inline void hpet_writel(unsigned long d, unsigned long a)
static inline void hpet_writel(unsigned int d, unsigned int a)
{
writel(d, hpet_virt_address + a);
}
Expand Down Expand Up @@ -167,7 +167,7 @@ do { \

static void hpet_reserve_msi_timers(struct hpet_data *hd);

static void hpet_reserve_platform_timers(unsigned long id)
static void hpet_reserve_platform_timers(unsigned int id)
{
struct hpet __iomem *hpet = hpet_virt_address;
struct hpet_timer __iomem *timer = &hpet->hpet_timers[2];
Expand Down Expand Up @@ -205,7 +205,7 @@ static void hpet_reserve_platform_timers(unsigned long id)

}
#else
static void hpet_reserve_platform_timers(unsigned long id) { }
static void hpet_reserve_platform_timers(unsigned int id) { }
#endif

/*
Expand Down Expand Up @@ -246,7 +246,7 @@ static void hpet_reset_counter(void)

static void hpet_start_counter(void)
{
unsigned long cfg = hpet_readl(HPET_CFG);
unsigned int cfg = hpet_readl(HPET_CFG);
cfg |= HPET_CFG_ENABLE;
hpet_writel(cfg, HPET_CFG);
}
Expand All @@ -271,7 +271,7 @@ static void hpet_resume_counter(void)

static void hpet_enable_legacy_int(void)
{
unsigned long cfg = hpet_readl(HPET_CFG);
unsigned int cfg = hpet_readl(HPET_CFG);

cfg |= HPET_CFG_LEGACY;
hpet_writel(cfg, HPET_CFG);
Expand Down Expand Up @@ -314,7 +314,7 @@ static int hpet_setup_msi_irq(unsigned int irq);
static void hpet_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt, int timer)
{
unsigned long cfg, cmp, now;
unsigned int cfg, cmp, now;
uint64_t delta;

switch (mode) {
Expand All @@ -323,7 +323,7 @@ static void hpet_set_mode(enum clock_event_mode mode,
delta = ((uint64_t)(NSEC_PER_SEC/HZ)) * evt->mult;
delta >>= evt->shift;
now = hpet_readl(HPET_COUNTER);
cmp = now + (unsigned long) delta;
cmp = now + (unsigned int) delta;
cfg = hpet_readl(HPET_Tn_CFG(timer));
/* Make sure we use edge triggered interrupts */
cfg &= ~HPET_TN_LEVEL;
Expand All @@ -339,7 +339,7 @@ static void hpet_set_mode(enum clock_event_mode mode,
* (See AMD-8111 HyperTransport I/O Hub Data Sheet,
* Publication # 24674)
*/
hpet_writel((unsigned long) delta, HPET_Tn_CMP(timer));
hpet_writel((unsigned int) delta, HPET_Tn_CMP(timer));
hpet_start_counter();
hpet_print_config();
break;
Expand Down Expand Up @@ -387,9 +387,9 @@ static int hpet_next_event(unsigned long delta,
* what we wrote hit the chip before we compare it to the
* counter.
*/
WARN_ON_ONCE((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt);
WARN_ON_ONCE(hpet_readl(HPET_Tn_CMP(timer)) != cnt);

return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
}

static void hpet_legacy_set_mode(enum clock_event_mode mode,
Expand All @@ -415,7 +415,7 @@ static struct hpet_dev *hpet_devs;
void hpet_msi_unmask(unsigned int irq)
{
struct hpet_dev *hdev = get_irq_data(irq);
unsigned long cfg;
unsigned int cfg;

/* unmask it */
cfg = hpet_readl(HPET_Tn_CFG(hdev->num));
Expand All @@ -425,7 +425,7 @@ void hpet_msi_unmask(unsigned int irq)

void hpet_msi_mask(unsigned int irq)
{
unsigned long cfg;
unsigned int cfg;
struct hpet_dev *hdev = get_irq_data(irq);

/* mask it */
Expand Down Expand Up @@ -600,7 +600,7 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)

for (i = start_timer; i < num_timers - RESERVE_TIMERS; i++) {
struct hpet_dev *hdev = &hpet_devs[num_timers_used];
unsigned long cfg = hpet_readl(HPET_Tn_CFG(i));
unsigned int cfg = hpet_readl(HPET_Tn_CFG(i));

/* Only consider HPET timer with MSI support */
if (!(cfg & HPET_TN_FSB_CAP))
Expand Down Expand Up @@ -815,7 +815,7 @@ static int hpet_clocksource_register(void)
*/
int __init hpet_enable(void)
{
unsigned long id;
unsigned int id;
int i;

if (!is_hpet_capable())
Expand Down Expand Up @@ -933,7 +933,7 @@ fs_initcall(hpet_late_init);
void hpet_disable(void)
{
if (is_hpet_capable()) {
unsigned long cfg = hpet_readl(HPET_CFG);
unsigned int cfg = hpet_readl(HPET_CFG);

if (hpet_legacy_int_enabled) {
cfg &= ~HPET_CFG_LEGACY;
Expand Down Expand Up @@ -973,8 +973,8 @@ static int hpet_prev_update_sec;
static struct rtc_time hpet_alarm_time;
static unsigned long hpet_pie_count;
static u32 hpet_t1_cmp;
static unsigned long hpet_default_delta;
static unsigned long hpet_pie_delta;
static u32 hpet_default_delta;
static u32 hpet_pie_delta;
static unsigned long hpet_pie_limit;

static rtc_irq_handler irq_handler;
Expand Down Expand Up @@ -1025,7 +1025,8 @@ EXPORT_SYMBOL_GPL(hpet_unregister_irq_handler);
*/
int hpet_rtc_timer_init(void)
{
unsigned long cfg, cnt, delta, flags;
unsigned int cfg, cnt, delta;
unsigned long flags;

if (!is_hpet_enabled())
return 0;
Expand All @@ -1035,7 +1036,7 @@ int hpet_rtc_timer_init(void)

clc = (uint64_t) hpet_clockevent.mult * NSEC_PER_SEC;
clc >>= hpet_clockevent.shift + DEFAULT_RTC_SHIFT;
hpet_default_delta = (unsigned long) clc;
hpet_default_delta = clc;
}

if (!(hpet_rtc_flags & RTC_PIE) || hpet_pie_limit)
Expand Down Expand Up @@ -1121,7 +1122,7 @@ int hpet_set_periodic_freq(unsigned long freq)
clc = (uint64_t) hpet_clockevent.mult * NSEC_PER_SEC;
do_div(clc, freq);
clc >>= hpet_clockevent.shift;
hpet_pie_delta = (unsigned long) clc;
hpet_pie_delta = clc;
}
return 1;
}
Expand All @@ -1135,7 +1136,7 @@ EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq);

static void hpet_rtc_timer_reinit(void)
{
unsigned long cfg, delta;
unsigned int cfg, delta;
int lost_ints = -1;

if (unlikely(!hpet_rtc_flags)) {
Expand Down

0 comments on commit 0a4f72a

Please sign in to comment.