home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / driverkit / devsw.h < prev    next >
Text File  |  1993-07-30  |  2KB  |  95 lines

  1. /*    Copyright (c) 1991 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * devsw.h - Kernel-level functions to allow adding entries
  4.  *             to cdevsw, bdevsw, and vfssw.
  5.  *
  6.  * HISTORY
  7.  * 20-Jan-93    Doug Mitchell at NeXT
  8.  *      Created. 
  9.  */
  10.  
  11. #import <sys/types.h>
  12. #import <bsd/sys/conf.h>
  13. #import <bsd/sys/vfs.h>
  14. #import <objc/objc.h>        /* for BOOL */
  15.  
  16. typedef int (*IOSwitchFunc)();
  17.  
  18. /*
  19.  * Add an entry to bdevsw. Returns the index into bdevsw at which the entry
  20.  * was created, or -1 of no space can be found.
  21.  */
  22. extern int IOAddToBdevswAt(
  23.     int major,
  24.     IOSwitchFunc openFunc,
  25.     IOSwitchFunc closeFunc,
  26.     IOSwitchFunc strategyFunc,
  27.     IOSwitchFunc dumpFunc,
  28.     IOSwitchFunc psizeFunc,
  29.     BOOL isTape);        // TRUE if device is a tape device
  30. extern int IOAddToBdevsw(
  31.     IOSwitchFunc openFunc,
  32.     IOSwitchFunc closeFunc,
  33.     IOSwitchFunc strategyFunc,
  34.     IOSwitchFunc dumpFunc,
  35.     IOSwitchFunc psizeFunc,
  36.     BOOL isTape);        // TRUE if device is a tape device
  37.     
  38. /*
  39.  * Remove an entry from bdevsw, replace it with a null entry.
  40.  */
  41. extern void IORemoveFromBdevsw(int bdevswNumber);
  42.  
  43. /*
  44.  * Add an entry to cdevsw. Returns the index into cdevsw at which the entry
  45.  * was created, or -1 of no space can be found.
  46.  */
  47. extern int IOAddToCdevswAt(
  48.     int major,
  49.     IOSwitchFunc openFunc,
  50.     IOSwitchFunc closeFunc,
  51.     IOSwitchFunc readFunc,
  52.     IOSwitchFunc writeFunc,
  53.     IOSwitchFunc ioctlFunc,
  54.     IOSwitchFunc stopFunc,
  55.     IOSwitchFunc resetFunc,
  56.     IOSwitchFunc selectFunc,
  57.     IOSwitchFunc mmapFunc,
  58.     IOSwitchFunc getcFunc,
  59.     IOSwitchFunc putcFunc);
  60. extern int IOAddToCdevsw(
  61.     IOSwitchFunc openFunc,
  62.     IOSwitchFunc closeFunc,
  63.     IOSwitchFunc readFunc,
  64.     IOSwitchFunc writeFunc,
  65.     IOSwitchFunc ioctlFunc,
  66.     IOSwitchFunc stopFunc,
  67.     IOSwitchFunc resetFunc,
  68.     IOSwitchFunc selectFunc,
  69.     IOSwitchFunc mmapFunc,
  70.     IOSwitchFunc getcFunc,
  71.     IOSwitchFunc putcFunc);
  72.     
  73. /*
  74.  * Remove an entry from cdevsw, replace it with a null entry.
  75.  */
  76. extern void IORemoveFromCdevsw(int cdevswNumber);
  77.  
  78. /*
  79.  * Add an entry to vfssw. Returns the index into vfssw at which the entry
  80.  * was created, or -1 of no space can be found.
  81.  */
  82. extern int IOAddToVfsswAt(
  83.     int index,
  84.     const char *vfsswName,
  85.     const struct vfsops *vfsswOps);
  86. extern int IOAddToVfssw(
  87.     const char *vfsswName,
  88.     const struct vfsops *vfsswOps);
  89.     
  90. /*
  91.  * Remove an entry from vfssw, replace it with a null entry.
  92.  */
  93. extern void IORemoveFromVfssw(int vfsswNumber);
  94.  
  95.