The definition/size of click anyone?

Barry Shein bzs at world.std.com
Tue Sep 18 11:30:19 AEST 1990


From: rom at mvsun.ericsson.se (Robert Malmgren TK/DG)
>I use a Sun 3/80 running SunOS 4.1 and need to know the size/definition
>of a "click" for a program I'm working on.

The following is from <machine/param.h>:

	/* Clicks (MMU PAGES) to bytes, and back (with rounding) */
	#define ctob(x)         mmu_ptob(x)
	#define btoc(x)         mmu_btopr(x)

tracing back those defs we find...

 /*
  * MMU pages to bytes, and back (with and without rounding)
  */
 #define mmu_ptob(x)     ((x) << MMU_PAGESHIFT)
 #define mmu_btopr(x)    ((((unsigned)(x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))

And tracing that back we find...

 #define MMU_PAGESIZE    0x2000          /* 8192 bytes */
 #define MMU_PAGESHIFT   13              /* log2(MMU_PAGESIZE) */
 #define MMU_PAGEOFFSET  (MMU_PAGESIZE-1)/* Mask of address bits in page */

So, in this case a "click" is 8192 (0x2000) bytes.

On a Vax it's 512 bytes (on 4.3 that's in <machine/machparam.h>).

Obviously, this is machine dependant, but look in <machine/param.h>
and don't give up so easily :-)

I suppose a definition would be: The pagesize in bytes defined by a
single MMU slot (hardware dependent.)
-- 
        -Barry Shein

Software Tool & Die    | {xylogics,uunet}!world!bzs | bzs at world.std.com
Purveyors to the Trade | Voice: 617-739-0202        | Login: 617-739-WRLD



More information about the Comp.unix.internals mailing list