[haiku-gsoc] Re: New timer patch (again) (Was: Re: First timer.diff (from private e-mails))

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Wed, 02 Jul 2008 12:59:13 +0200 CEST

"Dustin Howett" <alaricx@xxxxxxxxx> wrote:
> Fixed everything Stephan pointed out. Cf. the attached. Also, removed
> arch_hpet.c which was still hanging around for some reason. It needs
> to be svn deleted if this is committed. I believe the headers/ hpet
> header needs to as well.

Sorry for the late reply, and thanks for the changes!
There are still some style issues, and I can't really see why it's so 
hard to fix them, like:

> +++ src/system/kernel/arch/x86/timers/x86_pit.c       (revision 0)
> +static int
> +pit_get_prio() {
> +     return sPriority;
> +}
> +
> +static int32

2 blank lines between functions, and '{' goes to the next line for 
functions.
But in any case, it's a minor thing that can be fixed when applying the 
patch, just please take more care in the future.

But I still don't understand why you need the priority = -1 thing at 
all. AFAICS, all timers are initialized in the loop, and the timers are 
never iterated twice or partially; I would just remove it unless you 
have a good reason for this construct.

> +     int timerPriority = -1; // Priority of the timer we're checking.
> +                             // Does gcc2 allow mixed declarations?
> +     timer_info *timer = NULL;
> +     cpu_status state = disable_interrupts();
>  
> -     install_io_interrupt_handler(0, &isa_timer_interrupt, NULL, 0);
> -     clear_isa_hardware_timer();
> +     for (i = 0; (timer = sTimers[i]) != NULL; i++) {
> +             timerPriority = timer->get_priority();

Not sure what you mean by "mixed declarations", but every C compiler 
allows you to move the declaration of timerPriority to the beginning of 
the loop, since it's not used outside of it :-)

Bye,
   Axel.


Other related posts: