home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / mach / mach_init.h < prev    next >
Text File  |  1991-06-14  |  3KB  |  93 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1989 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  * HISTORY 
  9.  * $Log:    mach_init.h,v $
  10.  * 08-May-90  Morris Meyer (mmeyer) at NeXT
  11.  *    Added prototypes for thread_reply(), host_self(), 
  12.  *    host_priv_self().task_notify(), thread_self(), init_process(),
  13.  *    swtch_pri(), swtch(), thread_switch(), mach_swapon().
  14.  *
  15.  * 22-Mar-90  Gregg Kellogg (gk) at NeXT
  16.  *    Removed task_notify() macro (can't use it on NeXT, as it must
  17.  *    be allocated by those who needed.  The trap is the best way to
  18.  *    retrieve this.
  19.  *
  20.  *    Added bootstrap port.
  21.  *
  22.  * Revision 1.3  89/06/13  16:45:00  mrt
  23.  *     Defined macros for thread_reply and made task_data be another
  24.  *     name for thread_reply, a!1bsk_data() is no longer exported from
  25.  *     the kernel.
  26.  *     [89/05/28            mrt]
  27.  * 
  28.  *     Moved definitions of round_page and trunc_page to
  29.  *     here from mach/vm_param.h
  30.  *     [89/05/18            mrt]
  31.  * 
  32.  * Revision 1.2  89/05/05  18:45:39  mrt
  33.  *     Cleanup and change includes for Mach 2.5
  34.  *     [89/04/28            mrt]
  35.  * 
  36.  */
  37. /*
  38.  *    Items provided by the Mach environment initialization.
  39.  */
  40.  
  41. #ifndef    _MACH_INIT_H_
  42. #define    _MACH_INIT_H_    1
  43.  
  44. #import <mach/mach_types.h>
  45.  
  46. /*
  47.  *    Kernel-related ports; how a task/thread controls itself
  48.  */
  49.  
  50. extern    port_t    task_self_;
  51.  
  52. #define    task_self()    task_self_
  53. extern port_t        thread_reply(void);
  54. #define    current_task()    task_self()
  55.  
  56. extern port_t        task_notify(void);
  57. extern port_t        thread_self(void);
  58.  
  59. extern    kern_return_t    init_process(void);
  60. extern    boolean_t      swtch_pri(int pri);
  61. extern    boolean_t      swtch(void);
  62. extern    kern_return_t    thread_switch(int thread_name, int opt, int opt_time);
  63.  
  64. extern int        mach_swapon(char *filename, int flags, 
  65.                     long lowat, long hiwat);
  66.  
  67. extern host_t        host_self(void);
  68. extern host_priv_t    host_priv_self(void);
  69.  
  70. #define    task_data()    thread_reply()
  71.  
  72. extern void slot_name(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, 
  73.     char **cpu_name, char **cpu_subname);
  74. /*
  75.  *    Other important ports in the Mach user environment
  76.  */
  77.  
  78. #define    NameServerPort    name_server_port    /* compatibility */
  79.  
  80. extern    port_t    bootstrap_port;
  81. extern    port_t    name_server_port;
  82.  
  83. /*
  84.  *    Globally interesting numbers
  85.  */
  86.  
  87. extern    vm_size_t    vm_page_size;
  88.  
  89. #define round_page(x)    ((((vm_offset_t)(x) + (vm_page_size - 1)) / vm_page_size) * vm_page_size)
  90. #define trunc_page(x)    ((((vm_offset_t)(x)) / vm_page_size) * vm_page_size)
  91.  
  92. #endif    _MACH_INIT_H_
  93.