From e1715c29130a0a1c553acaa8cd2f628b095e02d5 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 28 May 1999 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1999-05-28 --- pc/l.s | 24 ++++++++++++++++++++++++ pc/trap.c | 2 ++ port/sysfile.c | 4 +--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/pc/l.s b/pc/l.s index 62c15033e6b19666c58b630d9ac7edfca46828e7..0fd5099aaa7b507b4fc2e7d7ba88c237a7748251 100644 --- a/pc/l.s +++ b/pc/l.s @@ -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 */ diff --git a/pc/trap.c b/pc/trap.c index f4ce7d2c75f67f3bbbc6c32a26eaa4a10b6c4a03..0377fa2293e0008f39b5292729311c8e45e85b71 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -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) { diff --git a/port/sysfile.c b/port/sysfile.c index 28c83fdcb4f3012be31bb3af4e50373c5231923e..d04697245f9f0a0fae7cedc26995f5f5db1996ca 100644 --- a/port/sysfile.c +++ b/port/sysfile.c @@ -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