commit 606410aaa55836f9109a81e774c7455c49bedb0e
parent 8c22637efa007aefa3b6e5767cfeb27ebf6ff881
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date: Sun, 5 Sep 2010 16:48:05 +0200
merged with rminnich
Diffstat:
5 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/.hgtags b/.hgtags
@@ -3,3 +3,4 @@
af0961db1f4bef6f32f0d63a814bab7f6401ce7c libvx32-0.12
612174f4f4ce4ab246d0dabfab547c46507616fc vx32-20100612
a5c929c5aaed4737be2e7fc5536f35f796f3d95e vx32-20100620
+17483d0086b1cd00448ef9061409edebc416a770 vx32-20100622
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
@@ -162,7 +162,6 @@ runproc(void)
* To avoid the "double sleep" bug
* Full history begins at:
* http://9fans.net/archive/2010/06/71
- * Who knows where it will end
*/
while (p->mach)
sched_yield();
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.
*/
@@ -537,6 +552,7 @@ panic(char *fmt, ...)
microdelay(1000000);
#else
fprint(2, "aborting, to dump core.\n");
+ talktome();
abort();
#endif
}