home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / kernserv / prototypes.h < prev    next >
Text File  |  1992-07-29  |  3KB  |  100 lines

  1. /*    @(#)ldd.h    2.0    03/20/90    (c) 1990 NeXT    
  2.  *
  3.  * kernserv/prototypes.h - kernel prototypes used by loadable device drivers
  4.  *
  5.  * HISTORY
  6.  * 22-May-91    Gregg Kellogg (gk) at NeXT
  7.  *    Split out public interface.  KERNEL_FEATURES is used to not conflict
  8.  *    with within-KERNEL definitions.
  9.  *
  10.  * 16-Aug-90  Gregg Kellogg (gk) at NeXT
  11.  *    Removed a lot of stuff that's defined in other header files. 
  12.  *    Eventually this file should either go away or contain only imports of
  13.  *    other files.
  14.  *
  15.  * 20-Mar-90    Doug Mitchell at NeXT
  16.  *    Created.
  17.  *
  18.  */
  19.  
  20. #ifndef    _KERN_INTERNAL_PROTOTYPES_Pfine _KERN_INTERNAL_PROTOTYPES_
  21.  
  22. #import <sys/types.h>
  23. #import <kernserv/printf.h>
  24. #import <sys/kernel.h>
  25. #import <sys/buf.h>
  26. #import <sys/uio.h>
  27. #ifdef    m68k
  28. #import <bsd/dev/m68k/autoconf.h>
  29. #endif    m68k
  30. #import <kernserv/machine/us_timer.h>
  31. #import <kernserv/lock.h>
  32.  
  33. /* Copy or initialize data: */
  34. int copyin(const void *p1, void *p2, unsigned int size);
  35. int copyout(const void *p1, void *p2, unsigned int size);
  36. void bcopy(const void *src, void *dest, int length);
  37. void bzero(void *bp, int size);
  38.  
  39. #ifdef    KERNEL
  40. #import <kernserv/kalloc.h>
  41.  
  42. /* Cause a thread to sleep or wakeup: */
  43. void    assert_wait(int event, boolean_t interruptible);
  44. void    biodone(struct buf *bp);
  45. void    biowait(struct buf *bp);
  46. void    clear_wait(thread_t thread, int result, boolean_t interrupt_only);
  47. void    thread_block(void);
  48. void    thread_set_timeout(int ticks);
  49. void    thread_sleep(int event, simple_lock_t lock, boolean_t interruptible);
  50.  
  51. /* Get information about this thread or task: */
  52.  
  53. #ifdef    MACH_USER_API
  54. extern task_t     current_task_EXTERNAL();
  55. extern thread_t    current_thread_EXTERNAL();
  56. #define current_task()     current_task_EXTERNAL()
  57. #define current_thread() current_thread_EXTERNAL()
  58. #endif    MACH_USER_API
  59.  
  60. task_t    (current_task)(void);
  61. int    thread_wait_result(void);
  62. extern  task_t task_self();
  63. extern     thread_t thread_self();
  64.  
  65. /* Create or kill a thread: */
  66. thread_t    kernel_thread(task_t task, void (*start)());
  67. void        thread_halt_self(void);
  68. #endif    KERNEL
  69.  
  70. /* Get or test a virtual address that corresponds to a hardware address: */
  71. caddr_t    map_addr(caddr_t address, int size);
  72. int    probe_rb(void *address);
  73.  
  74. /* Kill the loadable kernel server: */
  75. #if    defined(KERNEL) && !defined(KERNEL_BUILD) && !defined(ASSERT)
  76. #if    DEBUG
  77. #define    ASSERT(e) \
  78.     if ((e) == 0) { \
  79.         printf ("ASSERTION " #e " failed at line %d in %s\n", \
  80.             __LINE__, __FILE__); \
  81.         panic ("assertion failed"); \
  82.     }
  83. #else    DEBUG
  84. #define ASSERT(e)
  85. #endif    DEBUG
  86. #endif    defined(KERNEL) && defined(KERNEL_BUILD) && !defined(ASSERT)
  87.  
  88. /* Modify or inspect a string: */
  89. char *    strcat(char *string1, const char *string2);
  90. int     strcmp(const char *string1, const char *string2);
  91. int     strncmp(const char *string1, const char *string2, int len);
  92. char *    strcpy(char *to, const char *from);
  93. char *  strncpy(char *to, const char *from, int len);
  94. int     strlen(const char *string);
  95.  
  96. /* In a UNIX-style server, determine wheQ the user has root privileges: */
  97. int    suser(void);
  98.  
  99. #endif    _KERN_INTERNAL_PROTOTYPES_
  100.