diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2010-08-28 08:03:29 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2010-08-28 08:03:29 +0000 |
commit | 707917e57b9e89c2d8a0b8c5ef3f2fd4abe19556 (patch) | |
tree | db25003fe1513ee1e6b3319f1520510b66d46406 | |
parent | 145f151a7942ca39adbf26b7aabd3df7c445a9a2 (diff) | |
download | FreeBSD-src-707917e57b9e89c2d8a0b8c5ef3f2fd4abe19556.zip FreeBSD-src-707917e57b9e89c2d8a0b8c5ef3f2fd4abe19556.tar.gz |
Register an interrupt vector for DTrace return probes. There is some
code missing in lapic to make sure that we don't overwrite this entry,
but this will be done on a sequent commit.
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | sys/amd64/amd64/exception.S | 4 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 7 | ||||
-rw-r--r-- | sys/amd64/include/segments.h | 1 | ||||
-rw-r--r-- | sys/i386/i386/exception.s | 2 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 11 | ||||
-rw-r--r-- | sys/i386/include/segments.h | 1 |
6 files changed, 25 insertions, 1 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S index c18f27f..37e89a00 100644 --- a/sys/amd64/amd64/exception.S +++ b/sys/amd64/amd64/exception.S @@ -108,6 +108,10 @@ IDTVEC(dbg) TRAP_NOEN(T_TRCTRAP) IDTVEC(bpt) TRAP_NOEN(T_BPTFLT) +#ifdef KDTRACE_HOOKS +IDTVEC(dtrace_ret) + TRAP_NOEN(T_DTRACE_RET) +#endif /* Regular traps; The cpu does not supply tf_err for these. */ #define TRAP(a) \ diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 6bec71b..fe68600 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_msgbuf.h" #include "opt_perfmon.h" #include "opt_sched.h" +#include "opt_kdtrace.h" #include <sys/param.h> #include <sys/proc.h> @@ -1089,6 +1090,9 @@ extern inthand_t IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), IDTVEC(xmm), IDTVEC(dblfault), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif IDTVEC(fast_syscall), IDTVEC(fast_syscall32); #ifdef DDB @@ -1617,6 +1621,9 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_AC, &IDTVEC(align), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_MC, &IDTVEC(mchk), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_XF, &IDTVEC(xmm), SDT_SYSIGT, SEL_KPL, 0); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYSIGT, SEL_UPL, 0); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (long) idt; diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h index 282c1ae..22dc95a 100644 --- a/sys/amd64/include/segments.h +++ b/sys/amd64/include/segments.h @@ -214,6 +214,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 575b98d..13562fa 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -108,6 +108,8 @@ IDTVEC(nmi) pushl $0; TRAP(T_NMI) IDTVEC(bpt) pushl $0; TRAP(T_BPTFLT) +IDTVEC(dtrace_ret) + pushl $0; TRAP(T_DTRACE_RET) IDTVEC(ofl) pushl $0; TRAP(T_OFLOW) IDTVEC(bnd) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 872d09b..ef229ca 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_npx.h" #include "opt_perfmon.h" #include "opt_xbox.h" +#include "opt_kdtrace.h" #include <sys/param.h> #include <sys/proc.h> @@ -1876,7 +1877,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2825,6 +2830,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; diff --git a/sys/i386/include/segments.h b/sys/i386/include/segments.h index 0b12f62..deeaf76 100644 --- a/sys/i386/include/segments.h +++ b/sys/i386/include/segments.h @@ -207,6 +207,7 @@ struct region_descriptor { #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ #define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ +#define IDT_DTRACE_RET 0x92 /* DTrace pid provider Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) |