ds_routines.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Mach Operating System
  3. * Copyright (c) 1991,1990,1989 Carnegie Mellon University
  4. * All Rights Reserved.
  5. *
  6. * Permission to use, copy, modify and distribute this software and its
  7. * documentation is hereby granted, provided that both the copyright
  8. * notice and this permission notice appear in all copies of the
  9. * software, derivative works or modified versions, and any portions
  10. * thereof, and that both notices appear in supporting documentation.
  11. *
  12. * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13. * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14. * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15. *
  16. * Carnegie Mellon requests users of this software to return to
  17. *
  18. * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
  19. * School of Computer Science
  20. * Carnegie Mellon University
  21. * Pittsburgh PA 15213-3890
  22. *
  23. * any improvements or extensions that they make and grant Carnegie Mellon
  24. * the rights to redistribute these changes.
  25. */
  26. /*
  27. * Author: David B. Golub, Carnegie Mellon University
  28. * Date: 8/89
  29. *
  30. * Device service utility routines.
  31. */
  32. #ifndef DS_ROUTINES_H
  33. #define DS_ROUTINES_H
  34. #include <vm/vm_map.h>
  35. #include <device/device_types.h>
  36. #include <device/io_req.h>
  37. #include <mach/machine/vm_types.h>
  38. /*
  39. * Map for device IO memory.
  40. */
  41. extern vm_map_t device_io_map;
  42. extern queue_head_t io_done_list;
  43. kern_return_t device_read_alloc(io_req_t, vm_size_t);
  44. kern_return_t device_write_get(io_req_t, boolean_t *);
  45. boolean_t device_write_dealloc(io_req_t);
  46. void device_reference(device_t);
  47. boolean_t ds_notify(mach_msg_header_t *msg);
  48. boolean_t ds_open_done(io_req_t);
  49. boolean_t ds_read_done(io_req_t);
  50. boolean_t ds_write_done(io_req_t);
  51. void iowait (io_req_t ior);
  52. kern_return_t device_pager_setup(
  53. const mach_device_t device,
  54. int prot,
  55. vm_offset_t offset,
  56. vm_size_t size,
  57. mach_port_t *pager);
  58. extern void mach_device_init(void);
  59. extern void dev_lookup_init(void);
  60. extern void device_pager_init(void);
  61. extern void io_done_thread(void) __attribute__ ((noreturn));
  62. io_return_t ds_device_write_trap(
  63. device_t dev,
  64. dev_mode_t mode,
  65. recnum_t recnum,
  66. vm_offset_t data,
  67. vm_size_t count);
  68. io_return_t ds_device_writev_trap(
  69. device_t dev,
  70. dev_mode_t mode,
  71. recnum_t recnum,
  72. io_buf_vec_t *iovec,
  73. vm_size_t count);
  74. #endif /* DS_ROUTINES_H */