M pc/l.s => pc/l.s +24 -0
@@ 511,13 511,37 @@ TEXT setlabel(SB), $0
* The size of each entry in the vector table (6 bytes) is known in trapinit().
*/
TEXT _strayintr(SB), $0
+
+ /* time stamp for interrupt */
PUSHL AX /* save AX */
+ PUSHL DX
+ PUSHL CX
+ MOVL $0x10, CX
+ RDMSR
+ MOVL AX, intrts(SB)
+ MOVL DX, intrts+4(SB)
+ POPL CX
+ POPL DX
+
MOVL 4(SP), AX /* return PC from vectortable(SB) */
MOVBLZX (AX), AX /* trap type */
XCHGL AX, (SP) /* restore AX and put the type on the stack */
JMP intrcommon
TEXT _strayintrx(SB), $0
+
+ /* time stamp for interrupt */
+ PUSHL AX
+ PUSHL DX
+ PUSHL CX
+ MOVL $0x10, CX
+ RDMSR
+ MOVL AX, intrts(SB)
+ MOVL DX, intrts+4(SB)
+ POPL CX
+ POPL DX
+ POPL AX
+
XCHGL AX, (SP) /* exchange AX with pointer to trap type */
MOVBLZX (AX), AX /* trap type -> AX */
XCHGL AX, (SP) /* exchange trap type with AX */
M pc/trap.c => pc/trap.c +2 -0
@@ 15,6 15,8 @@ static void fault386(Ureg*, void*);
static Lock vctllock;
static Vctl *vctl[256];
+uvlong intrts;
+
void
intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf)
{
M port/sysfile.c => port/sysfile.c +1 -3
@@ 109,9 109,7 @@ sysfd2path(ulong *arg)
{
Chan *c, *oc;
- validaddr(arg[1], 1, 0);
- if(vmemchr((char*)arg[1], '\0', arg[2]) == 0)
- error(Ebadarg);
+ validaddr(arg[1], arg[2], 1);
/*
* Undomount below may cclose the chan so bump the