# HG changeset patch # User Erik Quanstrom # Date 1322654102 -3600 # Node ID 3e33bfb8d2f26ab23786c87cfbdea86fc15ae72c # Parent 453784f0b18e8ba74551cc2e748e8dd152fba815 segment: size miscalcuation the size in sg.size is a number of pages, not a size in bytes. using a size in bytes caused sg.size to saturate to zero, thus causing telnet(1) to fail. this isn't a complete fix. i think sg.size should be in bytes and thus a uintptr. then we don't need to tie page sizes to segment sizes so strongly. R=nixiedev CC=nix-dev http://codereview.appspot.com/5435046 Committer: Noah Evans diff -r 453784f0b18e -r 3e33bfb8d2f2 sys/src/nix/mk/parse --- a/sys/src/nix/mk/parse Fri Nov 25 10:06:40 2011 +0000 +++ b/sys/src/nix/mk/parse Wed Nov 30 12:55:02 2011 +0100 @@ -363,10 +363,10 @@ s = s "Physseg physseg[" n+8 "] = {\n"; s = s "\t{\t.attr\t= SG_SHARED,\n"; s = s "\t\t.name\t= \"shared\",\n"; - s = s "\t\t.size\t= SEGMAXSIZE,\n\t},\n"; + s = s "\t\t.size\t= SEGMAXPG,\n\t},\n"; s = s "\t{\t.attr\t= SG_BSS,\n"; s = s "\t\t.name\t= \"memory\",\n"; - s = s "\t\t.size\t= SEGMAXSIZE,\n\t},\n"; + s = s "\t\t.size\t= SEGMAXPG,\n\t},\n"; s = s t "};\nint nphysseg = " n+8 ";\n\n"; s = s "char dbgflg[256]"; diff -r 453784f0b18e -r 3e33bfb8d2f2 sys/src/nix/port/portdat.h --- a/sys/src/nix/port/portdat.h Fri Nov 25 10:06:40 2011 +0000 +++ b/sys/src/nix/port/portdat.h Wed Nov 30 12:55:02 2011 +0100 @@ -403,7 +403,7 @@ #define pagedout(s) (PTR2UINT(s) == 0 || onswap(s)) #define swapaddr(s) (PTR2UINT(s) & ~PG_ONSWAP) -#define SEGMAXSIZE (SEGMAPSIZE*PTEMAPMEM) +#define SEGMAXPG (SEGMAPSIZE) struct Physseg {