DragonFly submit List (threaded) for 2007-11
DragonFly BSD
DragonFly submit List (threaded) for 2007-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[patch] hwpmc [3/13]


From: Aggelos Economopoulos <aoiko@xxxxxxxxxxxxxx>
Date: Sat, 24 Nov 2007 20:54:46 +0200

Support for pmc interrupt. 

Obtained-from: FreeBSD

Index: platform/pc32/include/smp.h
===================================================================
retrieving revision 1.20
diff -u -p -r1.20 smp.h
--- platform/pc32/include/smp.h
+++ platform/pc32/include/smp.h
@@ -16,6 +16,8 @@
 
 #ifdef _KERNEL
 
+#include <machine_base/apic/apicreg.h>
+
 #if defined(SMP)
 
 #ifndef LOCORE
@@ -35,7 +37,6 @@ extern int current_postcode;  /** XXX cu
 			outb(0x80, current_postcode)
 
 
-#include <machine_base/apic/apicreg.h>
 #include <machine/pcb.h>
 
 /* global data in mpboot.s */
@@ -141,9 +142,12 @@ extern cpumask_t		smp_active_mask;
 #endif /* !LOCORE */
 #else	/* !SMP */
 
+extern volatile lapic_t *lapic;
 #define	smp_active_mask	1	/* smp_active_mask always 1 on UP machines */
 
 #endif
 
+void	lapic_enable_pmc_interrupt(void);
+
 #endif /* _KERNEL */
 #endif /* _MACHINE_SMP_H_ */
Index: platform/pc32/i386/machdep.c
===================================================================
retrieving revision 1.127
diff -u -p -r1.127 machdep.c
--- platform/pc32/i386/machdep.c
+++ platform/pc32/i386/machdep.c
@@ -2561,6 +2561,18 @@ outb(u_int port, u_char data)
 
 #endif /* DDB */
 
+#include <machine_base/apic/apicreg.h>
+
+void
+lapic_enable_pmc_interrupt(void)
+{
+	uint32_t value;
+
+	value =  lapic->lvt_pcint;
+	value &= ~APIC_LVT_MASKED;
+	lapic->lvt_pcint = value;
+}
+
 
 
 #include "opt_cpu.h"



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]