home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / machine / h / machparam
Encoding:
Text File  |  1995-01-11  |  2.0 KB  |  84 lines

  1. /*
  2.  * $Header: /ax/networking:include/machine/machparam.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/machine/machparam.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    machparam.h,v $
  8.  * Revision 1.1  95/01/11  10:14:38  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.4  88/10/25  13:31:55  brian
  12.  * Macro 'btowholec' added.
  13.  * 
  14.  * Revision 1.3  88/06/17  20:08:08  beta
  15.  * Acorn Unix initial beta version
  16.  * 
  17.  */
  18. /*
  19.  * Copyright (c) 1982, 1986 Regents of the University of California.
  20.  * All rights reserved.  The Berkeley software License Agreement
  21.  * specifies the terms and conditions for redistribution.
  22.  *
  23.  *    @(#)machparam.h    7.1 (Berkeley) 6/5/86
  24.  */
  25.  
  26. /*
  27.  * Machine dependent constants for ARM.
  28.  */
  29. #define    KTLBASE        512        /* kernel text logical page base */
  30. #define    PMLBASE        1024        /* physical memory logical page base */
  31. #define    NBPG        32768        /* bytes/page */
  32. #define    PGOFSET        (NBPG-1)    /* byte offset into page */
  33. #define    PGSHIFT        15        /* LOG2(NBPG) */
  34. #define    CLSIZE        1
  35. #define    CLSIZELOG2    0
  36. #define    SSIZE        1        /* initial stack size/NBPG */
  37. #define    SINCR        1        /* increment of stack/NBPG */
  38. #define    UPAGES        1        /* pages of u-area */
  39.  
  40. /*
  41.  * Some macros for units conversion
  42.  */
  43. /* Core clicks (32768 bytes) to segments and vice versa */
  44. #define    ctos(x)    (x)
  45. #define    stoc(x)    (x)
  46.  
  47. /* Core clicks (32768 bytes) to disk blocks */
  48.  
  49. #define    ctod(x)    ((x)*NBPG/512)
  50. #define    dtoc(x)    ((x)*512/NBPG)
  51.  
  52. #define    dtob(x)    ((x)*512)
  53.  
  54. /* clicks to bytes */
  55. #define    ctob(x)    ((x)*NBPG)
  56.  
  57. /* bytes to clicks */
  58. #define    btoc(x)    (((unsigned)(x)+(NBPG-1))/NBPG)
  59.  
  60. /* the number of whole clicks in a number of bytes */
  61. #define btowholec(x) ((unsigned)(x)/NBPG)
  62.  
  63. /*
  64.  * Macros to decode processor status word.
  65.  */
  66.  
  67. #    define    USER_MODE        0
  68. #    define    SUPER_MODE        3
  69. #    define    IS_USER_MODE(mode)    ((mode) == USER_MODE)
  70.  
  71. #define    BASEPRI(pc)    (((pc)&3)==0)
  72.  
  73. #ifdef KERNEL
  74. #ifndef LOCORE
  75. int    cpuspeed;
  76. #endif
  77. #define    DELAY(n)    { register int N = cpuspeed * (n); while (--N > 0); }
  78.  
  79. #else KERNEL
  80. #define    DELAY(n)    { register int N = (n); while (--N > 0); }
  81. #endif KERNEL
  82.  
  83. /* EOF machparam.h */
  84.