Patchwork Replace the values of APIC timer init with macros

login
register
about
Submitter Vikram Narayanan
Date 2011-05-07 19:04:16
Message ID <4DC597B0.4050204@gmail.com>
Download mbox | patch
Permalink /patch/2954/
State Accepted
Commit r6564
Headers show

Comments

Vikram Narayanan - 2011-05-07 19:04:16
This replaces the fixed shift values in the apic timer init with macros.

Signed-off by: Vikram Narayanan <vikram186@gmail.com>
---

Thanks,
Vikram
Vikram Narayanan - 2011-05-10 17:35:53
On Sun, 2011-05-08 at 00:34 +0530, Vikram Narayanan wrote:
> This replaces the fixed shift values in the apic timer init with macros.
> 
> Signed-off by: Vikram Narayanan <vikram186@gmail.com>
> ---
> --- a/src/cpu/x86/lapic/apic_timer.c	Sun May  8 00:18:12 2011
> +++ b/src/cpu/x86/lapic/apic_timer.c	Sun May  8 00:08:54 2011
> @@ -36,7 +36,7 @@
>  	msr_t fsb_clock_sts;
>  
>  	/* Set the apic timer to no interrupts and periodic mode */
> -	lapic_write(LAPIC_LVTT, (1 << 17) | (1<< 16) | (0 << 12) | (0 << 0));
> +	lapic_write(LAPIC_LVTT, (LAPIC_LVT_TIMER_PERIODIC | LAPIC_LVT_MASKED));
>  
>  	/* Set the divider to 1, no divider */
>  	lapic_write(LAPIC_TDCR, LAPIC_TDR_DIV_1);

Think this is quite trivial. Can someone comment on this so that this
will be merged in the next commit?

-
Thanks,
Vikram

Patch

--- a/src/cpu/x86/lapic/apic_timer.c	Sun May  8 00:18:12 2011
+++ b/src/cpu/x86/lapic/apic_timer.c	Sun May  8 00:08:54 2011
@@ -36,7 +36,7 @@ 
 	msr_t fsb_clock_sts;
 
 	/* Set the apic timer to no interrupts and periodic mode */
-	lapic_write(LAPIC_LVTT, (1 << 17) | (1<< 16) | (0 << 12) | (0 << 0));
+	lapic_write(LAPIC_LVTT, (LAPIC_LVT_TIMER_PERIODIC | LAPIC_LVT_MASKED));
 
 	/* Set the divider to 1, no divider */
 	lapic_write(LAPIC_TDCR, LAPIC_TDR_DIV_1);