device_emul.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Mach device emulation definitions (i386at version).
  3. *
  4. * Copyright (c) 1996 The University of Utah and
  5. * the Computer Systems Laboratory at the University of Utah (CSL).
  6. * All rights reserved.
  7. *
  8. * Permission to use, copy, modify and distribute this software is hereby
  9. * granted provided that (1) source code retains these copyright, permission,
  10. * and disclaimer notices, and (2) redistributions including binaries
  11. * reproduce the notices in supporting documentation, and (3) all advertising
  12. * materials mentioning features or use of this software display the following
  13. * acknowledgement: ``This product includes software developed by the
  14. * Computer Systems Laboratory at the University of Utah.''
  15. *
  16. * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
  17. * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
  18. * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  19. *
  20. * CSL requests users of this software to return to csl-dist@cs.utah.edu any
  21. * improvements that they make and grant CSL redistribution rights.
  22. *
  23. * Author: Shantanu Goel, University of Utah CSL
  24. */
  25. #ifndef _I386AT_DEVICE_EMUL_H_
  26. #define _I386AT_DEVICE_EMUL_H_
  27. #include <mach/notify.h>
  28. #include <device/net_status.h>
  29. /* Each emulation layer provides these operations. */
  30. struct device_emulation_ops
  31. {
  32. void (*reference) (void *);
  33. void (*dealloc) (void *);
  34. ipc_port_t (*dev_to_port) (void *);
  35. io_return_t (*open) (ipc_port_t, mach_msg_type_name_t,
  36. dev_mode_t, char *, device_t *);
  37. io_return_t (*close) (void *);
  38. io_return_t (*write) (void *, ipc_port_t, mach_msg_type_name_t,
  39. dev_mode_t, recnum_t, io_buf_ptr_t, unsigned, int *);
  40. io_return_t (*write_inband) (void *, ipc_port_t, mach_msg_type_name_t,
  41. dev_mode_t, recnum_t, io_buf_ptr_inband_t,
  42. unsigned, int *);
  43. io_return_t (*read) (void *, ipc_port_t, mach_msg_type_name_t,
  44. dev_mode_t, recnum_t, int, io_buf_ptr_t *, unsigned *);
  45. io_return_t (*read_inband) (void *, ipc_port_t, mach_msg_type_name_t,
  46. dev_mode_t, recnum_t, int, char *, unsigned *);
  47. io_return_t (*set_status) (void *, dev_flavor_t, dev_status_t,
  48. mach_msg_type_number_t);
  49. io_return_t (*get_status) (void *, dev_flavor_t, dev_status_t,
  50. mach_msg_type_number_t *);
  51. io_return_t (*set_filter) (void *, ipc_port_t, int, filter_t [], unsigned);
  52. io_return_t (*map) (void *, vm_prot_t, vm_offset_t,
  53. vm_size_t, ipc_port_t *, boolean_t);
  54. void (*no_senders) (mach_no_senders_notification_t *);
  55. io_return_t (*write_trap) (void *, dev_mode_t,
  56. recnum_t, vm_offset_t, vm_size_t);
  57. io_return_t (*writev_trap) (void *, dev_mode_t,
  58. recnum_t, io_buf_vec_t *, vm_size_t);
  59. };
  60. #endif /* _I386AT_DEVICE_EMUL_H_ */