RE: [PATCHSET][2.6-test4][0/6]Support for HPET based timer - Take 2

From: Pallipadi, Venkatesh
Date: Fri Aug 29 2003 - 19:01:20 EST





> -----Original Message-----
> From: Andrew Morton [mailto:akpm@xxxxxxxx]
>
> We seem to keep on proliferating home-grown x86 64-bit math functions.
>
> Do you really need these? Is it possible to use do_div() and
> the C 64x64
> `*' operator instead?
>


We can change these handcoded 64 bit divs to do_div, with just an
additional data copy
(as do_div changes dividend in place). But, changing mul into 64x64 '*'
may be tricky.
Gcc seem to generate a combination of mul, 2imul and add, where as we
are happy with
using only one mull here.

>
> I'd like the rtc emulation patch to be redone to remove the
> ifdefs please,
> they're a real eyesore.
>
> At the top of rtc.c, do something like this:
>
> #ifndef CONFIG_HPET_EMULATE_RTC
> #define is_hpet_enabled() 0
> #define hpet_set_alarm_time(hrs, min, sec) 0
> #define hpet_set_periodic_freq(arg) 0
> static inline int hpet_mask_rtc_irq_bit(int arg) { return 0; }
> #define hpet_rtc_timer_init() do { } while (0)
> #define hpet_rtc_dropped_irq() 0
> #endif
>
> And then all those eleven ifdefs can be removed from rtc.c.


Yes. That surely makes the patch lot more cleaner. Attached is the
updated rtc
emulation patch.

Thanks,
-Venkatesh

Attachment: hpet06_new.patch
Description: hpet06_new.patch