summaryrefslogtreecommitdiff
path: root/sys/src/cmd/5e
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
parent0c005b510506d341e7a8134a4eb2ad48fdbc8168 (diff)
5e: fix amd64
Diffstat (limited to 'sys/src/cmd/5e')
-rw-r--r--sys/src/cmd/5e/fpa.c1
-rw-r--r--sys/src/cmd/5e/proc.c24
-rw-r--r--sys/src/cmd/5e/sys.c6
3 files changed, 27 insertions, 4 deletions
diff --git a/sys/src/cmd/5e/fpa.c b/sys/src/cmd/5e/fpa.c
index c220de881..71bd78d29 100644
--- a/sys/src/cmd/5e/fpa.c
+++ b/sys/src/cmd/5e/fpa.c
@@ -100,6 +100,7 @@ fpaoperation(u32int instr)
case 19: res = (vlong) op2; break;
case 20: res = sqrt(op2); break;
default: sysfatal("unimplemented FPA operation %#x @ %8ux", opc, P->R[15] - 4);
+ return;
}
switch(prec) {
case 0: *Fd = (float) res; break;
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);
}
diff --git a/sys/src/cmd/5e/sys.c b/sys/src/cmd/5e/sys.c
index 25e333a2f..e7fd7d755 100644
--- a/sys/src/cmd/5e/sys.c
+++ b/sys/src/cmd/5e/sys.c
@@ -252,13 +252,15 @@ sysbrk(void)
Segment *s;
v = arg(0);
+ if(systrace)
+ fprint(2, "brk(%#lux)\n", v);
if(v >= P->S[SEGSTACK]->start)
sysfatal("bss > stack, wtf?");
if(v < P->S[SEGBSS]->start)
sysfatal("bss length < 0, wtf?");
s = P->S[SEGBSS];
wlock(&s->rw);
- s->dref = realloc(s->dref, v - s->start + 4);
+ s->dref = realloc(s->dref, v - s->start + sizeof(Ref));
if(s->dref == nil)
sysfatal("error reallocating");
s->data = s->dref + 1;
@@ -503,7 +505,7 @@ sysrendezvous(void)
value = arg(1);
if(systrace)
fprint(2, "rendezvous(%#ux, %#ux)\n", tag, value);
- P->R[0] = (u32int) rendezvous((void *) tag, (void *) value);
+ P->R[0] = (u32int) (uintptr)rendezvous((void *) tag, (void *) value);
if(P->R[0] == ~0)
noteerr(0, 1);
}