commit 093c5060ae6ca29a5ca8813f67e711c4a04dae83
parent b1304f7ab2facdaec4d97b480535c1633d03247c
Author: rminnich@gmail.com <none@none>
Date: Thu, 2 Sep 2010 22:49:45 -0700
Fix the tos issue -- need to explicitly size the struct members in
tos.h since we may build on 64-bit system and plan 9 is *always* 32-bit
for now
Diffstat:
4 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/src/9vx/a/tos.h b/src/9vx/a/tos.h
@@ -1,6 +1,7 @@
typedef struct Tos Tos;
typedef struct Plink Plink;
+#if 0
struct Tos {
struct /* Per process profiling */
@@ -19,5 +20,25 @@ struct Tos {
ulong clock;
/* top of stack is here */
};
+#else
+
+struct Tos {
+ struct /* Per process profiling */
+ {
+ uint32_t pp; /* known to be 0(ptr) */
+ uint32_t next; /* known to be 4(ptr) */
+ uint32_t last;
+ uint32_t first;
+ uint32_t pid;
+ uint32_t what;
+ } prof;
+ uvlong cyclefreq; /* cycle clock frequency if there is one, 0 otherwise */
+ vlong kcycles; /* cycles spent in kernel */
+ vlong pcycles; /* cycles spent in process (kernel + user) */
+ uint32_t pid; /* might as well put the pid here */
+ uint32_t clock;
+ /* top of stack is here */
+};
+#endif
extern Tos *_tos;
diff --git a/src/9vx/nogui.c b/src/9vx/nogui.c
@@ -77,7 +77,7 @@ unloadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata)
return _unloadmemimage(i, r, data, ndata);
}
-ulong
+uint32
pixelbits(Memimage *m, Point p)
{
return _pixelbits(m, p);
diff --git a/src/9vx/sched.c b/src/9vx/sched.c
@@ -158,6 +158,8 @@ runproc(void)
m->machno, p->pid, p->text, kprocq.n, nrunproc);
unlock(&kprocq.lk);
punlock(&run);
+ while (p->mach)
+ sched_yield();
return p;
}
diff --git a/src/9vx/stub.c b/src/9vx/stub.c
@@ -508,6 +508,21 @@ iprint(char *fmt, ...)
return n;
}
+void
+talktome(void)
+{
+ int i;
+ static char cmd[512];
+ while (fgets(cmd, sizeof(cmd), stdin)) {
+ if (! strcmp(cmd, "mach")) {
+ for(i = 0; i < MAXMACH; i++) {
+ fprintf(stderr, "%d ", MACHP(i)->splpc);
+ }
+
+ }
+ }
+ fprintf(stderr, "We're done talking\n");
+}
/*
* Panics go to standard error.
*/
@@ -536,6 +551,7 @@ panic(char *fmt, ...)
microdelay(1000000);
#else
fprint(2, "aborting, to dump core.\n");
+ talktome();
abort();
#endif
}