buf.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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: 3/90
  29. *
  30. * Definitions to make new IO structures look like old ones
  31. */
  32. #ifndef _DEVICE_BUF_H_
  33. #define _DEVICE_BUF_H_
  34. /*
  35. * io_req and fields
  36. */
  37. #include <device/io_req.h>
  38. #define buf io_req
  39. /*
  40. * Redefine fields for drivers using old names
  41. */
  42. #define b_flags io_op
  43. #define b_bcount io_count
  44. #define b_error io_error
  45. #define b_dev io_unit
  46. #define b_blkno io_recnum
  47. #define b_resid io_residual
  48. #define b_un io_un
  49. #define b_addr data
  50. #define av_forw io_next
  51. #define av_back io_prev
  52. #define b_physblock io_physrec
  53. #define b_blocktotal io_rectotal
  54. /*
  55. * Redefine fields for driver request list heads, using old names.
  56. */
  57. #define b_actf io_next
  58. #define b_actl io_prev
  59. #define b_forw io_link
  60. #define b_back io_rlink
  61. #define b_active io_count
  62. #define b_errcnt io_residual
  63. #define b_bufsize io_alloc_size
  64. /*
  65. * Redefine flags
  66. */
  67. #define B_WRITE IO_WRITE
  68. #define B_READ IO_READ
  69. #define B_OPEN IO_OPEN
  70. #define B_DONE IO_DONE
  71. #define B_ERROR IO_ERROR
  72. #define B_BUSY IO_BUSY
  73. #define B_WANTED IO_WANTED
  74. #define B_BAD IO_BAD
  75. #define B_CALL IO_CALL
  76. #define B_MD1 IO_SPARE_START
  77. /*
  78. * Redefine physio routine
  79. */
  80. #define physio(strat, xbuf, dev, ops, minphys, ior) \
  81. block_io(strat, minphys, ior)
  82. /*
  83. * Export standard minphys routine.
  84. */
  85. extern void minphys(io_req_t);
  86. /*
  87. * Alternate name for iodone
  88. */
  89. #define biodone iodone
  90. #define biowait iowait
  91. #endif /* _DEVICE_BUF_H_ */