From 9b24f92c5611353cdafb6756ae21b405ebc695dd Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 11 Jun 2004 04:33:54 +0000 Subject: maybe 64-bit better --- src/libmach/map.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/libmach/map.c') diff --git a/src/libmach/map.c b/src/libmach/map.c index 2745dd4c..eed205bc 100644 --- a/src/libmach/map.c +++ b/src/libmach/map.c @@ -6,10 +6,10 @@ #include #include -static int fdrw(Map*, Seg*, ulong, void*, uint, int); -static int zerorw(Map*, Seg*, ulong, void*, uint, int); -static int mrw(Map*, ulong, void*, uint, int); -static int datarw(Map*, Seg*, ulong, void*, uint, int); +static int fdrw(Map*, Seg*, uvlong, void*, uint, int); +static int zerorw(Map*, Seg*, uvlong, void*, uint, int); +static int mrw(Map*, uvlong, void*, uint, int); +static int datarw(Map*, Seg*, uvlong, void*, uint, int); Map* allocmap(void) @@ -71,7 +71,7 @@ findseg(Map *map, char *name, char *file) } int -addrtoseg(Map *map, ulong addr, Seg *sp) +addrtoseg(Map *map, uvlong addr, Seg *sp) { int i; Seg *s; @@ -93,7 +93,7 @@ addrtoseg(Map *map, ulong addr, Seg *sp) } int -addrtosegafter(Map *map, ulong addr, Seg *sp) +addrtosegafter(Map *map, uvlong addr, Seg *sp) { int i; Seg *s, *best; @@ -142,13 +142,13 @@ removeseg(Map *map, int i) } int -get1(Map *map, ulong addr, uchar *a, uint n) +get1(Map *map, uvlong addr, uchar *a, uint n) { return mrw(map, addr, a, n, 1); } int -get2(Map *map, ulong addr, u16int *u) +get2(Map *map, uvlong addr, u16int *u) { u16int v; @@ -159,7 +159,7 @@ get2(Map *map, ulong addr, u16int *u) } int -get4(Map *map, ulong addr, u32int *u) +get4(Map *map, uvlong addr, u32int *u) { u32int v; @@ -170,7 +170,7 @@ get4(Map *map, ulong addr, u32int *u) } int -get8(Map *map, ulong addr, u64int *u) +get8(Map *map, uvlong addr, u64int *u) { u64int v; @@ -181,37 +181,37 @@ get8(Map *map, ulong addr, u64int *u) } int -put1(Map *map, ulong addr, uchar *a, uint n) +put1(Map *map, uvlong addr, uchar *a, uint n) { return mrw(map, addr, a, n, 0); } int -put2(Map *map, ulong addr, u16int u) +put2(Map *map, uvlong addr, u16int u) { u = mach->swap2(u); return mrw(map, addr, &u, 2, 0); } int -put4(Map *map, ulong addr, u32int u) +put4(Map *map, uvlong addr, u32int u) { u = mach->swap4(u); return mrw(map, addr, &u, 4, 0); } int -put8(Map *map, ulong addr, u64int u) +put8(Map *map, uvlong addr, u64int u) { u = mach->swap8(u); return mrw(map, addr, &u, 8, 0); } static Seg* -reloc(Map *map, ulong addr, uint n, ulong *off, uint *nn) +reloc(Map *map, uvlong addr, uint n, uvlong *off, uint *nn) { int i; - ulong o; + uvlong o; if(map == nil){ werrstr("invalid map"); @@ -236,12 +236,12 @@ reloc(Map *map, ulong addr, uint n, ulong *off, uint *nn) } static int -mrw(Map *map, ulong addr, void *a, uint n, int r) +mrw(Map *map, uvlong addr, void *a, uint n, int r) { uint nn; uint tot; Seg *s; - ulong off; + uvlong off; for(tot=0; totoffset + addr; @@ -279,7 +279,7 @@ fdrw(Map *map, Seg *seg, ulong addr, void *a, uint n, int r) } static int -zerorw(Map *map, Seg *seg, ulong addr, void *a, uint n, int r) +zerorw(Map *map, Seg *seg, uvlong addr, void *a, uint n, int r) { USED(map); USED(seg); @@ -294,7 +294,7 @@ zerorw(Map *map, Seg *seg, ulong addr, void *a, uint n, int r) } static int -datarw(Map *map, Seg *seg, ulong addr, void *a, uint n, int r) +datarw(Map *map, Seg *seg, uvlong addr, void *a, uint n, int r) { USED(map); -- cgit v1.2.3