M carrera/fptrap.c => carrera/fptrap.c +7 -5
@@ 174,17 174,19 @@ fpunimp(ulong iw)
return 0;
}
-static uvlong*
+static ulong*
reg(Ureg *ur, int regno)
{
/* regs go from R31 down in ureg, R29 is missing */
- if(regno == 31)
+ switch(regno) {
+ case 31:
return &ur->r31;
- if(regno == 30)
+ case 30:
return &ur->r30;
- if(regno == 29)
+ case 29:
return &ur->sp;
- return (&ur->r28) + (28-regno);
+ }
+ return (&ur->r28) + (28-regno)*(&ur->r27-&ur->r28);
}
static ulong
M carrera/l.s => carrera/l.s +1 -1
@@ 93,7 93,7 @@ TEXT touser(SB), $-4
MOVW M(STATUS), R4
WAIT
AND $(~KMODEMASK), R4
- OR $(KUSER|EXL|IE|UX), R4
+ OR $(KUSER|EXL|IE), R4
MOVW R4, M(STATUS)
WAIT
MOVW R1, SP
M carrera/mem.h => carrera/mem.h +0 -1
@@ 66,7 66,6 @@
#define ERL 0x00000004
#define KSUPER 0x00000008
#define KUSER 0x00000010
-#define UX 0x00000020
#define INTMASK 0x0000ff00
#define INTR0 0x00000100
#define INTR1 0x00000200
M carrera/trap.c => carrera/trap.c +21 -2
@@ 283,6 283,14 @@ trap(Ureg *ur)
}
}
+struct
+{
+ ulong cause;
+ ulong devint3;
+ ulong devint4;
+ ulong state;
+}sisr;
+
void
intr(Ureg *ur)
{
@@ 292,9 300,11 @@ intr(Ureg *ur)
m->intr++;
cause &= INTR7|INTR6|INTR5|INTR4|INTR3|INTR2|INTR1|INTR0;
-
+sisr.cause = cause;
if(cause & INTR3) {
devint = IO(uchar, Intcause);
+sisr.devint3 = devint;
+sisr.state = 0;
switch(devint) {
default:
panic("unknown devint=#%lux", devint);
@@ 318,9 328,11 @@ intr(Ureg *ur)
break;
}
cause &= ~INTR3;
+sisr.state = 1;
}
if(cause & INTR2) {
+sisr.state = 2;
isr = IO(ulong, R4030Isr);
if(isr) {
iprint("R4030 Interrupt\n");
@@ 330,12 342,14 @@ intr(Ureg *ur)
iprint(" MFA #%lux\n", IO(ulong, R4030Mfa));
}
cause &= ~INTR2;
+sisr.state = 3;
}
if(cause & INTR4) {
devint = IO(uchar, I386ack);
vec = devint&~0x7;
-
+sisr.devint4 = devint;
+sisr.state = 4;
/* reenable the 8259 interrupt */
if(vec == Int0vec || vec == Int1vec){
EISAOUTB(Int0ctl, EOI);
@@ 348,13 362,18 @@ intr(Ureg *ur)
iprint("i386ACK #%lux\n", devint);
break;
case 7:
+sisr.state = 5;
audiosbintr();
+sisr.state = 6;
break;
case 13:
+sisr.state = 7;
audiodmaintr();
+sisr.state = 8;
break;
}
cause &= ~INTR4;
+sisr.state = 9;
}
if(cause & INTR7) {
M port/portfns.h => port/portfns.h +1 -0
@@ 244,6 244,7 @@ void uncachepage(Page*);
long unionread(Chan*, void*, long);
void unlock(Lock*);
void unmount(Chan*, Chan*);
+Chan* undomount(Chan*);
void userinit(void);
ulong userpc(void);
long userwrite(char*, int);
M port/sysfile.c => port/sysfile.c +6 -1
@@ 94,7 94,12 @@ sysfd2path(ulong *arg)
error(Ebadarg);
c = fdtochan(arg[0], -1, 0, 0);
-
+ /* If we used open the chan will be at the first element
+ * of a union rather than the mhead of the union. undomount
+ * will make it look like we used Atodir rather than Aopen.
+ */
+ if(c->qid.path & CHDIR)
+ c = undomount(c);
ptpath(c->path, (char*)arg[1], arg[2]);
return 0;
}