use uintptr for vas not ulong. the pc directory was largly left alone Reference: /n/atom/patch/applied2013/fstypeclean Date: Mon Jul 29 18:39:34 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/fs/port/lib.h Mon Jul 29 18:38:35 2013 +++ /sys/src/fs/port/lib.h Mon Jul 29 18:38:35 2013 @@ -131,7 +131,7 @@ #pragma varargck type "%" void #pragma varargck type "n" int* #pragma varargck type "p" void* -#pragma varargck type "p" ulong +#pragma varargck type "p" uintptr #pragma varargck flag ',' #pragma varargck type "<" void* #pragma varargck type "[" void* --- /sys/src/fs/port/portdat.h Mon Jul 29 18:38:37 2013 +++ /sys/src/fs/port/portdat.h Mon Jul 29 18:38:38 2013 @@ -68,8 +68,8 @@ (sizeof(Centry)*BKPERBLK)) #define BKPERBLK 10 -typedef struct Alarm Alarm; -typedef struct Auth Auth; +typedef struct Alarm Alarm; +typedef struct Auth Auth; typedef struct Conf Conf; typedef struct Label Label; typedef struct Lock Lock; @@ -119,7 +119,7 @@ struct Lock { ulong* sbsem; /* addr of sync bus semaphore */ - ulong pc; + uintptr pc; ulong sr; Mach *m; @@ -380,8 +380,8 @@ int profile; /* are we profiling? */ long* profbuf; - ulong minpc; - ulong maxpc; + uintptr minpc; + uintptr maxpc; ulong nprofbuf; long nlarge; /* number of large message buffers */ @@ -519,8 +519,8 @@ struct Label { - ulong pc; - ulong sp; + uintptr pc; + uintptr sp; }; struct Talarm @@ -533,8 +533,8 @@ { ulong nmach; /* processors */ ulong nproc; /* processes */ - ulong mem; /* total physical bytes of memory */ - ulong sparemem; /* memory left for check/dump and chans */ + uintptr mem; /* total physical bytes of memory */ + uintptr sparemem; /* memory left for check/dump and chans */ ulong nuid; /* distinct uids */ ulong nserve; /* server processes */ ulong nrahead; /* read ahead processes */ @@ -630,7 +630,7 @@ // Lock alarmlock; /* access to alarm list */ // void* alarm; /* alarms bound to this clock */ - void (*intr)(Ureg*, ulong); /* pending interrupt */ + void (*intr)(Ureg*, uintptr); /* pending interrupt */ User* intrp; /* process that was interrupted */ ulong cause; /* arg to intr */ Ureg* ureg; /* arg to intr */ @@ -673,11 +673,11 @@ long nlock; long delaysched; Lock *lstack[NHAS]; - ulong pstack[NHAS]; + uintptr pstack[NHAS]; struct { - ulong pc[NHAS]; /* list of pcs for locks this process has */ + uintptr pc[NHAS]; /* list of pcs for locks this process has */ QLock* q[NHAS]; /* list of locks this process has */ QLock* want; /* lock waiting */ } has; --- /sys/src/fs/port/portfns.h Mon Jul 29 18:38:39 2013 +++ /sys/src/fs/port/portfns.h Mon Jul 29 18:38:39 2013 @@ -115,7 +115,7 @@ Iobuf* getbuf(Device*, Off, int); char* getwd(char*, char*); int getc(void); -ulong getcallerpc(void*); +uintptr getcallerpc(void*); Dentry* getdir(Iobuf*, int); Chan* getlcp(uchar*, long); Off getraddr(Device*); @@ -123,7 +123,7 @@ void gotolabel(Label*); void hexdump(void*, int); int iaccess(File*, Dentry*, int); -void* ialloc(ulong, int); +void* ialloc(uintptr, int); void ilock(Lock*); void iunlock(Lock*); Off indfetch(Device*, Off, Off, Off , int, int, int); --- /sys/src/fs/port/sub.c Mon Jul 29 18:38:41 2013 +++ /sys/src/fs/port/sub.c Mon Jul 29 18:38:42 2013 @@ -972,7 +972,7 @@ if(mb == nil) return; if(mb->flags & BTRACE) - print("mbfree: BTRACE cat=%d flags=%ux, caller 0x%lux\n", + print("mbfree: BTRACE cat=%d flags=%ux, caller %#p\n", mb->category, mb->flags, getcallerpc(&mb)); if(mb->flags & FREE) panic("mbfree already free"); --- /sys/src/fs/pc/lock.c Mon Jul 29 18:38:43 2013 +++ /sys/src/fs/pc/lock.c Mon Jul 29 18:38:43 2013 @@ -17,7 +17,7 @@ int i; for(i = 0; i < up->nlock; i++){ - print("%p:%p", up->lstack[i], up->pstack[i]); + print("%#p:%#p", up->lstack[i], up->pstack[i]); if((i%4) == 0) print("\n"); } @@ -29,7 +29,7 @@ lock(Lock *l) { int /*i,*/ nl; - ulong pc; + uintptr pc; pc = getcallerpc(&l); nl = 0; @@ -112,7 +112,8 @@ void ilock(Lock *l) { - ulong x, pc; + ulong x; + uintptr pc; pc = getcallerpc(&l); @@ -121,9 +122,9 @@ goto acquire; if(!l->isilock) - panic("ilock: not ilock %p", pc); + panic("ilock: not ilock %#p", pc); if(l->m == MACHP(m->machno)) - panic("ilock: deadlock cpu%d pc %p lpc %p\n", m->machno, pc, l->pc); + panic("ilock: deadlock cpu%d pc %#p lpc %#p\n", m->machno, pc, l->pc); for(;;){ splx(x); #ifdef multiprocessor @@ -156,11 +157,11 @@ ulong sr; if(l->sbsem == 0) - panic("iunlock nolock: pc %p", getcallerpc(&l)); + panic("iunlock nolock: pc %#p", getcallerpc(&l)); if(l->isilock == 0) - print("iunlock lock: pc %p held by %p\n", getcallerpc(&l), l->pc); + print("iunlock lock: pc %#p held by %#p\n", getcallerpc(&l), l->pc); if((getstatus()&IFLAG) != 0) - print("iunlock lo: %p held by %p\n", getcallerpc(&l), l->pc); + print("iunlock lo: %#p held by %#p\n", getcallerpc(&l), l->pc); sr = l->sr; l->m = 0; @@ -270,7 +271,7 @@ u->has.q[i] = 0; return; } - panic("qunlock: not there %p, called from %p\n", + panic("qunlock: not there %#p, called from %#p\n", q, getcallerpc(&q)); } } @@ -349,8 +350,8 @@ u->has.q[i] = 0; return; } - panic("runlock: not there %p, called from %p\n", - (ulong)q, getcallerpc(&l)); + panic("runlock: not there %#p, called from %#p\n", + q, getcallerpc(&l)); } }