home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / i386 / machparam.h < prev    next >
Text File  |  1993-10-19  |  1KB  |  58 lines

  1. /* 
  2.  * Copyright (c) 1987 NeXT, Inc.
  3.  *
  4.  * HISTORY
  5.  *
  6.  * 20 April 1992 David E. Bohman at NeXT
  7.  *    Created from 68k version.
  8.  * 21-Nov-88  Avadis Tevanian (avie) at NeXT
  9.  *    Moved assertion definitions to machine independent <kern/assert.h>.
  10.  *
  11.  * 09-Nov-86  John Seamons (jks) at NeXT
  12.  *    Ported to NeXT.
  13.  */ 
  14.  
  15. #ifndef    _I386_MACHPARAM_
  16. #define    _I386_MACHPARAM_
  17.  
  18. #import <mach/vm_param.h>
  19.  
  20. /*
  21.  * Machine dependent 'constants'.
  22.  */
  23. #define    NBPG    PAGE_SIZE    /* bytes/page */
  24. #define    PGOFSET    (NBPG-1)    /* byte offset into page */
  25. #define    PGSHIFT    PAGE_SHIFT    /* LOG2(NBPG) */
  26.  
  27. #define    CLSIZE            1
  28. #define    CLSIZELOG2        0
  29.  
  30. /*
  31.  * Some macros for units conversion
  32.  */
  33. /* Core clicks (NeXT_page_size bytes) to segments and vice versa */
  34. #define    ctos(x)    (x)
  35. #define    stoc(x)    (x)
  36.  
  37. /* clicks to bytes */
  38. #define    ctob(x)    ((x) << PGSHIFT)
  39.  
  40. /* bytes to clicks */
  41. #define    btoc(x)    ((((unsigned)(x)+PGOFSET) >> PGSHIFT))
  42.  
  43. /*
  44.  * Macros to decode processor status word.
  45.  */
  46. #define STATUS_WORD(rpl, ipl)    (((ipl) << 8) | (rpl))
  47. #define    USERMODE(x)        (((x) & 3) == 3)
  48. #define    BASEPRI(x)        (((x) & (255 << 8)) == 0)
  49.  
  50. #if    defined(KERNEL) || defined(STANDALONE)
  51. #define    DELAY(n) us_spin(n)
  52.  
  53. #else    defined(KERNEL) || defined(STANDALONE)
  54. #define    DELAY(n)    { register int N = (n); while (--N > 0); }
  55. #endif    defined(KERNEL) || defined(STANDALONE)
  56.  
  57. #endif    _I386_MACHPARAM_
  58.