summaryrefslogtreecommitdiff
path: root/sys/src/cmd/5e/proc.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-03-08 21:07:57 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-03-08 21:07:57 +0100
commitf05af31f3685423e5f97fd6c17f6e6cb4fc11f4b (patch)
treec84ff9340d66ab4f7ac3b35361ea52589299e8c2 /sys/src/cmd/5e/proc.c
parent0c005b510506d341e7a8134a4eb2ad48fdbc8168 (diff)
5e: fix amd64
Diffstat (limited to 'sys/src/cmd/5e/proc.c')
-rw-r--r--sys/src/cmd/5e/proc.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/sys/src/cmd/5e/proc.c b/sys/src/cmd/5e/proc.c
index f053c1390..b5df57fd2 100644
--- a/sys/src/cmd/5e/proc.c
+++ b/sys/src/cmd/5e/proc.c
@@ -4,10 +4,30 @@
#include <bio.h>
#include <mach.h>
#include <ctype.h>
-#include <tos.h>
#include "dat.h"
#include "fns.h"
+#pragma pack on
+typedef struct Tos Tos;
+struct Tos {
+ struct /* Per process profiling */
+ {
+ ulong pp; /* known to be 0(ptr) */
+ ulong next; /* known to be 4(ptr) */
+ ulong last;
+ ulong first;
+ ulong pid;
+ ulong 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) */
+ ulong pid; /* might as well put the pid here */
+ ulong clock;
+ /* top of stack is here */
+};
+#pragma pack off
+
Process plist;
Lock plistlock;
@@ -77,7 +97,7 @@ copyname(char *file)
if(P->path != nil && decref(P->path) == 0)
free(P->path);
- P->path = emallocz(5 + strlen(file));
+ P->path = emallocz(sizeof(Ref) + strlen(file)+1);
incref(P->path);
strcpy((char*)(P->path + 1), file);
}