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

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