M gnot/bbmalloc.c => gnot/bbmalloc.c +2 -3
@@ 63,17 63,16 @@ bbfree(void *p, int n)
splx(s);
}
-void *
+void
flushvirtpage(void *p)
{
flushcpucache();
}
-void *
+void
bbdflush(void *p, int n)
{
flushcpucache();
- return (void *)(((ulong)p));
}
int
M gnot/trap.c => gnot/trap.c +6 -0
@@ 358,6 358,12 @@ execregs(ulong entry, ulong ssize, ulong nargs)
return USTKTOP-BY2WD; /* address of user-level clock */
}
+ulong
+userpc(void)
+{
+ return ((Ureg*)UREGADDR)->pc;
+}
+
/* This routine must save the values of registers the user is not permitted to write
* from devproc and the restore the saved values before returning
*/
D gnot/ureg.h => gnot/ureg.h +0 -25
@@ 1,25 0,0 @@
-struct Ureg
-{
- ulong r0;
- ulong r1;
- ulong r2;
- ulong r3;
- ulong r4;
- ulong r5;
- ulong r6;
- ulong r7;
- ulong a0;
- ulong a1;
- ulong a2;
- ulong a3;
- ulong a4;
- ulong a5;
- ulong a6;
- ulong sp;
- ulong usp;
- ulong magic; /* for db to find bottom of ureg */
- ushort sr;
- ulong pc;
- ushort vo;
- uchar microstate[UREGVARSZ]; /* variable-sized portion */
-};
M pc/trap.c => pc/trap.c +6 -0
@@ 288,6 288,12 @@ execregs(ulong entry, ulong ssize, ulong nargs)
return USTKTOP-BY2WD; /* address of user-level clock */
}
+ulong
+userpc(void)
+{
+ return ((Ureg*)UREGADDR)->pc;
+}
+
/*
* system calls
*/
M port/fault.c => port/fault.c +1 -2
@@ 3,7 3,6 @@
#include "mem.h"
#include "dat.h"
#include "fns.h"
-#include "ureg.h"
#include "../port/error.h"
#define DPRINT
@@ 280,7 279,7 @@ validaddr(ulong addr, ulong len, int write)
}
}
- pprint("invalid address 0x%lux in sys call pc=0x%lux", addr, ((Ureg*)UREGADDR)->pc);
+ pprint("invalid address 0x%lux in sys call pc=0x%lux", addr, userpc());
postnote(u->p, 1, "sys: bad address", NDebug);
error(Ebadarg);
}
M port/page.c => port/page.c +0 -1
@@ 3,7 3,6 @@
#include "mem.h"
#include "dat.h"
#include "fns.h"
-#include "ureg.h"
#include "../port/error.h"
#define PGHFUN(x, y) (((ulong)x^(ulong)y)%PGHSIZE)
M port/portfns.h => port/portfns.h +1 -0
@@ 240,6 240,7 @@ void unlock(Lock*);
void unlockpage(Page*);
long unicode(uchar*);
void userinit(void);
+ulong userpc(void);
void validaddr(ulong, ulong, int);
void* vmemchr(void*, int, int);
void wakeme(Alarm*);
M port/proc.c => port/proc.c +0 -1
@@ 640,7 640,6 @@ proctab(int i)
return &procalloc.arena[i];
}
-#include <ureg.h>
void
procdump(void)
{
M port/segment.c => port/segment.c +0 -1
@@ 3,7 3,6 @@
#include "mem.h"
#include "dat.h"
#include "fns.h"
-#include "ureg.h"
#include "../port/error.h"
Page *lkpage(ulong addr);
M port/swap.c => port/swap.c +0 -1
@@ 3,7 3,6 @@
#include "mem.h"
#include "dat.h"
#include "fns.h"
-#include "ureg.h"
#include "../port/error.h"
/* Predeclaration */
M port/sysproc.c => port/sysproc.c +0 -1
@@ 3,7 3,6 @@
#include "mem.h"
#include "dat.h"
#include "fns.h"
-#include "ureg.h"
#include "../port/error.h"
#include <a.out.h>
M power/main.c => power/main.c +0 -1
@@ 4,7 4,6 @@
#include "dat.h"
#include "fns.h"
#include "io.h"
-#include "ureg.h"
#include "init.h"
/*
M power/trap.c => power/trap.c +6 -0
@@ 564,6 564,12 @@ execregs(ulong entry, ulong ssize, ulong nargs)
return USTKTOP-BY2WD; /* address of user-level clock */
}
+ulong
+userpc(void)
+{
+ return ((Ureg*)UREGADDR)->pc;
+}
+
void
novme(int v)
{
D power/ureg.h => power/ureg.h +0 -44
@@ 1,44 0,0 @@
-struct Ureg
-{
- ulong status;
- ulong pc;
- union{
- ulong sp; /* r29 */
- ulong usp; /* r29 */
- };
- ulong cause;
- ulong badvaddr;
- ulong tlbvirt;
- ulong hi;
- ulong lo;
- ulong r31;
- ulong r30;
- ulong r28;
- ulong r27; /* unused */
- ulong r26; /* unused */
- ulong r25;
- ulong r24;
- ulong r23;
- ulong r22;
- ulong r21;
- ulong r20;
- ulong r19;
- ulong r18;
- ulong r17;
- ulong r16;
- ulong r15;
- ulong r14;
- ulong r13;
- ulong r12;
- ulong r11;
- ulong r10;
- ulong r9;
- ulong r8;
- ulong r7;
- ulong r6;
- ulong r5;
- ulong r4;
- ulong r3;
- ulong r2;
- ulong r1;
-};
M ss/main.c => ss/main.c +0 -1
@@ 4,7 4,6 @@
#include "dat.h"
#include "fns.h"
#include "io.h"
-#include "ureg.h"
#include "init.h"
#include <libg.h>
M ss/screen.c => ss/screen.c +0 -1
@@ 4,7 4,6 @@
#include "dat.h"
#include "fns.h"
#include "io.h"
-#include "ureg.h"
#include "../port/error.h"
#include <libg.h>
M ss/trap.c => ss/trap.c +6 -0
@@ 426,6 426,12 @@ execregs(ulong entry, ulong ssize, ulong nargs)
return USTKTOP-BY2WD; /* address of user-level clock */
}
+ulong
+userpc(void)
+{
+ return ((Ureg*)UREGADDR)->pc;
+}
+
/* This routine must save the values of registers the user is not permitted to write
* from devproc and the restore the saved values before returning
*/