[Haiku-commits] r33292 - in haiku/trunk/src/system/kernel/arch/x86: . timers

jackburton at mail.berlios.de jackburton at mail.berlios.de
Fri Sep 25 12:48:42 CEST 2009


Author: jackburton
Date: 2009-09-25 12:48:37 +0200 (Fri, 25 Sep 2009)
New Revision: 33292
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=33292&view=rev

Modified:
   haiku/trunk/src/system/kernel/arch/x86/arch_timer.c
   haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.cpp
Log:
Uncommented the hpet timer from the timers list.
Lowered its priority of hpet timer so it doesn't get picked up first
(yet)
Changed the debug output to be conditional.


Modified: haiku/trunk/src/system/kernel/arch/x86/arch_timer.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_timer.c	2009-09-25 10:36:39 UTC (rev 33291)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_timer.c	2009-09-25 10:48:37 UTC (rev 33292)
@@ -38,7 +38,7 @@
 extern timer_info gHPETTimer;
 
 static timer_info *sTimers[] = {
-//	&gHPETTimer,
+	&gHPETTimer,
 	&gAPICTimer,
 	&gPITTimer,
 	NULL

Modified: haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.cpp	2009-09-25 10:36:39 UTC (rev 33291)
+++ haiku/trunk/src/system/kernel/arch/x86/timers/x86_hpet.cpp	2009-09-25 10:48:37 UTC (rev 33292)
@@ -40,7 +40,7 @@
 static int
 hpet_get_prio()
 {
-	return 3;
+	return 0; //TODO: Should be 3, so it gets picked first
 }
 
 
@@ -68,15 +68,12 @@
 	sHPETRegs->timer[2].comparator = convert_timeout(relativeTimeout);
 
 	// Clear the interrupt (set to 0)
-	//dprintf("clearing interrupts\n");
 	sHPETRegs->timer[2].config &= (~31 << 9);
 
 	// Non-periodic mode, edge triggered
-	//dprintf("edge mode\n");
 	sHPETRegs->timer[2].config &= ~(0x8 & 0x2);
 
 	// Enable timer
-	//dprintf("enable\n");
 	sHPETRegs->timer[2].config |= 0x4;
 
 	restore_interrupts(state);
@@ -120,6 +117,7 @@
 }
 
 
+#ifdef TRACE_HPET
 static void
 dump_timer(volatile struct hpet_timer *timer)
 {
@@ -128,6 +126,7 @@
 	dprintf(" fsb_value: 0x%lx\n", timer->fsb_value);
 	dprintf(" fsb_addr: 0x%lx\n", timer->fsb_addr);	
 }
+#endif
 
 
 static status_t
@@ -170,19 +169,20 @@
 	TRACE(("hpet_init: HPET supports %lu timers, and is %s bits wide.\n",
 		numTimers, HPET_IS_64BIT(sHPETRegs) ? "64" : "32"));
 	
-	dprintf("hpet_init: configuration: 0x%llx, timer_interrupts: 0x%llx\n",
-		sHPETRegs->config, sHPETRegs->timer_interrupts);
+	TRACE(("hpet_init: configuration: 0x%llx, timer_interrupts: 0x%llx\n",
+		sHPETRegs->config, sHPETRegs->timer_interrupts));
 
 	if (numTimers < 3) {
 		dprintf("hpet_init: HPET does not have at least 3 timers. Skipping.\n");
 		return B_ERROR;
 	}
 
+#ifdef TRACE_HPET
 	for (uint32 c = 0; c < numTimers; c++) {
-		dprintf("hpet_init: timer %lu:\n", c);	
+		TRACE(("hpet_init: timer %lu:\n", c));	
 		dump_timer(&sHPETRegs->timer[c]);
 	}
-	
+#endif	
 	install_io_interrupt_handler(0xfb - ARCH_INTERRUPT_BASE,
 		&hpet_timer_interrupt, NULL, B_NO_LOCK_VECTOR);
 	install_io_interrupt_handler(0, &hpet_timer_interrupt, NULL,




More information about the Haiku-commits mailing list