From 35e1aa1bfa5f1bdb2002b724e636ffe1ddea9a09 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 13 Apr 2015 23:35:36 +0200 Subject: [PATCH] segment: don't store pointers in a long --- sys/src/9/port/devsegment.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/src/9/port/devsegment.c b/sys/src/9/port/devsegment.c index 0c9a16d6f..2acaa0d76 100644 --- a/sys/src/9/port/devsegment.c +++ b/sys/src/9/port/devsegment.c @@ -41,7 +41,7 @@ struct Globalseg Rendez replywait; /* where requestor waits */ Proc *kproc; char *data; - long off; + char *addr; int dlen; int cmd; char err[64]; @@ -350,7 +350,7 @@ segmentio(Globalseg *g, void *a, long n, vlong off, int wr) qunlock(&g->l); nexterror(); } - g->off = off + g->s->base; + g->addr = (char*)g->s->base + off; g->data = b; g->dlen = n; docmd(g, wr ? Cwrite : Cread); @@ -571,10 +571,10 @@ segmentkproc(void *arg) done = 1; break; case Cread: - memmove(g->data, (char*)g->off, g->dlen); + memmove(g->data, g->addr, g->dlen); break; case Cwrite: - memmove((char*)g->off, g->data, g->dlen); + memmove(g->addr, g->data, g->dlen); break; } poperror();