Dear all:
I'm trying to trace the cyclic and its backend implementation.
My one-line dtrace and its result are:
[EMAIL PROTECTED] <[EMAIL PROTECTED]>*# dtrace -n 'fbt::cbe_fire:entry{stack();
ustack();
exit(0);}'
dtrace: description 'fbt::cbe_fire:entry' matched 1 probe
CPU ID FUNCTION:NAME
0 8077 cbe_fire:entry
unix`av_dispatch_autovect+0x69
unix`dispatch_hilevel+0xf
unix`switch_sp_and_call+0xf
unix`do_interrupt+0xbb
unix`_interrupt+0x59
genunix`anon_array_enter+0x2b
genunix`segvn_faultpage+0x13c
genunix`segvn_fault+0x8a4
genunix`as_fault+0x4ae
unix`pagefault+0x6b
unix`trap+0xabd
unix`0xfe80037c*
I guess that "_interrupt" is the timer-interrupt handler. In interrupt.s,
it is defined as
* ENTRY_NP2(cmnint, _interrupt)
..........
SET_SIZE(cmnint)
SET_SIZE(_interrupt)
*It implies that _interrupt should be one of the interrupt handler routines,
and it has another name, cmnint.
Then, I search "_interrupt" and "cmnint" in the whole source (i.e.
usr/src/uts).
The result shows no one use (e.g. call it, jmp to it (some trap handler jmp
to cmnint, no one jmp to _interrupt), or declare it as an interrupt handler
in some IDT entry) this function.
In function init_idt(), the IDT table entries above #31 are initialized as
* /*
* interrupts 32 - 255
*/
for (i = 32; i < 256; i++) {
(void) snprintf(ivctname, sizeof (ivctname), "ivct%d", i);
ivctptr = (void (*)(void))kobj_getsymvalue(ivctname, 0);
if (ivctptr == NULL)
panic("kobj_getsymvalue(%s) failed", ivctname);
set_gatesegd(&idt[i], ivctptr, KCS_SEL, SDT_SYSIGT, SEL_KPL);
}*
and some of them would be re-registered. (e.g. the T_INT80, T_SOFTINT,
T_SYSCALLINT, T_DTRACE_RET).
It seems the IRQ interrupt handler would be some function named "ivct#N"
because the 32 IRQs should be mapped to 32 continuous vectors in IDT.
And in exception.s, the ivct#N is defined as
*#define MKIVCT(n) \
ENTRY_NP(ivct/**/n) \
push $0; \
push $n - 0x20; \
jmp cmnint; \
SET_SIZE(ivct/**/n)*
So far, I guess the default IRQ interrupt handler would be "ivct#N".
Am I right?
If I'm right, why stack() in dtrace shows the base stack of cbe_fire() is
_interrupt, not the ivct#N?
If not, do I miss anything? I mean, does the timer register its
timer-interrupt-handler again in some other place? And the handler is
"_interrupt", but why couldn't I find any line of code using "_interrupt"
except the line of "_interrupt"'s definition?
TIA
p.s. In "Solaris Internal, 2ed", it just talks about the implementation of
cyclic and its backend. It seems these parts is picked up from the comments
in cyclic.c and cyclic_impl.h.
Are there any documents talking about timer-interrupt (or say external
interrupt) handler on x86 platform? Please recommend me some.
Kind Regards,
TJ
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code