aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/apic_vector.S2
-rw-r--r--sys/amd64/amd64/exception.S42
-rw-r--r--sys/amd64/isa/atpic_vector.S2
-rw-r--r--sys/conf/files.amd646
4 files changed, 43 insertions, 9 deletions
diff --git a/sys/amd64/amd64/apic_vector.S b/sys/amd64/amd64/apic_vector.S
index 3adb3cce483f..75d2372e9251 100644
--- a/sys/amd64/amd64/apic_vector.S
+++ b/sys/amd64/amd64/apic_vector.S
@@ -129,7 +129,6 @@ IDTVEC(spuriousint)
iretq
-MCOUNT_LABEL(bintr2)
ISR_VEC(1, apic_isr1)
ISR_VEC(2, apic_isr2)
ISR_VEC(3, apic_isr3)
@@ -137,7 +136,6 @@ MCOUNT_LABEL(bintr2)
ISR_VEC(5, apic_isr5)
ISR_VEC(6, apic_isr6)
ISR_VEC(7, apic_isr7)
-MCOUNT_LABEL(eintr2)
#ifdef SMP
/*
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S
index d541152a31a9..c93b4490476a 100644
--- a/sys/amd64/amd64/exception.S
+++ b/sys/amd64/amd64/exception.S
@@ -30,6 +30,9 @@
* $FreeBSD$
*/
+#include "opt_atpic.h"
+#include "opt_ia32.h"
+
#include <machine/asmacros.h>
#include <machine/psl.h>
#include <machine/trap.h>
@@ -294,8 +297,44 @@ ENTRY(fork_trampoline)
MEXITCOUNT
jmp doreti /* Handle any ASTs */
+/*
+ * To efficiently implement classification of trap and interrupt handlers
+ * for profiling, there must be only trap handlers between the labels btrap
+ * and bintr, and only interrupt handlers between the labels bintr and
+ * eintr. This is implemented (partly) by including files that contain
+ * some of the handlers. Before including the files, set up a normal asm
+ * environment so that the included files doen't need to know that they are
+ * included.
+ */
+
+#ifdef IA32
+ .data
+ .align 4
+ .text
+ SUPERALIGN_TEXT
+
+#include <amd64/ia32/ia32_exception.S>
+#endif
+
.data
- ALIGN_DATA
+ .align 4
+ .text
+ SUPERALIGN_TEXT
+MCOUNT_LABEL(bintr)
+
+#include <amd64/amd64/apic_vector.S>
+
+#ifdef DEV_ATPIC
+ .data
+ .align 4
+ .text
+ SUPERALIGN_TEXT
+
+#include <amd64/isa/atpic_vector.S>
+#endif
+
+ .text
+MCOUNT_LABEL(eintr)
/*
* void doreti(struct trapframe)
@@ -304,7 +343,6 @@ ENTRY(fork_trampoline)
*/
.text
SUPERALIGN_TEXT
- .globl doreti
.type doreti,@function
doreti:
FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */
diff --git a/sys/amd64/isa/atpic_vector.S b/sys/amd64/isa/atpic_vector.S
index 045b86473b9f..37390a062dbf 100644
--- a/sys/amd64/isa/atpic_vector.S
+++ b/sys/amd64/isa/atpic_vector.S
@@ -72,7 +72,6 @@ IDTVEC(vec_name) ; \
MEXITCOUNT ; \
jmp doreti
-MCOUNT_LABEL(bintr)
INTR(0, atpic_intr0)
INTR(1, atpic_intr1)
INTR(2, atpic_intr2)
@@ -89,4 +88,3 @@ MCOUNT_LABEL(bintr)
INTR(13, atpic_intr13)
INTR(14, atpic_intr14)
INTR(15, atpic_intr15)
-MCOUNT_LABEL(eintr)
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index 5acb530dba92..401b0a7a85d6 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -41,7 +41,7 @@ amd64/acpica/acpi_wakeup.c optional acpi
amd64/acpica/madt.c optional acpi
amd64/amd64/amd64-gdbstub.c optional ddb
amd64/amd64/amd64_mem.c standard
-amd64/amd64/apic_vector.S standard
+#amd64/amd64/apic_vector.S standard
amd64/amd64/atomic.c standard
amd64/amd64/autoconf.c standard
amd64/amd64/busdma_machdep.c standard
@@ -80,7 +80,7 @@ amd64/amd64/uio_machdep.c standard
amd64/amd64/uma_machdep.c standard
amd64/amd64/vm_machdep.c standard
amd64/isa/atpic.c optional atpic isa
-amd64/isa/atpic_vector.S optional atpic isa
+#amd64/isa/atpic_vector.S optional atpic isa
amd64/isa/clock.c standard
amd64/isa/elcr.c standard
amd64/isa/isa.c standard
@@ -140,7 +140,7 @@ pci/agp_via.c optional agp
#
# IA32 binary support
#
-amd64/ia32/ia32_exception.S optional ia32
+#amd64/ia32/ia32_exception.S optional ia32
amd64/ia32/ia32_signal.c optional ia32
amd64/ia32/ia32_sigtramp.S optional ia32
amd64/ia32/ia32_syscall.c optional ia32