home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Headers / driverkit / IODirectDevice.h < prev    next >
Text File  |  1994-08-09  |  3KB  |  106 lines

  1. /*     Copyright (c) 1993 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * IODirectDevice class description.
  4.  *
  5.  * HISTORY
  6.  * 08-Jan-93    Doug Mitchell at NeXT
  7.  *      Created. 
  8.  */
  9.  
  10. #import <driverkit/IODevice.h>
  11.  
  12. @interface IODirectDevice : IODevice
  13. {
  14. @private
  15.     IODeviceDescription    *_deviceDescription;
  16.     port_t            _interruptPort;
  17.     void *            _ioThread;
  18.     id            _deviceDescriptionDelegate;
  19.     void            *_busPrivate;
  20.     void            *_private;
  21.     int            _IODirectDevice_reserved[2];
  22. }
  23.  
  24. /*
  25.  * By defintion, all subclasses of this class are of style IO_DirectDevice.
  26.  * Subclasses need not implement this method.
  27.  */
  28. + (IODeviceStyle)deviceStyle;
  29.  
  30. - initFromDeviceDescription: deviceDescription;
  31. - free;
  32.  
  33. - deviceDescription;
  34. - (void)setDeviceDescription:deviceDescription;
  35. - (port_t)interruptPort;
  36. - (IOReturn)attachInterruptPort;
  37. - (IOReturn)startIOThread;
  38. - (IOReturn)startIOThreadWithPriority:(int)priority;
  39. - (IOReturn)startIOThreadWithFixedPriority:(int)priority;
  40. - (IOReturn)waitForInterrupt:(int *)id;
  41. - (void)receiveMsg;
  42. - (void)timeoutOccurred;
  43. - (void)commandRequestOccurred;
  44. - (void)interruptOccurred;
  45. - (void)interruptOccurredAt:(int)localNum;
  46. - (void)otherOccurred:(int)id;
  47.  
  48. @end    /* IODirectDevice */
  49.  
  50. @interface IODirectDevice(IOInterrupts)
  51. /*
  52.  *  Dealing with interrupts.
  53.  */
  54. - (IOReturn) enableAllInterrupts;
  55. - (void) disableAllInterrupts;
  56.  
  57. - (IOReturn) enableInterrupt    : (unsigned int) localInterrupt;
  58. - (void) disableInterrupt    : (unsigned int) localInterrupt;
  59.  
  60. /*
  61.  *  Implement this method to provide your own function as the handler for a
  62.  *  particular local interrupt, and to specify a level for that handler to run
  63.  *  at.  You can also specify an argument that gets passed to your handler.
  64.  *  This method will be called once before an interrupt is enabled.
  65.  *
  66.  *  This method returns NO by default.
  67.  */
  68. - (BOOL) getHandler        : (IOInterruptHandler *)handler
  69.                         level : (unsigned int *)ipl
  70.                  argument : (unsigned int *) arg
  71.                   forInterrupt : (unsigned int) localInterrupt;
  72.  
  73. @end
  74.  
  75. @interface IODirectDevice(IOMemory)
  76. /*
  77.  *  Methods to map device memory into the calling task's address space.
  78.  */
  79. - (IOReturn) mapMemoryRange    : (unsigned int) localRange
  80.                  to : (vm_address_t *) destAddr
  81.               findSpace : (BOOL) findSpace
  82.               cache : (IOCache) cache;
  83.  
  84. - (void) unmapMemoryRange     : (unsigned int) localRange
  85.                from : (vm_address_t) virtAddr;
  86.  
  87. @end
  88.  
  89. void
  90. IOSendInterrupt(
  91.     void            *interrupt,
  92.     void            *state,
  93.     unsigned int    msgId
  94. );
  95.  
  96. void
  97. IOEnableInterrupt(
  98.     void            *interrupt
  99. );
  100.  
  101. void
  102. IODisableInterrupt(
  103.     void            *interrupt
  104. );
  105.  
  106.